1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-30 19:00:10 +02:00

Factor out cli execution guard to common.php

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1343 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2007-08-02 12:45:15 +00:00
parent 0b743fb2db
commit 82f8561123
3 changed files with 15 additions and 12 deletions

9
maintenance/common.php Normal file
View File

@@ -0,0 +1,9 @@
<?php
function assertCli() {
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;
}
}