From 0b743fb2db025fab8db5e3eda13b93793756e12e Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Thu, 2 Aug 2007 12:40:54 +0000 Subject: [PATCH] Update maintenance files with cgi-fcgi compiled PHP executable workaround. git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1342 48356398-32a2-884e-a903-53898d9a118a --- maintenance/flush-definition-cache.php | 5 +++-- maintenance/generate-entity-file.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/maintenance/flush-definition-cache.php b/maintenance/flush-definition-cache.php index 2b1567d1..eb99f3df 100755 --- a/maintenance/flush-definition-cache.php +++ b/maintenance/flush-definition-cache.php @@ -7,8 +7,9 @@ * the caches. */ -if (php_sapi_name() != 'cli') { - echo 'Script cannot be called from web-browser.'; +if (php_sapi_name() != 'cli' && !getenv('PHP_IS_CLI')) { + echo 'Script cannot be called from web-browser (if you are calling via cli, +set environment variable PHP_IS_CLI to work around this).'; exit; } diff --git a/maintenance/generate-entity-file.php b/maintenance/generate-entity-file.php index 062fed1c..202a9366 100755 --- a/maintenance/generate-entity-file.php +++ b/maintenance/generate-entity-file.php @@ -6,8 +6,9 @@ * writes the whole kaboodle to a file. The resulting file should be versioned. */ -if (php_sapi_name() != 'cli') { - echo 'Script cannot be called from web-browser.'; +if (php_sapi_name() != 'cli' && !getenv('PHP_IS_CLI')) { + echo 'Script cannot be called from web-browser. (if you are calling via cli, +set environment variable PHP_IS_CLI to work around this).'; exit; }