protected function initIp()
 {
     global $application;
     $configFilename = '/var/www/symfony/ip_config.php';
     //please do install impresspages manually and provide path to the installation config. TODO create composer setup wizard
     require_once '/var/www/symfony/vendor/impresspages/impresspages/Ip/Application.php';
     $application = new \Ip\Application($configFilename);
     $application->init();
     $application->prepareEnvironment(array());
     $request = new \Ip\Request();
     $request->fixMagicQuotes();
     $request->setQuery($_GET);
     $request->setPost($_POST);
     $request->setServer($_SERVER);
     $request->setRequest($_REQUEST);
     //\Ip\ServiceLocator::addRequest($request);
     $response = $application->handleRequest($request, array(), false);
     return $response;
 }
Exemplo n.º 2
0
 /**
  * @ignore
  * @param array $options
  */
 public function run($options = array())
 {
     $this->prepareEnvironment($options);
     $request = new \Ip\Request();
     $request->fixMagicQuotes();
     $request->setQuery($_GET);
     $request->setPost($_POST);
     $request->setServer($_SERVER);
     $request->setRequest($_REQUEST);
     $response = $this->handleRequest($request, $options, false);
     $this->handleResponse($response);
     $this->close();
 }