diff options
author | Brian Evans <grknight@gentoo.org> | 2015-12-17 21:27:28 -0500 |
---|---|---|
committer | Brian Evans <grknight@gentoo.org> | 2015-12-17 21:27:28 -0500 |
commit | 270d0436bdffcf82d8981b28a9833569146332d0 (patch) | |
tree | adc01b65b4716e326a3035d9199ffb940a97dad3 | |
parent | Use AC_PROG_MKDIR_P macro/variable instead of "mkdir -p". (diff) | |
download | eselect-php-270d0436bdffcf82d8981b28a9833569146332d0.tar.gz eselect-php-270d0436bdffcf82d8981b28a9833569146332d0.tar.bz2 eselect-php-270d0436bdffcf82d8981b28a9833569146332d0.zip |
Add support for the phpdbg SAPI target0.8.2
Signed-off-by: Brian Evans <grknight@gentoo.org>
-rw-r--r-- | src/php.eselect.in | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/src/php.eselect.in b/src/php.eselect.in index 7e918ab..10edcbd 100644 --- a/src/php.eselect.in +++ b/src/php.eselect.in @@ -6,11 +6,12 @@ inherit config multilib DESCRIPTION="Manage php installations" MAINTAINER="php-bugs@gentoo.org" -MODULES="cli apache2 fpm cgi" +MODULES="cli apache2 fpm cgi phpdbg" cli_link="${EROOT}"/usr/bin/php fpm_link="${EROOT}"/usr/bin/php-fpm cgi_link="${EROOT}"/usr/bin/php-cgi +dbg_link="${EROOT}"/usr/bin/phpdbg cleanup_sapis() { local m @@ -137,6 +138,15 @@ find_targets_cgi() { done | @SORT@ | @UNIQ@ } +find_targets_phpdbg() { + local target libdir + for target in $(find_targets); do + for libdir in $(get_libdirs); do + [[ -f ${EROOT}${libdir}/$target/bin/phpdbg ]] && echo $target + done + done | @SORT@ | @UNIQ@ +} + get_active_cli() { # See get_active_apache2() for an explanation of the sed call. local target=$(canonicalise "${cli_link}") @@ -158,6 +168,13 @@ get_active_fpm() { [[ -a "${target}" ]] && echo "${target}" | @SED@ -ne "${ver}" } +get_active_phpdbg() { + # See get_active_apache2() for an explanation of the sed call. + local target=$(canonicalise "${dbg_link}") + local ver="s:.*/usr/.*/\(php[0-9]\.[0-9][0-9]*\)/bin/phpdbg:\1:p" + [[ -a "${target}" ]] && echo "${target}" | @SED@ -ne "${ver}" +} + # The path to the active version of the apache2 module, which should # be a symlink. This is the path used by our apache configuration to # load the PHP module. The path is unversioned (that is, it has no "5" @@ -309,6 +326,19 @@ list_fpm() { write_numbered_list -m "(none found)" "${targets[@]}" } +list_phpdbg() { + local targets + local a + targets=( $(find_targets_phpdbg) ) + a=$(get_active_phpdbg) + for (( i = 0; i < ${#targets[@]}; i++ )) ; do + if [[ $a == ${targets[i]} ]] ; then + targets[i]=$(highlight_marker "${targets[i]}") + fi + done + write_numbered_list -m "(none found)" "${targets[@]}" +} + set_apache2() { local active_symlink libdir target=$(resolv_target apache2 $1) active_symlink="$(get_apache2_active_symlink_path)" @@ -345,6 +375,14 @@ set_cgi() { die -q "failed to create active php-cgi symlink" } +set_phpdbg() { + t=$(resolv_target phpdbg $1) + [[ -z $t ]] && die -q "invalid target" + @LN_S@ --force "../..$(get_active_libdir)/${t}/bin/phpdbg" \ + "${dbg_link}" || \ + die -q "failed to create active phpdbg symlink" +} + set_fpm() { local t=$(resolv_target fpm $1) [[ -z $t ]] && die -q "invalid target" |