Example #1
0
 public function _before(\Codeception\TestCase $test)
 {
     require_once \Codeception\Configuration::projectDir() . 'src/includes/autoload.php';
     require_once \Codeception\Configuration::projectDir() . 'src/includes/classmap.php';
     require_once \Codeception\Configuration::projectDir() . 'src/Vendor/autoload.php';
     spl_autoload_register('autoloadlitpi');
     include_once \Codeception\Configuration::projectDir() . 'src/libs/smarty/Smarty.class.php';
     //Overwrite remoteaddr
     $_SERVER['REMOTE_ADDR'] = $this->config['remoteaddr'];
     //INIT REGISTRY VARIABLE - MAIN STORAGE OF APPLICATION
     $registry = \Litpi\Registry::getInstance();
     $request = \Litpi\Request::createFromGlobals();
     $response = new \Litpi\Response();
     $session = new \Litpi\Session();
     $registry->set('request', $request);
     $registry->set('response', $response);
     $registry->set('session', $session);
     require_once \Codeception\Configuration::projectDir() . 'src/includes/conf.php';
     require_once \Codeception\Configuration::projectDir() . 'src/includes/config.php';
     require_once \Codeception\Configuration::projectDir() . 'src/includes/setting.php';
     $registry->set('conf', $conf);
     $registry->set('setting', $setting);
     $registry->set('https', PROTOCOL == 'https' ? true : false);
     require_once \Codeception\Configuration::projectDir() . 'src/includes/permission.php';
     $registry->set('groupPermisson', $groupPermisson);
     require_once \Codeception\Configuration::projectDir() . 'src/includes/rewriterule.php';
     require_once \Codeception\Configuration::projectDir() . 'src/includes/startup.php';
     $this->registry = $registry;
     $this->client = new \Codeception\Lib\Connector\LitpiConnectorHelper();
     $this->client->setRegistry($this->registry);
 }
Example #2
0
<?php

namespace Litpi;

require 'includes/autoload.php';
require 'includes/classmap.php';
require 'Vendor/autoload.php';
spl_autoload_register('autoloadlitpi');
include 'libs/smarty/Smarty.class.php';
//INIT REGISTRY VARIABLE - MAIN STORAGE OF APPLICATION
$registry = Registry::getInstance();
$request = \Litpi\Request::createFromGlobals();
$response = new \Litpi\Response();
$session = new \Litpi\Session();
$registry->set('request', $request);
$registry->set('response', $response);
$registry->set('session', $session);
require 'includes/conf.php';
require 'includes/config.php';
require 'includes/setting.php';
$registry->set('conf', $conf);
$registry->set('setting', $setting);
$registry->set('https', PROTOCOL == 'https' ? true : false);
require 'includes/permission.php';
$registry->set('groupPermisson', $groupPermisson);
require 'includes/rewriterule.php';
require 'includes/startup.php';
include 'libs/pqp/classes/PhpQuickProfiler.php';
$myDosDetector = new DosDetector();
$myDosDetector->run($conf['rooturl'] . 'accessdeny.html');
if ($request->query->has('xprofiler')) {