static public function CheckEnv() {
if (!isset($_SERVER["TERM"]) || !isset($_SERVER["LOGNAME"]))
self::$errormessage = "This script should not be called in a browser.";
if (!function_exists("getopt"))
self::$errormessage = "PHP Function getopt not found. Please check your PHP version and settings.";
}
A solution would be check if php_sapi_name() == "cli"
If we try to run z-push-admin.php from a container we get an error, because we are missing some env variables (TERM & LOGNAME).
z-push-admin.php
A solution would be check if php_sapi_name() == "cli"
http://php.net/manual/en/function.php-sapi-name.php http://docs.hhvm.com/manual/en/function.php-sapi-name.php