$!----------------------------------------------------------------------------- $! INSTALL.COM $! $! P1 can be INSTALL (default), UPDATE, REMOVE, PHP, SECURE $! P2 is the location of the kit, e.g. DEVICE:[DIRECTORY] $! P3 specifies the CSWS PHP kit to install from (default is CSWS_PHP) $! $! Install (most of) the CSWS PHP kit, build PHPWASD.EXE and copy the example $! PHP scripts into the [CGI-BIN] directory. $! $! HT_ROOT:[PHP.AXP] PHP.INI configuration file $! HT_ROOT:[PHP.IA64] ditto $! HT_ROOT:[PHP.AXP.BIN] PHP.EXE and PHPSHR.EXE (from CSWS kit) $! HT_ROOT:[PHP.IA64.BIN] ditto $! HT_ROOT:[PHP.AXP.EXTENSIONS] PHP extension sharable images (from kit) $! HT_ROOT:[PHP.IA64.EXTENSIONS] ditto $! HT_ROOT:[PHP.AXP.SCRIPTS] example PHP scripts (from CSWS kit) $! HT_ROOT:[PHP.IA64.SCRIPTS] ditto $! HT_ROOT:[CGI-BIN] *.PHP scripts (copied from [PHP.SCRIPTS]) $! HT_ROOT:[AXP-BIN] PHPWASD.EXE $! HT_ROOT:[IA64-BIN] ditto $! $! 20-MAY-2009 MGD CPQ AXPVMS CSWS_PHP V2.0 $! 04-MAY-2008 MGD change P3 default to "CSWS_PHP*" to pick up updates $! add HTTPD/DO=DCL=PURGE to notify server of new RTE $! 01-OCT-2006 MGD allow P3 to specify a PHP update PCSI $! allow for VMS V8.3 .PCSI$COMPRESSED kits $! 03-DEC-2005 MGD bugfix; do not delete existing PHP.INI when changing $! structure from [PHP] to [PHP.AXP] and [PHP.IA64] $! 01-DEC-2005 MGD bugfix; deassign PHP_ROOT after $! "Deleting previous CSWS PHP components ..." $! (thanks Wim Van den Wyngaert) $! 18-AUG-2005 MGD IA64 support (in addition to the original Alpha) $! architecture-specific directories for CSWS components $! 19-FEB-2005 MGD bugfix; brain-dead P1 handling (thanks Rene Mendoza) $! 22-JAN-2005 MGD some refinements $! 21-FEB-2004 MGD CSWS PHP 1.2, PHPWASD.COM $! 18-APR-2003 MGD add CSWS PHP v1.1 update 1 (as "UPDATE111") $! 10-JAN-2003 MGD update $! 26-DEC-2002 MGD CSWS PHP v1.1 $! 19-JAN-2002 MGD initial $!----------------------------------------------------------------------------- $! $ if P3 .eqs. "" then P3 = "CSWS_PHP*" $! $ say = "write sys$output" $ ss$_abort = 44 $! $ arch_name = f$edit(f$getsyi("arch_name"),"upcase") $ if arch_name .eqs. "ALPHA" then arch_name = "AXP" $! $ if arch_name .eqs. "VAX" $ then $ type sys$input ******************************************************* * THIS PROCEDURE MAY ONLY BE USED ON ALPHA/IA64 VMS * ******************************************************* $ exit ss$_abort $ endif $! $ if f$search("ht_exe:sechan.exe") .eqs. "" $ then $ type sys$input *********************** * WASD 8.1 OR LATER * *********************** This kit is only suitable for WASD 8.1 or later. Please update your site (for this and other reasons) ASAP! $ exit ss$_abort $ endif $! $ if P1 .nes. "INSTALL" .and. P1 .nes. "UPDATE" .and. - P1 .nes. "REMOVE" .and. P1 .nes. "PHP" .and. P1 .nes. "SECURE" $ then $ P2 = P1 $ P1 = "INSTALL" $ endif $! $ type sys$input Copyright (C) 2002-2009 Mark G.Daniel This package comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under the conditions of the GNU GENERAL PUBLIC LICENSE, version 3, or any later version. http://www.gnu.org/licenses/gpl.txt $ if P1 .eqs. "INSTALL" $ then $ type sys$input *************************** * INSTALL WASD PHP V2.0 * *************************** This procedure installs a PORTION of the CSWS PHP PCSI kit into the WASD $ say "package directory tree as HT_ROOT:[PHP.''arch_name'] with [.BIN], [.EXTENSIONS]" $ type sys$input and [.SCRIPTS] subdirectories. The WASD PHP engine interface will then be linked against the CSWS PHP shareable image. This image is copied to $ say "[''arch_name'-BIN] and the example scripts in [PHP.SCRIPTS] into [CGI-BIN]." $ type sys$input The WASD PHP interface can be updated using ..... $ @INSTALL UPDATE This installation can be removed using .......... $ @INSTALL REMOVE The CSWS PHP kit can be updated (careful!) ...... $ @INSTALL PHP The CSWS PHP kit security can be modified ....... $ @INSTALL SECURE $ read sys$command /prompt="Continue? [N]: " response $ say "" $ if .not. response then exit $! $ endif $! $ if P1 .eqs. "INSTALL" .or. P1 .eqs. "PHP" $ then $! $ if P2 .eqs. "" .or. (f$search("''P2'*''P3'*.PCSI") .eqs. "" .and. - f$search("''P2'*''P3'*.PCSI$COMPRESSED") .eqs. "") $ then $ type sys$input ******************************* * LOCATION OF CSWS_PHP KIT? * ******************************* Use P1 or P2 to specify the location of the CSWS_PHP kit. $ @INSTALL.COM [INSTALL|PHP] device:[directory] With P1 and P2 supplied, P3 may then be used to specify an alternate PHP kit. $ exit ss$_abort $ endif $! $ source = "" $ if P2 .nes. "" then source = "/source=''P2'" $! $ say "Creating required architecture-specific directories ..." $ create = "create" $ create /directory /log ht_root:[php.'arch_name'.bin] $ create /directory /log ht_root:[php.'arch_name'.extensions] $ create /directory /log ht_root:[php.'arch_name'.scripts] $! $ product = "product" $! $ type sys$input ********************** * CSWS_PHP VERSION * ********************** Installing (the highest) version ... $ product find 'P3' 'source' $ say "" $ read sys$command /prompt="Continue? [N]: " response $ say "" $ if .not. response then exit $! $ say "" $ say "Extracting PHPSHR.EXE ..." $ define /user sys$command sys$input $ product extract file 'P3' - /select=[apache.php.bin]phpshr.exe - /destination=ht_root:[php.'arch_name'.bin] 'source' $ say "" $ say "Extracting PHP.EXE ..." $ define /user sys$command sys$input $ product extract file 'P3' - /select=[apache.php.bin]php.exe - /destination=ht_root:[php.'arch_name'.bin] 'source' $ say "" $ say "Extracting extension sharable images ..." $ define /user sys$command sys$input $ product extract file 'P3' - /select=[apache.php.extensions]*.exe - /destination=ht_root:[php.'arch_name'.extensions] 'source' $ say "" $ say "Extracting example scripts ..." $ define /user sys$command sys$input $ product extract file 'P3' - /select=[apache.php.scripts]*.php - /destination=ht_root:[php.'arch_name'.scripts] 'source' $! $ if f$search("HT_ROOT:[PHP]BIN.DIR") .nes. "" .and. - f$search("HT_ROOT:[PHP]EXTENSIONS.DIR") .nes. "" .and. - f$search("HT_ROOT:[PHP]SCRIPTS.DIR") .nes. "" $ then $ say "" $ say "Deleting previous CSWS PHP components ..." $ rename = "rename/log" $! (preserve any existing PHP.INI) $ rename ht_root:[php]php.ini;0 ht_root:[php]php._ini_;0 $! (remove logical names with non-architecture-specific locations) $ @ht_root:[src.php]php_startup remove $ delete = "delete/log" $ delete ht_root:[php.bin...]*.*;*,- ht_root:[php.extensions...]*.*;*,- ht_root:[php.scripts...]*.*;*,- ht_root:[php]php.ini;*,- ht_root:[php]bin.dir;*,- ht_root:[php]extensions.dir;*,- ht_root:[php]scripts.dir;* $! (logical names with new locations) $ if f$trnlnm("php_root","lnm$system") .nes. "" - then deassign /system php_root $ @ht_root:[src.php]php_startup $ say "" $ endif $! $ endif $! $ if P1 .eqs. "INSTALL" .or. P1 .eqs. "SECURE" $ then $ type sys$input $ sechan = "$ht_exe:sechan" $! (check if it's a version that supports /permit) $ def /user sys$output nl: $ def /user sys$error nl: $ sechan /version $ if f$type(sechan_version) .nes. "" $ then $! (yes, it does; v1.2.0 or later) $ scriptingAccountLoop: $ type sys$input *********************** * SCRIPTING ACCOUNT * *********************** By default access to HT_ROOT:[PHP.*...] is granted to WASD_HTTP_SERVER (the server account rights identifier) and WASD_HTTP_NOBODY (the scripting account rights identifier. If this site's PHP scripting is executed under a non-default WASD account (i.e. something other than HTTP$NOBODY) then this needs to be granted access instead. $ response = "" $ read sys$command /prompt="Account? [WASD_HTTP_NOBODY]: " response $ say "" $ if response .eqs. "" then response = "WASD_HTTP_NOBODY" $ if f$identifier(response,"name_to_number") .eq. 0 $ then $ say "ERROR: identifier not found" $ say "" $ goto scriptingAccountLoop $ endif $ endScriptingAccountLoop: $ say "Setting HT_ROOT:[PHP.''arch_name'...] security ..." $ sechan /delete ht_root:[000000]php.dir $ sechan /delete ht_root:[php.'arch_name'...]*.*;* $ sechan /permit='response' /read ht_root:[000000]php.dir $ sechan /permit='response' /read ht_root:[php...]*.*;* $ sechan /server /read ht_root:[000000]php.dir $ sechan /server /read ht_root:[php...]*.dir $ sechan /noworld /none ht_root:[000000]php.dir $ sechan /noworld /none ht_root:[php...]*.*;* $ else $! (pre-v1.2.0) $ sechan /asif=CGI-BIN ht_root:[000000]php.dir $ sechan /asif=CGI-BIN ht_root:[php...]*.*;* $ endif $ say "" $! $ endif $! $ if P1 .eqs. "INSTALL" $ then $! $! (define logical names for sharable images) $ @ht_root:[src.php]php_startup $! $! (link PHPWASD.EXE) $ @ht_root:[src.php]build_phpwasd $! $ say "Copying files ..." $ copy = "copy/log" $ copy ht_exe:phpwasd.exe ht_root:['arch_name'-bin] $ copy ht_root:[src.php]phpwasd.com ht_root:['arch_name'-bin] $ copy ht_root:[php.'arch_name'.scripts]*.php ht_root:[cgi-bin] $ copy ht_root:[src.php]php.ini ht_root:[php.'arch_name'] $ copy ht_root:[src.php]webserverspy.php ht_root:[cgi-bin] $ if f$search("ht_root:[php]php._ini_") .nes. "" $ then $ rename = "rename/log" $ rename ht_root:[php]php._ini_;0 ht_root:[php]php.ini;0 $ endif $ say "" $! $ endif $! $ if P1 .eqs. "UPDATE" $ then $ type sys$input ************************** * UPDATE WASD PHP V2.0 * ************************** This procedures updates the WASD components of the PHP interface. The WASD PHP interface (script) is linked against the existing CSWS PHP $ say "shareable image. This image is copied to [''arch_name'-BIN]." $ say "" $ read sys$command /prompt="Continue? [N]: " response $ say "" $ if .not. response then exit $! $! (link PHPWASD.EXE) $ @ht_root:[src.php]build_phpwasd $! $ copy = "copy/log" $ copy ht_exe:phpwasd.exe ht_root:['arch_name'-bin] $ copy ht_root:[src.php]phpwasd.com ht_root:['arch_name'-bin] $ if f$search("ht_root:[php]php._ini_") .nes. "" $ then $ rename = "rename/log" $ rename ht_root:[php]php._ini_;0 ht_root:[php]php.ini;0 $ endif $ say "" $! $ endif $! $ if P1 .eqs. "REMOVE" $ then $ type sys$input ********************* * REMOVE WASD PHP * ********************* This procedure deletes the CSWS PHP files used to a support WASD PHP and files from the WASD scripting environment. As this is DELETION and final please ensure you have copied any files you may require to keep (especially any local PHP scripts from [CGI-BIN]). $ if arch_name .eqs. "AXP" $ then $ type sys$input HT_ROOT:[PHP.AXP...]*.*;* HT_ROOT:[AXP-BIN]PHPWASD.EXE;* HT_ROOT:[AXP-BIN]PHPWASD.COM;* $ else $ type sys$input HT_ROOT:[PHP.IA64...]*.*;* HT_ROOT:[IA64-BIN]PHPWASD.EXE;* HT_ROOT:[IA64-BIN]PHPWASD.COM;* $ endif $ type sys$input HT_ROOT:[CGI-BIN]*.PHP;* Note: it does not delete the HT_ROOT:[SRC.PHP] tree. $ read sys$command /prompt="Continue? [N]: " response $ say "" $ if .not. response then exit $ delete = "delete/log" $ delete ht_root:[php.'arch_name'...]*.*;*,- ht_root:[php.'arch_name'...]*.*;*,- ht_root:[php.'arch_name'...]*.*;*,- ht_root:[php]'arch_name'.dir;* $ delete ht_root:['arch_name'-bin]phpwasd.exe;* $ delete ht_root:['arch_name'-bin]phpwasd.com;* $ delete ht_root:[cgi-bin]*.php;* $ say "" $ endif $! $ type sys$input ******************* * NOTIFY SERVER * ******************* $ if f$type(httpd) .eqs. "" $ then $ if f$search("ht_exe:httpd_ssl.exe") .nes. "" $ then $ httpd = "$ht_exe:httpd_ssl.exe" $ else $ if f$search("ht_exe:httpd.exe") .nes. "" $ then $ httpd = "$ht_exe:httpd.exe" $ endif $ endif $ endif $ if f$type(httpd) .nes. "" $ then $ httpd/do=dcl=purge $ say "" $ else $ exit ss$_abort $ endif $! $ type sys$input ********************* * C O M P L E T E * ********************* $ exit $!-----------------------------------------------------------------------------