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; }
<?php /** * @package ImpressPages */ if (PHP_MAJOR_VERSION < 5 || PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 3) { echo 'Your PHP version is: ' . PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION . '. To run ImpressPages you need PHP >= 5.3.*'; exit; } require_once __DIR__ . '/../Ip/Application.php'; $application = new \Ip\Application(__DIR__ . '/config.php'); $application->init(); $options = array('skipErrorHandler' => true); $application->prepareEnvironment($options); $options = array('skipInitEvents' => true, 'skipModuleInit' => true, 'translationsLanguageCode' => \Plugin\Install\Helper::$defaultLanguageCode); if (!empty($_REQUEST['lang']) && strlen($_REQUEST['lang']) == 2 && ctype_alpha($_REQUEST['lang'])) { $_SESSION['installationLanguage'] = $_REQUEST['lang']; } if (isset($_SESSION['installationLanguage'])) { $options['translationsLanguageCode'] = $_SESSION['installationLanguage']; } // Because module init is skipped, we have to initialize translations manually $translator = \Ip\ServiceLocator::translator(); $translator->setLocale($options['translationsLanguageCode']); $trPluginDir = ipFile('Plugin/Install/translations/'); $trOverrideDir = ipFile('file/translations/override/'); $translator->addTranslationFilePattern('json', $trPluginDir, 'Install-%s.json', 'Install'); $translator->addTranslationFilePattern('json', $trOverrideDir, 'Install-%s.json', 'Install'); $request = new \Plugin\Install\Request(); $request->setQuery($_GET); $request->setPost($_POST);