parent
658fffb3a6
commit
faac430f5b
@ -0,0 +1,10 @@
|
|||||||
|
PHP
|
||||||
|
======
|
||||||
|
|
||||||
|
Provides function and environment variables related to PHP.
|
||||||
|
|
||||||
|
Functions
|
||||||
|
---------
|
||||||
|
|
||||||
|
- `php-info` exposes information about the PHP environment via the
|
||||||
|
`$php_info` associative array.
|
@ -0,0 +1,22 @@
|
|||||||
|
#
|
||||||
|
# Exposes information about the PHP environment via the $php_info associative
|
||||||
|
# array.
|
||||||
|
#
|
||||||
|
# Authors:
|
||||||
|
# Taufek Johar <taufek@gmail.com>
|
||||||
|
#
|
||||||
|
|
||||||
|
local version
|
||||||
|
|
||||||
|
# Clean up previous $php_info.
|
||||||
|
unset php_info
|
||||||
|
typeset -gA php_info
|
||||||
|
|
||||||
|
if (( $+commands[php] )); then
|
||||||
|
version="${${$(php --version)[(w)1,(w)2]}/ /-}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Format version.
|
||||||
|
if [[ -n "$version" ]]; then
|
||||||
|
php_info[version]="$version"
|
||||||
|
fi
|
Loading…
Reference in new issue