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; }