$!----------------------------------------------------------------------------- $! PHP_STARTUP.COM $! $! Copyright (C) 2002-2009 Mark G.Daniel. $! This package (all associated programs), 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 2. $! $! PHP_ROOT:[000000] include path, PHP.INI configuration file $! PHP_ROOT:[BIN] PHP sharable image and PHP CGI/CLI image $! PHP_ROOT:[EXTENSIONS] extension binaries $! $! If PHP_ROOT is defined before calling this procedure then use that $! otherwise search for HT_ROOT:[SRC.PHP] directory and use this area. $! If the area doesn't exist then quit. $! $! If PHPWASDSHR is defined before calling this procedure then use this $! as the location of the PHP sharable image. If not defined the check if $! there is a PHPSHR logical. If this exists then use that. If neither of $! these exist then have a look for HT_ROOT:[PHP.BIN]PHPSHR.EXE and if $! this exists define a PHPWASDSHR logical for it. If all of these fail $! then quit. $! $! Check if the PHPSHR logical exists. If not define one with the same value $! as PHPWASDSHR. This allows the [PHP.BIN]PHP.EXE verb to be used from $! the command-line and as a CGI PHP interpreter. For the WASD CSWS kit this $! would require a (SY)LOGIN.COM symbol similar to the following. $! $! $ PHP = "$HT_ROOT:[PHP.BIN]PHP.EXE" $! $! To use this image as a CGI PHP interpreter wrap it with a procedure similar $! to the following. $! $! $! HT_ROOT:[CGI-BIN]PHPWASD.COM $! $ PHP = "$HT_ROOT:[PHP.BIN]PHP.EXE" $! $ PHP 'P1' !any command-line switches desired or required $! $! The HTTPD$CONFIG [DclScriptRunTime] directive will need to be modified $! to use this wrapper procedure instead of the PHPWASD.EXE executable. $! Also the PHP.INI 'expose_php' will need to be modified to suppress the $! CGI response field that WASD will object to. $! $! 18-AUG-2005 MGD IA64 support $! 26-DEC-2002 MGD support only CSWS PHP 1.1 $! 19-JAN-2002 MGD initial $!----------------------------------------------------------------------------- $ say = "write sys$output" $ set noon $! $ arch_name = f$edit(f$getsyi("arch_name"),"upcase") $ if arch_name .eqs. "ALPHA" then arch_name = "AXP" $! $ if p1 .eqs. "REMOVE" $ then $! (WARNING: this removes WASD as well as (any) non-WASD definitions!) $ if f$trnlnm("PHP_ROOT","LNM$SYSTEM") .nes. "" - then deassign /system /executive php_root $ if f$trnlnm("PHPSHR","LNM$SYSTEM") .nes. "" - then deassign /system /executive phpshr $ if f$trnlnm("PHPWASDSHR","LNM$SYSTEM") .nes. "" - then deassign /system /executive phpwasdshr $ exit $ endif $! $ if f$trnlnm("PHP_ROOT") .eqs. "" $ then $! (not explicitly defined, fallback to WASD area) $ if f$search("ht_root:[000000]php.dir") .eqs. "" $ then $ say "%PHP_STARTUP-E-FAILED, could not find HT_ROOT:[PHP]" $ exit $ endif $ php_root = f$trnlnm("HT_ROOT") - "]" + "php." + arch_name + ".]" $ define /system /executive /translation=concealed php_root 'php_root' $ endif $! $ if f$trnlnm("PHPWASDSHR") .eqs. "" $ then $! (WASD PHP sharable image not explicitly defined) $ if f$trnlnm("PHPSHR") .eqs. "" $ then $! (standard (CSWS) PHP sharable image not explicitly defined) $ if f$search("ht_root:[php.''arch_name'.bin]phpshr.exe") .eqs. "" $ then $! (not looking too promising at all) $ say "%PHP_STARTUP-E-FAILED, could not find HT_ROOT:[PHP.''arch_name'.BIN]PHPSHR.EXE" $ exit $ endif $ define /system /executive phpwasdshr php_root:[bin]phpshr.exe $ else $! (use the same image as the site-defined PHPSHR) $ define /system /executive phpwasdshr 'f$trnlnm("PHPSHR")' $ endif $ endif $! $!(for PHP verb, no PHPSHR then use the same one as PHPWASDSHR) $ if f$trnlnm("PHPSHR") .eqs. "" - then define /system /executive phpshr 'f$trnlnm("PHPWASDSHR")' $! $!-----------------------------------------------------------------------------