Esempio n. 1
0
 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;
 }
Esempio n. 2
0
 public function __construct(Request $request, Cubex $cubex)
 {
     $this->setCubex($cubex);
     $this->_request = $request;
     $this->_ip = $this->_request->getClientIp();
     try {
         $this->_config = $cubex->getConfiguration()->getSection('http_visitor');
     } catch (\Exception $e) {
         $this->_config = new ConfigSection('http_visitor', []);
     }
     $this->configure($this->_config);
     if (System::isAppEngine($request->server->get('SERVER_SOFTWARE'))) {
         $this->_fromAppEngine();
     } else {
         if ($request->server->get('GEOIP_ADDR', null) !== null) {
             $this->_fromModGeoIP();
         }
     }
 }