wok-next view php/receipt @ rev 21403

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