prezto/modules/php/functions/php-info
Taufek Johar faac430f5b Add PHP Module
Added PHP function to produce PHP related information.
2017-05-13 13:54:13 +00:00

22 lines
390 B
Text

#
# 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