private static function isCli() { static $cli = null; if ($cli === null) { $cli = php_sapi_name() === "cli"; } return $cli; }