$!----------------------------------------------------------------------------- $! INSTALL.COM $! $! P1 can be INSTALL (default), REMOVE, PHP, SECURE $! P2 is the PHP kit specification, e.g. DEVICE:[DIRECTORY]PHP_AXP_5_3_28.ZIP $! $! Install (most of) the Mark Berryman PHP kit and copy the example PHP $! scripts into the [CGI-BIN] directory. $! $! WASD_ROOT:[PHP.AXP] Mark Berryman Alpha PHP files $! WASD_ROOT:[PHP.IA64] Mark Berryman Itanium PHP files $! WASD_ROOT:[CGI-BIN] *.PHP scripts (copied from [PHP.SCRIPTS]) $! WASD_ROOT:[AXP-BIN] PHPWASD.EXE $! WASD_ROOT:[IA64-BIN] ditto $! $! 25-JAN-2014 MGD Mark Berryman PHP kits (exclusively, i.e. no more CSWS) $! 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 $!----------------------------------------------------------------------------- $! $ 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$trnlnm("WASD_EXE") .eqs. "" .and. - f$trnlnm("WASD_FILE_DEV") .nes. "" then @WASD_FILE_DEV $! $ if f$trnlnm("WASD_EXE") .eqs. "" $ then $ type sys$input ************************ * WASD 10.0 OR LATER * ************************ This kit is only suitable for WASD 10.0 or later. Please update your site (for this and other reasons). $ exit ss$_abort $ endif $! $ if P1 .nes. "INSTALL" .and. P1 .nes. "REMOVE" .and. - P1 .nes. "PHP" .and. P1 .nes. "SECURE" $ then $ P2 = P1 $ P1 = "INSTALL" $ endif $! $ if P1 .eqs. "INSTALL" .or. P1 .eqs. "PHP" $ then $! $ if P2 .eqs. "" .or. f$search(P2) .eqs. "" $ then $ type sys$input ************************** * LOCATION OF PHP KIT? * ************************** Use P1 or P2 to specify the location of the Mark Berryman PHP kit. $ @INSTALL.COM [INSTALL|PHP] device:[directory]PHP_xxx_n_n_n.ZIP $ exit ss$_abort $ endif $! $ if f$trnlnm("PHP_ROOT","LNM$PROCESS") .nes. "" .or. - f$trnlnm("PHP_ROOT","LNM$JOB") .nes. "" $ then $ type sys$input ************************ * PHP_ROOT DETECTED! * ************************ Logical name PHP_ROOT has been detected in the process or job logical table. This can interfere with the WASD PHP installation. Check and remove as necessary. $ show logical PHP_ROOT $ say "" $ read sys$command /prompt="Continue? [N]: " response $ say "" $ if .not. response then exit $! $ endif $! $ type sys$input Copyright (C) 2002-2014 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 * ********************** This procedure installs the Mark Berryman PHP kit into the WASD package $ say "directory tree as WASD_ROOT:[PHP.''arch_name']. The PHPWASD.EXE engine will then be" $ say "copied to WASD_ROOT:[''arch_name'-BIN] (CGI_EXE:) and the example scripts in" $ type sys$input WASD_ROOT:[SRC.PHP.SCRIPTS] into WASD_ROOT:[CGI-BIN] (CGI_BIN:). This installation can be removed using ......... $ @INSTALL REMOVE The Mark Berryman PHP kit can be updated ....... $ @INSTALL PHP The PHP directory security can be modified ..... $ @INSTALL SECURE $ read sys$command /prompt="Continue? [N]: " response $ say "" $ if .not. response then exit $! $ endif $! $ if f$search("WASD_ROOT:[PHP.''arch_name']BIN.DIR") .nes. "" $ then $ type sys$input ******************* * CSWS PHP KIT? * ******************* There appears to be residual CSWS PHP in the directory WASD_ROOT:[PHP] Before installing this package it is recommended to rename WASD_ROOT:[000000]PHP.DIR to WASD_ROOT:[000000]PHP_nnn.DIR and delete later, or delete the tree now. $ exit ss$_abort $ endif $! $ create = "create" $ if f$search("WASD_ROOT:[000000]PHP.DIR") .eqs. "" $ then $ say "Creating required architecture-specific PHP directory ..." create /directory /log wasd_root:[php.'arch_name'] $ else $ say "Architecture-specific PHP directory already exists." $ endif $ say "" $! $ say "UNZIPing Mark Berryman PHP kit ..." $ say "" $ set default WASD_ROOT:[PHP.'arch_name'] $ set noon $ unzip 'P2' $ if .not. $STATUS $ then $ type sys$input ***************** * UNZIP FAILED! * ***************** $ set default WASD_ROOT:[SRC.PHP] $ exit ss$_abort $ endif $ set on $ set default WASD_ROOT:[SRC.PHP] $ say "" $! $ endif $! $! (define logical names for shareable images) $ if P1 .nes. "REMOVE" then @wasd_root:[src.php]php_startup $ say "" $! $ if P1 .eqs. "INSTALL" .or. P1 .eqs. "SECURE" $ then $ sechan = "$wasd_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 WASD_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 WASD_ROOT:[PHP.''arch_name'...] security ..." $ sechan /delete wasd_root:[000000]php.dir $ sechan /delete wasd_root:[php.'arch_name'...]*.*;* $ sechan /permit='response' /read wasd_root:[000000]php.dir $ sechan /permit='response' /read wasd_root:[php...]*.*;* $ sechan /server /read wasd_root:[000000]php.dir $ sechan /server /read wasd_root:[php...]*.*;* $ if f$search("wasd_root:[php...]*.ini") .nes. "" - then sechan /noworld /none wasd_root:[php...]*.ini;* $ else $! (pre-v1.2.0) $ sechan /asif=CGI-BIN wasd_root:[000000]php.dir $ sechan /asif=CGI-BIN wasd_root:[php...]*.*;* $ endif $ say "" $! $ endif $! $ if P1 .eqs. "INSTALL" $ then $! $ say "Copying files ..." $ copy = "copy/log" $ copy php_root:[000000]phpwasd.exe cgi_exe: $ copy wasd_root:[src.php.scripts]*.php cgi_bin: $ say "" $! $ endif $! $ if P1 .eqs. "REMOVE" $ then $ type sys$input ********************* * REMOVE WASD PHP * ********************* This procedure deletes the Mark Berryman 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]). This DOES NOT delete the WASD_ROOT:[SRC.PHP] tree. $ if arch_name .eqs. "AXP" $ then $ type sys$input WASD_ROOT:[PHP.AXP]*.*;* WASD_ROOT:[AXP-BIN]PHPWASD.EXE;* $ else $ type sys$input WASD_ROOT:[PHP.IA64]*.*;* WASD_ROOT:[IA64-BIN]PHPWASD.EXE;* $ endif $ type sys$input WASD_ROOT:[CGI-BIN]PHP*.COM;* WASD_ROOT:[CGI-BIN]*.PHP;* $ read sys$command /prompt="Continue? [N]: " response $ say "" $ if .not. response then exit $ delete = "delete/log" $ delete wasd_root:[php.'arch_name'...]*.*;* $ delete wasd_root:[php]'arch_name'.dir;* $ delete wasd_root:['arch_name'-bin]phpwasd.exe;* $ delete wasd_root:[cgi-bin]php*.com;* $ delete wasd_root:[cgi-bin]php_*.php;* $ @wasd_root:[src.php]php_startup remove $ say "" $ endif $! $ type sys$input ******************* * NOTIFY SERVER * ******************* $ set symbol /scope=(nolocal,noglobal) $ if f$search("wasd_exe:httpd_ssl.exe") .nes. "" $ then $ httpd = "$wasd_exe:httpd_ssl.exe" $ else $ if f$search("wasd_exe:httpd.exe") .nes. "" $ then $ httpd = "$wasd_exe:httpd.exe" $ endif $ endif $ if f$type(httpd) .nes. "" $ then $ httpd/do=dcl=purge $ say "" $ else $ exit ss$_abort $ endif $ set symbol /scope=(local,global) $! $ type sys$input ********************* * C O M P L E T E * ********************* $ exit $!-----------------------------------------------------------------------------