public function setDefaultFlags() { $isCli = !System::isFunctionDisabled('php_sapi_name') && php_sapi_name() === 'cli'; $this->setFlag(self::FLAG_CLI, $isCli); $this->setFlag(self::FLAG_WEB, !$isCli); return $this; }
public function testAppEngineDisabledFunctions() { $test = $_SERVER['SERVER_SOFTWARE']; $_SERVER['SERVER_SOFTWARE'] = 'Google App Engine/1.9.6'; $this->assertTrue(\Packaged\Helpers\System::isAppEngine()); $this->assertTrue(\Packaged\Helpers\System::isFunctionDisabled('phpinfo')); $this->assertFalse(\Packaged\Helpers\System::isFunctionDisabled('phpinfo', 'phpinfo,parse_str')); $_SERVER['SERVER_SOFTWARE'] = $test; }