1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit autotools flag-o-matic versionator systemd
8 DESCRIPTION="The PHP language runtime engine"
9 HOMEPAGE="https://secure.php.net/"
10 SRC_URI="https://php.net/distributions/${P}.tar.xz"
18 unicode? ( BSD-2 LGPL-2.1 )"
20 SLOT="$(get_version_component_range 1-2)"
21 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
23 # We can build the following SAPIs in the given order
24 SAPIS="embed cli cgi fpm apache2"
26 # SAPIs and SAPI-specific USE flags (cli SAPI is default on):
31 IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk
32 coverage crypt +ctype curl debug
33 enchant exif +fileinfo +filter firebird
34 flatfile ftp gd gdbm gmp +hash +iconv imap inifile
35 intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
36 mhash mssql mysql libmysqlclient mysqli nls
37 oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
38 readline recode selinux +session sharedmem
39 +simplexml snmp soap sockets spell sqlite ssl
40 sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
41 +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
43 # The supported (that is, autodetected) versions of BDB are listed in
44 # the ./configure script. Other versions *work*, but we need to stick to
45 # the ones that can be detected to avoid a repeat of bug #564824.
47 >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
48 >=dev-libs/libpcre-8.32[unicode]
50 apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
51 <www-servers/apache-2.4[threads=] ) )
52 berkdb? ( || ( sys-libs/db:5.3
58 bzip2? ( app-arch/bzip2:0= )
59 cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
65 coverage? ( dev-util/lcov )
66 crypt? ( >=dev-libs/libmcrypt-2.4 )
67 curl? ( >=net-misc/curl-7.10.5 )
68 enchant? ( app-text/enchant )
74 firebird? ( dev-db/firebird )
75 gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
76 gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
77 gmp? ( dev-libs/gmp:0= )
78 iconv? ( virtual/libiconv )
79 imap? ( virtual/imap-c-client[kerberos=,ssl=] )
80 intl? ( dev-libs/icu:= )
81 iodbc? ( dev-db/libiodbc )
82 kerberos? ( virtual/krb5 )
83 ldap? ( >=net-nds/openldap-1.2.11 )
84 ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
85 libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
86 mssql? ( dev-db/freetds[mssql] )
88 mysql? ( virtual/libmysqlclient:= )
89 mysqli? ( virtual/libmysqlclient:= )
91 nls? ( sys-devel/gettext )
92 oci8-instant-client? ( dev-db/oracle-instantclient-basic )
93 odbc? ( >=dev-db/unixODBC-1.8.13 )
94 postgres? ( dev-db/postgresql:* )
96 readline? ( sys-libs/readline:0= )
97 recode? ( app-text/recode )
98 sharedmem? ( dev-libs/mm )
99 simplexml? ( >=dev-libs/libxml2-2.6.8 )
100 snmp? ( >=net-analyzer/net-snmp-5.2 )
101 soap? ( >=dev-libs/libxml2-2.6.8 )
102 spell? ( >=app-text/aspell-0.50 )
103 sqlite? ( >=dev-db/sqlite-3.7.6.3 )
105 !libressl? ( dev-libs/openssl:0= )
106 libressl? ( dev-libs/libressl:0= )
108 sybase-ct? ( dev-db/freetds )
109 tidy? ( app-text/htmltidy )
111 =media-libs/freetype-2*
112 >=media-libs/t1lib-5.0.0
114 virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
116 unicode? ( dev-libs/oniguruma:= )
117 vpx? ( media-libs/libvpx:0= )
118 wddx? ( >=dev-libs/libxml2-2.6.8 )
119 xml? ( >=dev-libs/libxml2-2.6.8 )
120 xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
121 xmlreader? ( >=dev-libs/libxml2-2.6.8 )
122 xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
126 media-libs/libpng:0= sys-libs/zlib:0=
128 xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
129 zip? ( sys-libs/zlib:0= )
130 zlib? ( sys-libs/zlib:0= )
133 RDEPEND="${COMMON_DEPEND}
136 selinux? ( sec-policy/selinux-phpfpm )
137 systemd? ( sys-apps/systemd ) )"
139 DEPEND="${COMMON_DEPEND}
141 >=sys-devel/bison-3.0.1
144 >=sys-devel/libtool-1.5.18"
146 # Without USE=readline or libedit, the interactive "php -a" CLI will hang.
148 || ( cli cgi fpm apache2 embed )
149 cli? ( ^^ ( readline libedit ) )
159 xmlrpc? ( || ( xml iconv ) )
165 recode? ( !imap !mysql !mysqli !libmysqlclient )
166 libmysqlclient? ( || (
173 readline? ( !libedit )
174 sharedmem? ( !threads )
177 PHP_MV="$(get_major_version)"
182 # work out where we are installing the ini file
183 php_set_ini_dir "${phpsapi}"
185 # Always install the production INI file, bug 611214.
186 local phpinisrc="php.ini-production-${phpsapi}"
187 cp php.ini-production "${phpinisrc}" || die
189 # default to /tmp for save_path, bug #282768
190 sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
192 # Set the extension dir
193 sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
194 -i "${phpinisrc}" || die
196 # Set the include path to point to where we want to find PEAR packages
197 sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
199 dodir "${PHP_INI_DIR#${EPREFIX}}"
200 insinto "${PHP_INI_DIR#${EPREFIX}}"
201 newins "${phpinisrc}" php.ini
203 elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
206 dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
207 dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
210 elog "Adding opcache to $PHP_EXT_INI_DIR"
211 echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
212 "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
213 dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
214 "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
217 # SAPI-specific handling
218 if [[ "${sapi}" == "fpm" ]] ; then
219 einfo "Installing FPM config file php-fpm.conf"
220 insinto "${PHP_INI_DIR#${EPREFIX}}"
221 doins sapi/fpm/php-fpm.conf
224 dodoc php.ini-{development,production}
228 PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
229 PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
230 PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
234 eapply "${FILESDIR}/php-${SLOT}-no-bison-warnings.patch"
236 # Change PHP branding
237 # Get the alpha/beta/rc version
238 sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \
239 -i configure.in || die "Unable to change PHP branding"
241 # Patch PHP to show Gentoo as the server platform
242 sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
243 -i configure.in || die "Failed to fix server platform name"
245 # Prevent PHP from activating the Apache config,
246 # as we will do that ourselves
248 -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
249 -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
250 configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \
253 # Patch PHP to support heimdal instead of mit-krb5
254 if has_version "app-crypt/heimdal" ; then
255 sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
256 || die "Failed to fix heimdal libname"
257 sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
258 || die "Failed to fix heimdal crypt library reference"
263 # Force rebuilding aclocal.m4
264 rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
267 if [[ ${CHOST} == *-darwin* ]] ; then
268 # http://bugs.php.net/bug.php?id=48795, bug #343481
269 sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
274 addpredict /usr/share/snmp/mibs/.index
275 addpredict /var/lib/net-snmp/mib_indexes
277 PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
279 # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
280 # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
282 --prefix="${PHP_DESTDIR}"
283 --mandir="${PHP_DESTDIR}/man"
284 --infodir="${PHP_DESTDIR}/info"
285 --libdir="${PHP_DESTDIR}/lib"
286 --with-libdir="$(get_libdir)"
287 --localstatedir="${EPREFIX}/var"
289 $(use_enable threads maintainer-zts)
293 $(use_with acl fpm-acl)
294 $(use_enable bcmath bcmath)
295 $(use_with bzip2 bz2 "${EPREFIX}/usr")
296 $(use_enable calendar calendar)
297 $(use_enable coverage gcov)
298 $(use_enable ctype ctype)
299 $(use_with curl curl "${EPREFIX}/usr")
300 $(use_enable xml dom)
301 $(use_with enchant enchant "${EPREFIX}/usr")
302 $(use_enable exif exif)
303 $(use_enable fileinfo fileinfo)
304 $(use_enable filter filter)
305 $(use_enable ftp ftp)
306 $(use_with nls gettext "${EPREFIX}/usr")
307 $(use_with gmp gmp "${EPREFIX}/usr")
308 $(use_enable hash hash)
309 $(use_with mhash mhash "${EPREFIX}/usr")
310 $(use_with iconv iconv \
311 $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr"))
312 $(use_enable intl intl)
313 $(use_enable ipv6 ipv6)
314 $(use_enable json json)
315 $(use_with kerberos kerberos "${EPREFIX}/usr")
316 $(use_enable xml libxml)
317 $(use_with xml libxml-dir "${EPREFIX}/usr")
318 $(use_enable unicode mbstring)
319 $(use_with crypt mcrypt "${EPREFIX}/usr")
320 $(use_with mssql mssql "${EPREFIX}/usr")
321 $(use_with unicode onig "${EPREFIX}/usr")
322 $(use_with ssl openssl "${EPREFIX}/usr")
323 $(use_with ssl openssl-dir "${EPREFIX}/usr")
324 $(use_enable pcntl pcntl)
325 $(use_enable phar phar)
326 $(use_enable pdo pdo)
327 $(use_enable opcache opcache)
328 $(use_with postgres pgsql "${EPREFIX}/usr")
329 $(use_enable posix posix)
330 $(use_with spell pspell "${EPREFIX}/usr")
331 $(use_with recode recode "${EPREFIX}/usr")
332 $(use_enable simplexml simplexml)
333 $(use_enable sharedmem shmop)
334 $(use_with snmp snmp "${EPREFIX}/usr")
335 $(use_enable soap soap)
336 $(use_enable sockets sockets)
337 $(use_with sqlite sqlite3 "${EPREFIX}/usr")
338 $(use_with sybase-ct sybase-ct "${EPREFIX}/usr")
339 $(use_enable sysvipc sysvmsg)
340 $(use_enable sysvipc sysvsem)
341 $(use_enable sysvipc sysvshm)
342 $(use_with systemd fpm-systemd)
343 $(use_with tidy tidy "${EPREFIX}/usr")
344 $(use_enable tokenizer tokenizer)
345 $(use_enable wddx wddx)
346 $(use_enable xml xml)
347 $(use_enable xmlreader xmlreader)
348 $(use_enable xmlwriter xmlwriter)
349 $(use_with xmlrpc xmlrpc)
350 $(use_with xslt xsl "${EPREFIX}/usr")
351 $(use_enable zip zip)
352 $(use_with zlib zlib "${EPREFIX}/usr")
353 $(use_enable debug debug)
357 if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
359 our_conf+=( "--enable-dba${shared}" )
362 # DBA drivers support
365 $(use_with berkdb db4 "${EPREFIX}/usr")
366 $(use_enable flatfile flatfile)
367 $(use_with gdbm gdbm "${EPREFIX}/usr")
368 $(use_enable inifile inifile)
369 $(use_with qdbm qdbm "${EPREFIX}/usr")
372 # Support for the GD graphics library
374 $(use_with truetype freetype-dir "${EPREFIX}/usr")
375 $(use_with truetype t1lib "${EPREFIX}/usr")
376 $(use_enable cjk gd-jis-conv)
377 $(use_with gd jpeg-dir "${EPREFIX}/usr")
378 $(use_with gd png-dir "${EPREFIX}/usr")
379 $(use_with xpm xpm-dir "${EPREFIX}/usr")
380 $(use_with vpx vpx-dir "${EPREFIX}/usr")
382 # enable gd last, so configure can pick up the previous settings
383 our_conf+=( $(use_with gd gd) )
388 $(use_with imap imap "${EPREFIX}/usr")
389 $(use_with ssl imap-ssl "${EPREFIX}/usr")
393 # Interbase/firebird support
394 our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
399 $(use_with ldap ldap "${EPREFIX}/usr")
400 $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
405 local mysqllib="mysqlnd"
406 local mysqlilib="mysqlnd"
407 use libmysqlclient && mysqllib="${EPREFIX}/usr"
408 use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
410 our_conf+=( $(use_with mysql mysql "${mysqllib}") )
411 our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
413 local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
414 if use mysql || use mysqli ; then
415 our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
420 $(use_with odbc unixODBC "${EPREFIX}/usr")
421 $(use_with iodbc iodbc "${EPREFIX}/usr")
425 our_conf+=( $(use_with oci8-instant-client oci8) )
430 $(use_with mssql pdo-dblib)
431 $(use_with mysql pdo-mysql "${mysqllib}")
432 $(use_with postgres pdo-pgsql)
433 $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
434 $(use_with firebird pdo-firebird "${EPREFIX}/usr")
435 $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
436 $(use_with oci8-instant-client pdo-oci)
440 # readline/libedit support
442 $(use_with readline readline "${EPREFIX}/usr")
443 $(use_with libedit libedit "${EPREFIX}/usr")
447 if use session ; then
448 our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") )
450 our_conf+=( $(use_enable session session) )
453 # Use pic for shared modules such as apache2's mod_php
454 our_conf+=( --with-pic )
456 # we use the system copy of pcre
457 # --with-pcre-regex affects ext/pcre
458 # --with-pcre-dir affects ext/filter and ext/zip
460 --with-pcre-regex="${EPREFIX}/usr"
461 --with-pcre-dir="${EPREFIX}/usr"
464 # Catch CFLAGS problems
466 # Changed order to run it in reverse for bug #32022 and #12021.
467 replace-cpu-flags "k6*" "i586"
469 # Cache the ./configure test results between SAPIs.
470 our_conf+=( --cache-file="${T}/config.cache" )
472 # Support user-passed configuration parameters
473 our_conf+=( ${EXTRA_ECONF:-} )
475 # Support the Apache2 extras, they must be set globally for all
476 # SAPIs to work correctly, especially for external PHP extensions
478 mkdir -p "${WORKDIR}/sapis-build" || die
479 for one_sapi in $SAPIS ; do
480 use "${one_sapi}" || continue
481 php_set_ini_dir "${one_sapi}"
483 # The BUILD_DIR variable is used to determine where to output
484 # the files that autotools creates. This was all originally
485 # based on the autotools-utils eclass.
486 BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
487 cp -a "${S}" "${BUILD_DIR}" || die
488 cd "${BUILD_DIR}" || die
491 --with-config-file-path="${PHP_INI_DIR}"
492 --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
495 for sapi in $SAPIS ; do
498 if [[ "${one_sapi}" == "${sapi}" ]] ; then
499 sapi_conf+=( "--enable-${sapi}" )
501 sapi_conf+=( "--disable-${sapi}" )
506 if [[ "${one_sapi}" == "${sapi}" ]] ; then
507 sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
509 sapi_conf+=( --without-apxs2 )
515 # Construct the $myeconfargs array by concatenating $our_conf
516 # (the common args) and $sapi_conf (the SAPI-specific args).
517 local myeconfargs=( "${our_conf[@]}" )
518 myeconfargs+=( "${sapi_conf[@]}" )
520 pushd "${BUILD_DIR}" > /dev/null || die
521 econf "${myeconfargs[@]}"
522 popd > /dev/null || die
527 # snmp seems to run during src_compile, too (bug #324739)
528 addpredict /usr/share/snmp/mibs/.index
529 addpredict /var/lib/net-snmp/mib_indexes
531 for sapi in ${SAPIS} ; do
532 if use "${sapi}"; then
533 cd "${WORKDIR}/sapis-build/$sapi" || \
534 die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
541 # see bug #324739 for what happens when we don't have that
542 addpredict /usr/share/snmp/mibs/.index
544 # grab the first SAPI that got built and install common files from there
546 for sapi in $SAPIS ; do
553 # Makefile forgets to create this before trying to write to it...
554 dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
556 # Install php environment (without any sapis)
557 cd "${WORKDIR}/sapis-build/$first_sapi" || die
558 emake INSTALL_ROOT="${D}" \
559 install-build install-headers install-programs
561 local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
563 # Create the directory where we'll put version-specific php scripts
564 keepdir "/usr/share/php${PHP_MV}"
566 local sapi="", file=""
569 for sapi in ${SAPIS}; do
570 if use "${sapi}" ; then
571 einfo "Installing SAPI: ${sapi}"
572 cd "${WORKDIR}/sapis-build/${sapi}" || die
574 if [[ "${sapi}" == "apache2" ]] ; then
575 # We're specifically not using emake install-sapi as libtool
576 # may cause unnecessary relink failures (see bug #351266)
577 insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
578 newins ".libs/libphp5$(get_libname)" \
579 "libphp${PHP_MV}$(get_libname)"
580 keepdir "/usr/$(get_libdir)/apache2/modules"
582 # needed each time, php_install_ini would reset it
583 local dest="${PHP_DESTDIR#${EPREFIX}}"
587 source="sapi/cli/php"
590 source="sapi/cgi/php-cgi"
593 source="sapi/fpm/php-fpm"
596 source="libs/libphp${PHP_MV}$(get_libname)"
599 die "unhandled sapi in src_install"
603 if [[ "${source}" == *"$(get_libname)" ]]; then
607 local name="$(basename ${source})"
608 dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
612 php_install_ini "${sapi}"
614 # construct correct SAPI string for php-config
615 # thanks to ferringb for the bash voodoo
616 if [[ "${sapi}" == "apache2" ]]; then
617 sapi_list="${sapi_list:+${sapi_list} }apache2handler"
619 sapi_list="${sapi_list:+${sapi_list} }${sapi}"
624 # Installing opcache module
625 if use opcache ; then
626 into "${PHP_DESTDIR#${EPREFIX}}"
627 dolib.so "modules/opcache$(get_libname)"
630 # Install env.d files
631 newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
632 sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
633 sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
635 # set php-config variable correctly (bug #278439)
636 sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
637 "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
641 systemd_newunit "${FILESDIR}/php-fpm_at.service" \
642 "php-fpm@${SLOT}.service"
644 systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
645 "php-fpm@${SLOT}.service"
651 echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
652 PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
653 if [[ ! -x "${PHP_BIN}" ]] ; then
654 ewarn "Test phase requires USE=cli, skipping"
657 export TEST_PHP_EXECUTABLE="${PHP_BIN}"
660 if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then
661 export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi"
664 REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
665 "session.save_path=${T}" \
666 "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
667 "session.save_path=${T}"
669 for name in ${EXPECTED_TEST_FAILURES}; do
670 mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
673 local failed="$(find -name '*.out')"
674 if [[ ${failed} != "" ]] ; then
675 ewarn "The following test cases failed unexpectedly:"
676 for name in ${failed}; do
677 ewarn " ${name/.out/}"
680 einfo "No unexpected test failures, all fine"
683 if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
685 for name in ${EXPECTED_TEST_FAILURES}; do
686 [[ -f "${name}.diff" ]] && continue
687 passed="${passed} ${name}"
689 if [[ ${passed} != "" ]] ; then
690 einfo "The following test cases passed unexpectedly:"
691 for name in ${passed}; do
695 einfo "None of the known-to-fail tests passed, all fine"
701 # Output some general info to the user
702 if use apache2 ; then
704 elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
705 elog "your apache2 command. OpenRC users can append that string to"
706 elog "APACHE2_OPTS in /etc/conf.d/apache2."
708 elog "The apache module configuration file 70_mod_php.conf is"
709 elog "provided (and maintained) by eselect-php."
713 # Create the symlinks for php
714 for m in ${SAPIS}; do
715 [[ ${m} == 'embed' ]] && continue;
717 local ci=$(eselect php show $m)
718 if [[ -z $ci ]]; then
719 eselect php set $m php${SLOT} || die
720 einfo "Switched ${m} to use php:${SLOT}"
722 elif [[ $ci != "php${SLOT}" ]] ; then
723 elog "To switch $m to use php:${SLOT}, run"
724 elog " eselect php set $m php${SLOT}"
730 # Remove dead symlinks for SAPIs that were just disabled. For
731 # example, if the user has the cgi SAPI enabled, then he has an
732 # eselect-php symlink for it. If he later reinstalls PHP with
733 # USE="-cgi", that symlink will break. This call to eselect is
734 # supposed to remove that dead link per bug 572436.
735 eselect php cleanup || die
737 if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
738 elog "To build extensions for this version of PHP, you will need to"
739 elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
743 # Warn about the removal of PHP_INI_VERSION if the user has it set.
744 if [[ -n "${PHP_INI_VERSION}" ]]; then
745 ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
746 ewarn 'remove it from your configuration at your convenience. See'
748 ewarn ' https://bugs.gentoo.org/611214'
750 ewarn 'for more information.'
753 elog "For details on how version slotting works, please see"
756 elog " https://wiki.gentoo.org/wiki/PHP"
761 # This serves two purposes. First, if we have just removed the last
762 # installed version of PHP, then this will remove any dead symlinks
763 # belonging to eselect-php. Second, if a user upgrades slots from
764 # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
765 # his existing symlinks to point to the new 7.0 installation. The
766 # latter is bug 432962.
768 # Note: the eselect-php package may not be installed at this point,
769 # so we can't die() if this command fails.