2007-08-02 12:45:15 +00:00
|
|
|
<?php
|
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
function assertCli()
|
|
|
|
{
|
2007-08-02 12:45:15 +00:00
|
|
|
if (php_sapi_name() != 'cli' && !getenv('PHP_IS_CLI')) {
|
2008-04-03 20:52:08 +00:00
|
|
|
echo 'Script cannot be called from web-browser (if you are indeed calling via cli,
|
2007-08-02 12:45:15 +00:00
|
|
|
set environment variable PHP_IS_CLI to work around this).';
|
2008-04-03 20:52:08 +00:00
|
|
|
exit(1);
|
2007-08-02 12:45:15 +00:00
|
|
|
}
|
|
|
|
}
|
2007-08-26 17:04:31 +00:00
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
function prefix_is($comp, $subject)
|
|
|
|
{
|
2008-12-06 09:24:59 +00:00
|
|
|
return strncmp($comp, $subject, strlen($comp)) === 0;
|
|
|
|
}
|
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
function postfix_is($comp, $subject)
|
|
|
|
{
|
2008-12-06 09:24:59 +00:00
|
|
|
return strlen($subject) < $comp ? false : substr($subject, -strlen($comp)) === $comp;
|
|
|
|
}
|
|
|
|
|
2008-01-27 05:31:06 +00:00
|
|
|
// Load useful stuff like FSTools
|
2009-05-30 02:10:47 +00:00
|
|
|
require_once dirname(__FILE__) . '/../extras/HTMLPurifierExtras.auto.php';
|
2008-12-06 09:24:59 +00:00
|
|
|
|
|
|
|
// vim: et sw=4 sts=4
|