wok-next view php/receipt @ rev 21402

updated php (7.4.4 -> 7.4.5)
author Hans-G?nter Theisgen
date Tue Apr 21 07:47:41 2020 +0100 (2020-04-21)
parents d0d2f8454109
children dea882b942f2
line source
1 # SliTaz package receipt v2.
3 PACKAGE="php"
4 VERSION="7.4.5"
5 CATEGORY="development"
6 SHORT_DESC="PHP web programming language"
7 MAINTAINER="maintainer@slitaz.org"
8 LICENSE="BSD"
9 WEB_SITE="https://www.php.net/"
11 TARBALL="$PACKAGE-$VERSION.tar.xz"
12 WGET_URL="https://www.php.net/distributions/$TARBALL"
14 BUILD_DEPENDS="apache apache-dev apr-dev apr-util-dev c-client
15 coreutils-conditions curl-dev cyrus-sasl-dev gettext-dev
16 jpeg-dev libldap libmcrypt-dev libmysqlclient libpng-dev
17 libunixODBC libvpx-dev libxml2-dev mhash-dev mysql-dev
18 net-snmp-dev openldap-dev openssl-dev perl postgresql-dev
19 re2c sed sqlite3-dev unixODBC-dev zlib-dev"
20 SPLIT="\
21 $PACKAGE-apache $PACKAGE-cherokee $PACKAGE-cli $PACKAGE-common \
22 $PACKAGE-curl $PACKAGE-dba $PACKAGE-dev $PACKAGE-gd \
23 $PACKAGE-imap $PACKAGE-ldap $PACKAGE-mcrypt $PACKAGE-mysql \
24 $PACKAGE-mysqli $PACKAGE-odbc $PACKAGE-openssl $PACKAGE-pdo-mysql \
25 $PACKAGE-pdo-pgsql $PACKAGE-pear $PACKAGE-pgsql $PACKAGE-snmp \
26 $PACKAGE-soap $PACKAGE-sqlite"
28 compile_rules()
29 {
30 ARCH_ARGS="\
31 --enable-mbstring \
32 --enable-sockets \
33 --enable-ftp \
34 --enable-zip \
35 --enable-calendar \
36 --enable-exif \
37 --config-cache \
38 --enable-dba=shared \
39 --with-config-file-path=/etc \
40 --with-zlib \
41 --with-gettext \
42 --with-mcrypt=shared,/usr \
43 --with-mysql=shared,/usr \
44 --with-mysqli=shared \
45 --with-mysql-sock=/var/run/mysqld/mysql.sock \
46 --with-pdo-sqlite=shared,/usr \
47 --with-pgsql=shared,/usr \
48 --with-snmp=shared,/usr \
49 --enable-soap=shared,/usr \
50 --with-ldap=shared \
51 --with-imap=shared \
52 --with-imap-ssl \
53 --with-mhash \
54 --with-gd=shared \
55 --with-jpeg-dir=/usr \
56 --with-png-dir=/usr \
57 --with-vpx-dir=/usr \
58 --with-openssl=shared \
59 --with-unixODBC=shared,/usr \
60 --with-pear=/usr/share/php \
61 --with-pdo-mysql=shared \
62 --with-pdo-pgsql=shared \
63 --with-curl=shared \
64 --with-sqlite3=shared,/usr \
65 --enable-maintainer-zts"
67 sed -i 's|PLANE_[UVY]\]|VPX_&|;s|IMG_FMT_I420|VPX_&|' \
68 ext/gd/libgd/webpimg.c
69 sed -i 's/pam_start/pam_nostart/' \
70 configure
72 ./configure \
73 $ARCH_ARGS \
74 $CONFIGURE_ARGS &&
75 make $MAKEFLAGS &&
76 make -j1 INSTALL_ROOT=$install install
78 ./configure \
79 $ARCH_ARGS \
80 $CONFIGURE_ARGS \
81 --with-apxs2=/usr/bin/apxs &&
82 make $MAKEFLAGS &&
83 mkdir -p $install/etc/apache &&
84 cp /etc/apache/httpd.conf $install/etc/apache/httpd.conf &&
85 make -j1 INSTALL_ROOT=$install install || return 1
87 # Production configuration file.
88 mkdir -p $install/etc
90 cp $src/php.ini-production $install/etc/php.ini || return 1
91 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
92 -i $install/etc/php.ini
94 install -Dm755 $src/sapi/cgi/php-cgi $install/usr/bin/php-cgi
96 install -Dm644 $stuff/phpinfo/index.php $install/usr/share/phpinfo/index.php
97 install -Dm644 $stuff/php.desktop $install/usr/share/applications/php.desktop
98 install -Dm644 $stuff/php.png $install/usr/share/pixmaps/php.png
99 }
101 genpkg_rules()
102 {
103 case $PACKAGE in
104 php)
105 copy usr/bin/php-cgi
106 DEPENDS="libxml2 lighttpd openssl php-common sqlite3 zlib"
107 PROVIDE="php:lighttpd"
108 ;;
109 php-apache)
110 copy usr/share/apache/
111 CAT="development|module for apache"
112 DEPENDS="apache libxml2 php-common zlib"
113 PROVIDE="php:apache"
114 ;;
115 php-cherokee)
116 copy usr/bin/php-cgi # FIXME! the same file in "php" package
117 CAT="development|module for cherokee"
118 DEPENDS="cherokee libxml2 php-common zlib"
119 PROVIDE="php:cherokee"
120 ;;
121 php-cli)
122 copy usr/bin/php
123 CAT="development|command line interpreter"
124 DEPENDS="php-common"
125 ;;
126 php-common)
127 copy phpinfo/ php.desktop php.png php.ini
128 CAT="development|common files for PHP modules"
129 DEPENDS=" "
130 CONFIG_FILES="/etc/php.ini"
131 ;;
132 php-curl)
133 copy curl.so
134 CAT="development|curl module"
135 DEPENDS="curl php"
136 ;;
137 php-dba)
138 copy dba.so
139 CAT="development|dba module"
140 DEPENDS=" "
141 ;;
142 php-dev)
143 copy @dev
144 DEPENDS="cyrus-sasl jpeg libcomerr3 libkrb5 libldap
145 libmcrypt libmysqlclient libpng libpostgresqlclient
146 libtool libunixODBC mhash net-snmp openssl php"
147 ;;
148 php-gd)
149 copy gd.so
150 CAT="development|gd module"
151 DEPENDS="jpeg libpng libvpx php"
152 ;;
153 php-imap)
154 copy imap.so
155 CAT="development|imap module"
156 DEPENDS="openssl php"
157 ;;
158 php-ldap)
159 copy ldap.so
160 CAT="development|ldap module"
161 DEPENDS="cyrus-sasl libcomerr3 libkrb5 libldap openssl php"
162 ;;
163 php-mcrypt)
164 copy mcrypt.so
165 CAT="development|mcrypt module"
166 DEPENDS="libmcrypt libtool php"
167 ;;
168 php-mysqli)
169 copy mysqli.so
170 CAT="development|mysqli module"
171 DEPENDS="libmysqlclient php"
172 ;;
173 php-mysql)
174 copy mysql.so
175 CAT="development|mysql module"
176 DEPENDS="libmysqlclient php"
177 ;;
178 php-odbc)
179 copy odbc.so
180 CAT="development|ODBC module"
181 DEPENDS="php unixODBC"
182 ;;
183 php-openssl)
184 copy openssl.so
185 CAT="development|OpenSSL module"
186 DEPENDS="openssl php"
187 ;;
188 php-pdo-mysql)
189 copy pdo_mysql.so
190 CAT="development|PDO MySQL module"
191 DEPENDS="php php-mysql"
192 ;;
193 php-pdo-pgsql)
194 copy pdo_pgsql.so
195 CAT="development|PDO PgSQL module"
196 DEPENDS="libpostgresqlclient php php-mysql"
197 ;;
198 php-pear)
199 copy etc/pear.conf usr/bin/pe* usr/share/php/
200 CAT="development|PEAR libs"
201 DEPENDS="php-cli"
202 ;;
203 php-pgsql)
204 copy pgsql.so
205 CAT="development|postgresql module"
206 DEPENDS="php postgresql"
207 ;;
208 php-snmp)
209 copy snmp.so
210 CAT="development|snmp module"
211 DEPENDS="net-snmp openssl php"
212 ;;
213 php-soap)
214 copy soap.so
215 CAT="development|soap module"
216 DEPENDS="libxml2 php"
217 ;;
218 php-sqlite)
219 copy sqlite.so sqlite3.so pdo_sqlite.so
220 CAT="development|sqlite module"
221 DEPENDS="php sqlite3"
222 ;;
223 esac
224 }
226 # -----------------------------------------------------------------------------
227 pre_install_php()
228 {
229 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]
230 then
231 /etc/init.d/lighttpd stop
232 fi
233 }
235 post_install_php()
236 {
237 # Enable php
238 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]
239 then
240 [ -f "$1/usr/lib/lighttpd/mod_fastcgi.so" ] ||
241 tazpkg get-install lighttpd-modules --root="$1/"
243 sed \
244 -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
245 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
246 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
247 -i "$1/etc/lighttpd/lighttpd.conf"
249 grep -q mod_fastcgi "$1/etc/lighttpd/lighttpd.conf" ||
250 sed \
251 -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
252 -i "$1/etc/lighttpd/lighttpd.conf"
254 grep -q php3 "$1/etc/lighttpd/lighttpd.conf" ||
255 sed \
256 -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
257 -i "$1/etc/lighttpd/lighttpd.conf"
259 fi
261 # Start Web server.
262 if [ -z "$1" -a ! -f /var/run/lighttpd.pid -a -f /etc/init.d/lighttpd ]
263 then
264 /etc/init.d/lighttpd start
265 fi
266 }
268 # -----------------------------------------------------------------------------
269 pre_installi_php_apache()
270 {
271 if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]
272 then
273 /etc/init.d/apache stop
274 fi
275 }
277 post_install_php_apache()
278 {
279 grep -q php5_module "$1/etc/apache/httpd.conf" ||
280 {
281 sed \
282 -e 's|mod_rewrite.so|mod_rewrite.so\nLoadModule php5_module share/apache/modules/libphp5.so|' \
283 -e 's|DirectoryIndex index.html|DirectoryIndex index.html index.php|' \
284 -e 's|mime.types|mime.types\n AddType application/x-httpd-php .php .php3 .php4 .php5\n AddType application/x-httpd-php-source .phps|' \
285 -i "$1/etc/apache/httpd.conf"
286 }
288 [ -f "$1/etc/apache/conf.d/phpinfo" ] ||
289 cat > "$1/etc/apache/conf.d/phpinfo" <<EOT
290 <IfModule mod_alias.c>
291 Alias /phpinfo /usr/share/phpinfo
292 </IfModule>
293 <DirectoryMatch /usr/share/phpinfo/>
294 DirectoryIndex index.php
295 Options +FollowSymLinks
296 AllowOverride None
297 Order allow,deny
298 Allow from all
299 </DirectoryMatch>
300 EOT
302 # Restart Web server.
303 if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]
304 then
305 /etc/init.d/apache stop
306 sleep 2
307 fi
308 if [ -z "$1" ]; then
309 /etc/init.d/apache start
310 fi
311 }
313 # -----------------------------------------------------------------------------
314 pre_install_php_cherokee()
315 {
316 if [ -z "$1" -a ! -f "/var/run/cherokee.pid" ]
317 then
318 /etc/init.d/cherokee stop
319 fi
320 }
322 post_install_php_cherokee()
323 {
324 # Enable php
325 # if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
326 # [ -f "$1/usr/lib/lighttpd/mod_fastcgi.so" ] || \
327 # tazpkg get-install lighttpd-modules --root="$1/"
328 # sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
329 # -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
330 # -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
331 # -i "$1/etc/lighttpd/lighttpd.conf"
332 # grep -q mod_fastcgi "$1/etc/lighttpd/lighttpd.conf" || \
333 # sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
334 # -i "$1/etc/lighttpd/lighttpd.conf"
335 # grep -q php3 "$1/etc/lighttpd/lighttpd.conf" || \
336 # sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
337 # -i "$1/etc/lighttpd/lighttpd.conf"
338 # fi
340 # Start Web server.
341 if [ -z "$1" -a ! -f /var/run/cherokee.pid -a -f /etc/init.d/cherokee ]
342 then
343 /etc/init.d/cherokee start
344 fi
345 }
347 # -----------------------------------------------------------------------------
348 pre_install_php_common()
349 {
350 # Backup existing php.ini
351 if [ -f "$1/etc/php.ini" ]
352 then
353 cp "$1/etc/php.ini" "$1/etc/php.ini.bak"
354 fi
355 }
357 post_install_php_common()
358 {
359 # Restore original php.ini
360 if [ -f "$1/etc/php.ini.bak" ]
361 then
362 mv -f "$1/etc/php.ini.bak" "$1/etc/php.ini"
363 fi
364 }
366 # -----------------------------------------------------------------------------
367 pre_install_php_curl()
368 {
369 while read daemon file
370 do
371 if [ -z "$1" -a -f "/var/run/$file" ]
372 then
373 /etc/init.d/$daemon stop
374 fi
375 done <<EOT
376 apache apache/httpd.pid
377 lighttpd lighttpd.pid
378 EOT
379 }
381 post_install_php_curl()
382 {
383 grep -q ^extension=curl.so "$1/etc/php.ini" ||
384 sed -e 's|extension=msql.so|extension=msql.so\nextension=curl.so|' \
385 -i "$1/etc/php.ini"
387 # Start Web server.
388 while read daemon file
389 do
390 [ -z "$1" ] || continue
391 if [ -f "/var/run/$file" ]
392 then
393 /etc/init.d/$daemon stop
394 sleep 2
395 fi
396 if [ -f /etc/init.d/$daemon ]
397 then
398 /etc/init.d/$daemon start
399 fi
400 done <<EOT
401 apache apache/httpd.pid
402 lighttpd lighttpd.pid
403 EOT
404 }
406 pre_remove_php_curl()
407 {
408 sed -i '/.*=curl.so.*/d' /etc/php.ini
410 # Start Web server.
411 while read daemon file
412 do
413 [ -z "$1" ] || continue
414 if [ -f "/var/run/$file" ]
415 then
416 /etc/init.d/$daemon stop
417 sleep 2
418 fi
419 if [ -f /etc/init.d/$daemon ]
420 then
421 /etc/init.d/$daemon start
422 fi
423 done <<EOT
424 apache apache/httpd.pid
425 lighttpd lighttpd.pid
426 EOT
427 }
429 # -----------------------------------------------------------------------------
430 pre_install_php_dba()
431 {
432 while read daemon file
433 do
434 if [ -z "$1" -a -f "/var/run/$file" ]
435 then
436 /etc/init.d/$daemon stop
437 fi
438 done <<EOT
439 apache apache/httpd.pid
440 lighttpd lighttpd.pid
441 EOT
442 }
444 post_install_php_dba()
445 {
446 grep -q ^extension=dba.so "$1/etc/php.ini" ||
447 sed -e 's|extension=msql.so|extension=msql.so\nextension=dba.so|' \
448 -i "$1/etc/php.ini"
450 # Start Web server.
451 while read daemon file
452 do
453 [ -z "$1" ] || continue
454 if [ -f "/var/run/$file" ]
455 then
456 /etc/init.d/$daemon stop
457 sleep 2
458 fi
459 if [ -f /etc/init.d/$daemon ]
460 then
461 /etc/init.d/$daemon start
462 fi
463 done <<EOT
464 apache apache/httpd.pid
465 lighttpd lighttpd.pid
466 EOT
467 }
469 pre_remove_php_dba()
470 {
471 sed -i '/.*=dba.so.*/d' /etc/php.ini
473 # Start Web server.
474 while read daemon file
475 do
476 [ -z "$1" ] || continue
477 if [ -f "/var/run/$file" ]
478 then
479 /etc/init.d/$daemon stop
480 sleep 2
481 fi
482 if [ -f /etc/init.d/$daemon ]
483 then
484 /etc/init.d/$daemon start
485 fi
486 done <<EOT
487 apache apache/httpd.pid
488 lighttpd lighttpd.pid
489 EOT
490 }
492 # -----------------------------------------------------------------------------
493 pre_install_php_gd()
494 {
495 while read daemon file
496 do
497 if [ -z "$1" -a -f "/var/run/$file" ]
498 then
499 /etc/init.d/$daemon stop
500 fi
501 done <<EOT
502 apache apache/httpd.pid
503 lighttpd lighttpd.pid
504 EOT
505 }
507 post_install_php_gd()
508 {
509 grep -q ^extension=gd.so "$1/etc/php.ini" ||
510 sed -e 's|extension=msql.so|extension=msql.so\nextension=gd.so|' \
511 -i "$1/etc/php.ini"
513 # Start Web server.
514 while read daemon file
515 do
516 [ -z "$1" ] || continue
517 if [ -z "$1" -a -f "/var/run/$file" ]
518 then
519 /etc/init.d/$daemon stop
520 sleep 2
521 fi
522 if [ -z "$1" -a -f /etc/init.d/$daemon ]
523 then
524 /etc/init.d/$daemon start
525 fi
526 done <<EOT
527 apache apache/httpd.pid
528 lighttpd lighttpd.pid
529 EOT
530 }
532 pre_remove_php_gd()
533 {
534 sed -i '/.*=gd.so.*/d' "$1/etc/php.ini"
536 # Start Web server.
537 while read daemon file
538 do
539 if [ -f /etc/init.d/$daemon -a -f "/var/run/$file" ]
540 then
541 [ -z "$1" ] || continue
542 if [ -z "$1" -a -f "/var/run/$file" ]
543 then
544 /etc/init.d/$daemon stop
545 sleep 2
546 fi
547 if [ -z "$1" -a -f /etc/init.d/$daemon ]
548 then
549 /etc/init.d/$daemon start
550 fi
551 fi
552 done <<EOT
553 apache apache/httpd.pid
554 lighttpd lighttpd.pid
555 EOT
556 }
558 # -----------------------------------------------------------------------------
559 pre_install_php_imap()
560 {
561 while read daemon file; do
562 if [ -z "$1" -a -f "/var/run/$file" ]
563 then
564 /etc/init.d/$daemon stop
565 fi
566 done <<EOT
567 apache apache/httpd.pid
568 lighttpd lighttpd.pid
569 EOT
570 }
572 post_install_php_imap()
573 {
574 grep -q ^extension=imap.so "$1/etc/php.ini" ||
575 sed -e 's|extension=msql.so|extension=msql.so\nextension=imap.so|' -i "$1/etc/php.ini"
577 # Start Web server.
578 while read daemon file
579 do
580 [ -z "$1" ] || continue
581 if [ -f "/var/run/$file" ]
582 then
583 /etc/init.d/$daemon stop
584 sleep 2
585 fi
586 if [ -f /etc/init.d/$daemon ]
587 then
588 /etc/init.d/$daemon start
589 fi
590 done <<EOT
591 apache apache/httpd.pid
592 lighttpd lighttpd.pid
593 EOT
594 }
596 pre_remove_php_imap()
597 {
598 sed -i '/.*=imap.so.*/d' /etc/php.ini
600 # Start Web server.
601 while read daemon file
602 do
603 [ -z "$1" ] || continue
604 if [ -f "/var/run/$file" ]
605 then
606 /etc/init.d/$daemon stop
607 sleep 2
608 fi
609 if [ -f /etc/init.d/$daemon ]
610 then
611 /etc/init.d/$daemon start
612 fi
613 done <<EOT
614 apache apache/httpd.pid
615 lighttpd lighttpd.pid
616 EOT
617 }
619 # -----------------------------------------------------------------------------
620 pre_install_php_ldap()
621 {
622 while read daemon file
623 do
624 if [ -z "$1" -a -f "/var/run/$file" ]
625 then
626 /etc/init.d/$daemon stop
627 fi
628 done <<EOT
629 apache apache/httpd.pid
630 lighttpd lighttpd.pid
631 EOT
632 }
634 post_install_php_ldap()
635 {
636 grep -q ^extension=ldap.so "$1/etc/php.ini" ||
637 sed -e 's|extension=msql.so|extension=msql.so\nextension=ldap.so|' -i "$1/etc/php.ini"
639 # Start Web server.
640 while read daemon file
641 do
642 [ -z "$1" ] || continue
643 if [ -f "/var/run/$file" ]
644 then
645 /etc/init.d/$daemon stop
646 sleep 2
647 fi
648 if [ -f /etc/init.d/$daemon ]
649 then
650 /etc/init.d/$daemon start
651 fi
652 done <<EOT
653 apache apache/httpd.pid
654 lighttpd lighttpd.pid
655 EOT
656 }
658 pre_remove_php_ldap()
659 {
660 sed -i '/.*=ldap.so.*/d' /etc/php.ini
662 # Start Web server.
663 while read daemon file
664 do
665 [ -z "$1" ] || continue
666 if [ -f "/var/run/$file" ]
667 then
668 /etc/init.d/$daemon stop
669 sleep 2
670 fi
671 if [ -f /etc/init.d/$daemon ]
672 then
673 /etc/init.d/$daemon start
674 fi
675 done <<EOT
676 apache apache/httpd.pid
677 lighttpd lighttpd.pid
678 EOT
679 }
681 # -----------------------------------------------------------------------------
682 pre_install_php_mcrypt()
683 {
684 while read daemon file
685 do
686 if [ -z "$1" -a -f "/var/run/$file" ]
687 then
688 /etc/init.d/$daemon stop
689 fi
690 done <<EOT
691 apache apache/httpd.pid
692 lighttpd lighttpd.pid
693 EOT
694 }
696 post_install_php_mcrypt()
697 {
698 grep -q ^extension=mcrypt.so "$1/etc/php.ini" ||
699 sed -e 's|extension=msql.so|extension=msql.so\nextension=mcrypt.so|' \
700 -i "$1/etc/php.ini"
702 # Start Web server.
703 while read daemon file
704 do
705 [ -z "$1" ] || continue
706 if [ -f "/var/run/$file" ]
707 then
708 /etc/init.d/$daemon stop
709 sleep 2
710 fi
711 if [ -f /etc/init.d/$daemon ]
712 then
713 /etc/init.d/$daemon start
714 fi
715 done <<EOT
716 apache apache/httpd.pid
717 lighttpd lighttpd.pid
718 EOT
719 }
721 pre_remove_php_mcrypt()
722 {
723 sed -i '/.*=mcrypt.so.*/d' /etc/php.ini
725 # Start Web server.
726 while read daemon file
727 do
728 [ -z "$1" ] || continue
729 if [ -f "/var/run/$file" ]
730 then
731 /etc/init.d/$daemon stop
732 sleep 2
733 fi
734 if [ -f /etc/init.d/$daemon ]
735 then
736 /etc/init.d/$daemon start
737 fi
738 done <<EOT
739 apache apache/httpd.pid
740 lighttpd lighttpd.pid
741 EOT
742 }
744 # -----------------------------------------------------------------------------
745 pre_install_php_mysqli()
746 {
747 while read daemon file
748 do
749 if [ -z "$1" -a -f "/var/run/$file" ]
750 then
751 /etc/init.d/$daemon stop
752 fi
753 done <<EOT
754 apache apache/httpd.pid
755 lighttpd lighttpd.pid
756 EOT
757 }
759 post_install_php_mysqli()
760 {
761 grep -q ^extension=mysqli.so "$1/etc/php.ini" ||
762 sed -e 's|extension=msql.so|extension=msql.so\nextension=mysqli.so|' \
763 -i "$1/etc/php.ini"
765 # Start Web server.
766 while read daemon file
767 do
768 [ -z "$1" ] || continue
769 if [ -f "/var/run/$file" ]
770 then
771 /etc/init.d/$daemon stop
772 sleep 2
773 fi
774 if [ -f /etc/init.d/$daemon ]
775 then
776 /etc/init.d/$daemon start
777 fi
778 done <<EOT
779 apache apache/httpd.pid
780 lighttpd lighttpd.pid
781 EOT
782 }
784 pre_remove_php_mysqli()
785 {
786 sed -i '/.*=mysqli.so.*/d' /etc/php.ini
788 # Start Web server.
789 while read daemon file
790 do
791 [ -z "$1" ] || continue
792 if [ -f "/var/run/$file" ]
793 then
794 /etc/init.d/$daemon stop
795 sleep 2
796 fi
797 if [ -f /etc/init.d/$daemon ]
798 then
799 /etc/init.d/$daemon start
800 fi
801 done <<EOT
802 apache apache/httpd.pid
803 lighttpd lighttpd.pid
804 EOT
805 }
807 # -----------------------------------------------------------------------------
808 pre_install_php_mysql()
809 {
810 while read daemon file
811 do
812 if [ -z "$1" -a -f "/var/run/$file" ]
813 then
814 /etc/init.d/$daemon stop
815 fi
816 done <<EOT
817 apache apache/httpd.pid
818 lighttpd lighttpd.pid
819 EOT
820 }
822 post_install_php_mysql()
823 {
824 grep -q ^extension=mysql.so "$1/etc/php.ini" ||
825 sed -e 's|extension=msql.so|extension=msql.so\nextension=mysql.so|' \
826 -i "$1/etc/php.ini"
828 # Start Web server.
829 while read daemon file
830 do
831 [ -z "$1" ] || continue
832 if [ -f "/var/run/$file" ]
833 then
834 /etc/init.d/$daemon stop
835 sleep 2
836 fi
837 if [ -f /etc/init.d/$daemon ]
838 then
839 /etc/init.d/$daemon start
840 fi
841 done <<EOT
842 apache apache/httpd.pid
843 lighttpd lighttpd.pid
844 EOT
845 }
847 pre_remove_php_mysql()
848 {
849 sed -i '/.*=mysql.so.*/d' /etc/php.ini
851 # Start Web server.
852 while read daemon file
853 do
854 [ -z "$1" ] || continue
855 if [ -f "/var/run/$file" ]
856 then
857 /etc/init.d/$daemon stop
858 sleep 2
859 fi
860 if [ -f /etc/init.d/$daemon ]
861 then
862 /etc/init.d/$daemon start
863 fi
864 done <<EOT
865 apache apache/httpd.pid
866 lighttpd lighttpd.pid
867 EOT
868 }
870 # -----------------------------------------------------------------------------
871 pre_install_php_odbc()
872 {
873 while read daemon file
874 do
875 if [ -z "$1" -a -f "/var/run/$file" ]
876 then
877 /etc/init.d/$daemon stop
878 fi
879 done <<EOT
880 apache apache/httpd.pid
881 lighttpd lighttpd.pid
882 EOT
883 }
885 post_install_php_odbc()
886 {
887 grep -q ^extension=odbc.so "$1/etc/php.ini" ||
888 sed -e 's|extension=msql.so|extension=msql.so\nextension=odbc.so|' \
889 -i "$1/etc/php.ini"
891 # Start Web server.
892 while read daemon file
893 do
894 [ -z "$1" ] || continue
895 if [ -f "/var/run/$file" ]
896 then
897 /etc/init.d/$daemon stop
898 sleep 2
899 fi
900 if [ -f /etc/init.d/$daemon ]
901 then
902 /etc/init.d/$daemon start
903 fi
904 done <<EOT
905 apache apache/httpd.pid
906 lighttpd lighttpd.pid
907 EOT
908 }
910 pre_remove_php_odbc()
911 {
912 sed -i '/.*=odbc.so.*/d' /etc/php.ini
914 # Start Web server.
915 while read daemon file
916 do
917 [ -z "$1" ] || continue
918 if [ -f "/var/run/$file" ]
919 then
920 /etc/init.d/$daemon stop
921 sleep 2
922 fi
923 if [ -f /etc/init.d/$daemon ]
924 then
925 /etc/init.d/$daemon start
926 fi
927 done <<EOT
928 apache apache/httpd.pid
929 lighttpd lighttpd.pid
930 EOT
931 }
933 # -----------------------------------------------------------------------------
934 pre_install_php_openssl()
935 {
936 while read daemon file
937 do
938 if [ -z "$1" -a -f "/var/run/$file" ]
939 then
940 /etc/init.d/$daemon stop
941 fi
942 done <<EOT
943 apache apache/httpd.pid
944 lighttpd lighttpd.pid
945 EOT
946 }
948 post_install_php_openssl()
949 {
950 grep -q ^extension=openssl.so "$1/etc/php.ini" ||
951 sed -e 's|extension=msql.so|extension=msql.so\nextension=openssl.so|' \
952 -i "$1/etc/php.ini"
954 # Start Web server.
955 while read daemon file
956 do
957 [ -z "$1" ] || continue
958 if [ -f "/var/run/$file" ]
959 then
960 /etc/init.d/$daemon stop
961 sleep 2
962 fi
963 if [ -f /etc/init.d/$daemon ]
964 then
965 /etc/init.d/$daemon start
966 fi
967 done <<EOT
968 apache apache/httpd.pid
969 lighttpd lighttpd.pid
970 EOT
971 }
973 pre_remove_php_openssl()
974 {
975 sed -i '/.*=openssl.so.*/d' /etc/php.ini
977 # Start Web server.
978 while read daemon file
979 do
980 [ -z "$1" ] || continue
981 if [ -f "/var/run/$file" ]
982 then
983 /etc/init.d/$daemon stop
984 sleep 2
985 fi
986 if [ -f /etc/init.d/$daemon ]
987 then
988 /etc/init.d/$daemon start
989 fi
990 done <<EOT
991 apache apache/httpd.pid
992 lighttpd lighttpd.pid
993 EOT
994 }
996 # -----------------------------------------------------------------------------
997 pre_install_pdo_mysql()
998 {
999 while read daemon file
1000 do
1001 if [ -z "$1" -a -f "/var/run/$file" ]
1002 then
1003 /etc/init.d/$daemon stop
1004 fi
1005 done <<EOT
1006 apache apache/httpd.pid
1007 lighttpd lighttpd.pid
1008 EOT
1011 post_install_pdo_mysql()
1013 grep -q ^extension=pdo_mysql.so "$1/etc/php.ini" ||
1014 sed -e 's|extension=msql.so|extension=msql.so\nextension=pdo_mysql.so|' \
1015 -i "$1/etc/php.ini"
1017 # Start Web server.
1018 while read daemon file
1019 do
1020 [ -z "$1" ] || continue
1021 if [ -z "$1" -a -f "/var/run/$file" ]
1022 then
1023 /etc/init.d/$daemon stop
1024 sleep 2
1025 fi
1026 if [ -z "$1" -a -f /etc/init.d/$daemon ]
1027 then
1028 /etc/init.d/$daemon start
1029 fi
1030 done <<EOT
1031 apache apache/httpd.pid
1032 lighttpd lighttpd.pid
1033 EOT
1036 pre_remove_pdo_mysql()
1038 sed -i '/.*=pdo_mysql.so.*/d' /etc/php.ini
1040 # Start Web server.
1041 while read daemon file
1042 do
1043 [ -z "$1" ] || continue
1044 if [ -z "$1" -a -f "/var/run/$file" ]
1045 then
1046 /etc/init.d/$daemon stop
1047 sleep 2
1048 fi
1049 if [ -z "$1" -a -f /etc/init.d/$daemon ]
1050 then
1051 /etc/init.d/$daemon start
1052 fi
1053 done <<EOT
1054 apache apache/httpd.pid
1055 lighttpd lighttpd.pid
1056 EOT
1059 # -----------------------------------------------------------------------------
1060 pre_install_pdo_pgsql()
1062 while read daemon file
1063 do
1064 if [ -z "$1" -a -f "/var/run/$file" ]
1065 then
1066 /etc/init.d/$daemon stop
1067 fi
1068 done <<EOT
1069 apache apache/httpd.pid
1070 lighttpd lighttpd.pid
1071 EOT
1074 post_install_pdo_pgsql()
1076 grep -q ^extension=pdo_pgsql.so "$1/etc/php.ini" ||
1077 sed -e 's|extension=msql.so|extension=msql.so\nextension=pdo_pgsql.so|' \
1078 -i "$1/etc/php.ini"
1080 # Start Web server.
1081 while read daemon file
1082 do
1083 [ -z "$1" ] || continue
1084 if [ -z "$1" -a -f "/var/run/$file" ]
1085 then
1086 /etc/init.d/$daemon stop
1087 sleep 2
1088 fi
1089 if [ -z "$1" -a -f /etc/init.d/$daemon ]
1090 then
1091 /etc/init.d/$daemon start
1092 fi
1093 done <<EOT
1094 apache apache/httpd.pid
1095 lighttpd lighttpd.pid
1096 EOT
1099 pre_remove_pdo_pgsql()
1101 sed -i '/.*=pdo_pgsql.so.*/d' /etc/php.ini
1103 # Start Web server.
1104 while read daemon file
1105 do
1106 [ -z "$1" ] || continue
1107 if [ -z "$1" -a -f "/var/run/$file" ]
1108 then
1109 /etc/init.d/$daemon stop
1110 sleep 2
1111 fi
1112 if [ -z "$1" -a -f /etc/init.d/$daemon ]
1113 then
1114 /etc/init.d/$daemon start
1115 fi
1116 done <<EOT
1117 apache apache/httpd.pid
1118 lighttpd lighttpd.pid
1119 EOT
1122 # -----------------------------------------------------------------------------
1123 pre_install_php_pear()
1125 while read daemon file
1126 do
1127 if [ -z "$1" -a -f "/var/run/$file" ]
1128 then
1129 /etc/init.d/$daemon stop
1130 fi
1131 done <<EOT
1132 apache apache/httpd.pid
1133 lighttpd lighttpd.pid
1134 EOT
1137 post_install_php_pear()
1139 grep ^include_path "$1/etc/php.ini"
1140 sed -i 's|/php/includes"|/php/includes"\ninclude_path = ".:/usr/share/php"|' \
1141 "$1/etc/php.ini"
1142 # Restart Web server.
1143 while read daemon file
1144 do
1145 [ -z "$1" ] || continue
1146 if [ -f "/var/run/$file" ]
1147 then
1148 /etc/init.d/$daemon stop
1149 sleep 2
1150 fi
1151 if [ -f /etc/init.d/$daemon ]
1152 then
1153 /etc/init.d/$daemon start
1154 fi
1155 done <<EOT
1156 apache apache/httpd.pid
1157 lighttpd lighttpd.pid
1158 EOT
1161 # -----------------------------------------------------------------------------
1162 pre_install_php_pgsql()
1164 while read daemon file
1165 do
1166 if [ -z "$1" -a -f "/var/run/$file" ]
1167 then
1168 /etc/init.d/$daemon stop
1169 fi
1170 done <<EOT
1171 apache apache/httpd.pid
1172 lighttpd lighttpd.pid
1173 EOT
1176 post_install_php_pgsql()
1178 grep -q ^extension=pgsql.so "$1/etc/php.ini" ||
1179 sed -e 's|extension=msql.so|extension=msql.so\nextension=pgsql.so|' \
1180 -i "$1/etc/php.ini"
1182 # Start Web server.
1183 while read daemon file
1184 do
1185 [ -z "$1" ] || continue
1186 if [ -f "/var/run/$file" ]
1187 then
1188 /etc/init.d/$daemon stop
1189 sleep 2
1190 fi
1191 if [ -f /etc/init.d/$daemon ]
1192 then
1193 /etc/init.d/$daemon start
1194 fi
1195 done <<EOT
1196 apache apache/httpd.pid
1197 lighttpd lighttpd.pid
1198 EOT
1201 pre_remove_php_pgsql()
1203 sed -i '/.*=pgsql.so.*/d' /etc/php.ini
1205 # Start Web server.
1206 while read daemon file
1207 do
1208 [ -z "$1" ] || continue
1209 if [ -f "/var/run/$file" ]
1210 then
1211 /etc/init.d/$daemon stop
1212 sleep 2
1213 fi
1214 if [ -f /etc/init.d/$daemon ]
1215 then
1216 /etc/init.d/$daemon start
1217 fi
1218 done <<EOT
1219 apache apache/httpd.pid
1220 lighttpd lighttpd.pid
1221 EOT
1224 # -----------------------------------------------------------------------------
1225 pre_install_php_snmp()
1227 while read daemon file
1228 do
1229 if [ -z "$1" -a -f "/var/run/$file" ]
1230 then
1231 /etc/init.d/$daemon stop
1232 fi
1233 done <<EOT
1234 apache apache/httpd.pid
1235 lighttpd lighttpd.pid
1236 EOT
1239 post_install_php_snmp()
1241 grep -q ^extension=snmp.so "$1/etc/php.ini" ||
1242 sed -e 's|extension=msql.so|extension=msql.so\nextension=snmp.so|' \
1243 -i "$1/etc/php.ini"
1245 # Start Web server.
1246 while read daemon file
1247 do
1248 [ -z "$1" ] || continue
1249 if [ -f "/var/run/$file" ]
1250 then
1251 /etc/init.d/$daemon stop
1252 sleep 2
1253 fi
1254 if [ -f /etc/init.d/$daemon ]
1255 then
1256 /etc/init.d/$daemon start
1257 fi
1258 done <<EOT
1259 apache apache/httpd.pid
1260 lighttpd lighttpd.pid
1261 EOT
1264 pre_remove_php_snmp()
1266 sed -i '/.*=snmp.so.*/d' /etc/php.ini
1268 # Start Web server.
1269 while read daemon file
1270 do
1271 [ -z "$1" ] || continue
1272 if [ -f "/var/run/$file" ]
1273 then
1274 /etc/init.d/$daemon stop
1275 sleep 2
1276 fi
1277 if [ -f /etc/init.d/$daemon ]
1278 then
1279 /etc/init.d/$daemon start
1280 fi
1281 done <<EOT
1282 apache apache/httpd.pid
1283 lighttpd lighttpd.pid
1284 EOT
1287 # -----------------------------------------------------------------------------
1288 pre_install_php_soap()
1290 while read daemon file
1291 do
1292 if [ -z "$1" -a -f "/var/run/$file" ]
1293 then
1294 /etc/init.d/$daemon stop
1295 fi
1296 done <<EOT
1297 apache apache/httpd.pid
1298 lighttpd lighttpd.pid
1299 EOT
1302 post_install_php_soap()
1304 grep -q ^extension=soap.so "$1/etc/php.ini" ||
1305 sed -e 's|extension=msql.so|extension=msql.so\nextension=soap.so|' \
1306 -i "$1/etc/php.ini"
1308 # Start Web server.
1309 while read daemon file
1310 do
1311 [ -z "$1" ] || continue
1312 if [ -f "/var/run/$file" ]
1313 then
1314 /etc/init.d/$daemon stop
1315 sleep 2
1316 fi
1317 if [ -f /etc/init.d/$daemon ]
1318 then
1319 /etc/init.d/$daemon start
1320 fi
1321 done <<EOT
1322 apache apache/httpd.pid
1323 lighttpd lighttpd.pid
1324 EOT
1327 pre_remove_php_soap()
1329 sed -i '/.*=soap.so.*/d' /etc/php.ini
1331 # Start Web server.
1332 while read daemon file
1333 do
1334 [ -z "$1" ] || continue
1335 if [ -f "/var/run/$file" ]
1336 then
1337 /etc/init.d/$daemon stop
1338 sleep 2
1339 fi
1340 if [ -f /etc/init.d/$daemon ]
1341 then
1342 /etc/init.d/$daemon start
1343 fi
1344 done <<EOT
1345 apache apache/httpd.pid
1346 lighttpd lighttpd.pid
1347 EOT
1350 # -----------------------------------------------------------------------------
1351 post_install_php_sqlite()
1353 grep -q ^extension=sqlite3.so "$1/etc/php.ini" ||
1354 sed -e 's|extension=msql.so|extension=msql.so\nextension=sqlite3.so|' \
1355 -i "$1/etc/php.ini"
1357 # Start Web server.
1358 while read daemon file
1359 do
1360 [ -z "$1" ] || continue
1361 if [ -f "/var/run/$file" ]
1362 then
1363 /etc/init.d/$daemon stop
1364 sleep 2
1365 fi
1366 if [ -f /etc/init.d/$daemon ]
1367 then
1368 /etc/init.d/$daemon start
1369 fi
1370 done <<EOT
1371 apache apache/httpd.pid
1372 lighttpd lighttpd.pid
1373 EOT
1376 pre_remove_php_sqlite()
1378 sed -i '/.*=sqlite3.so.*/d' /etc/php.ini
1380 # Start Web server.
1381 while read daemon file
1382 do
1383 [ -z "$1" ] || continue
1384 if [ -f "/var/run/$file" ]
1385 then
1386 /etc/init.d/$daemon stop
1387 sleep 2
1388 fi
1389 if [ -f /etc/init.d/$daemon ]
1390 then
1391 /etc/init.d/$daemon start
1392 fi
1393 done <<EOT
1394 apache apache/httpd.pid
1395 lighttpd lighttpd.pid
1396 EOT