Example #1
0
 /**
  * @param string $type The type of init to load, possible values: backend, backend_ajax, backend_cronjob, backend_js
  */
 public function __construct($type)
 {
     $allowedTypes = array('api');
     $type = (string) $type;
     // check if this is a valid type
     if (!in_array($type, $allowedTypes)) {
         exit('Invalid init-type');
     }
     // set type
     $this->type = $type;
     // register the autoloader
     spl_autoload_register(array('APIInit', 'autoLoader'));
     // set some ini-options
     ini_set('memory_limit', '64M');
     // set a default timezone if no one was set by PHP.ini
     if (ini_get('date.timezone') == '') {
         date_default_timezone_set('Europe/Brussels');
     }
     /**
      * At first we enable the error reporting. Later on it will be disabled based on the
      * value of SPOON_DEBUG, but for now it's required to see possible errors while trying
      * to include the globals file(s).
      */
     error_reporting(E_ALL | E_STRICT);
     ini_set('display_errors', 'On');
     $this->requireGlobals();
     $this->definePaths();
     $this->setIncludePath();
     $this->setDebugging();
     // get spoon
     require_once 'spoon/spoon.php';
     $this->requireAPIClasses();
     SpoonFilter::disableMagicQuotes();
     $this->initSession();
 }
Example #2
0
 /**
  * Default constructor
  *
  * @return	void
  * @param	string $type	The type of init to load, possible values are: frontend, frontend_ajax, frontend_js.
  */
 public function __construct($type)
 {
     // init vars
     $allowedTypes = array('frontend', 'frontend_ajax', 'frontend_js');
     $type = (string) $type;
     // check if this is a valid type
     if (!in_array($type, $allowedTypes)) {
         exit('Invalid init-type');
     }
     // set type
     $this->type = $type;
     // register the autoloader
     spl_autoload_register(array('FrontendInit', 'autoLoader'));
     // set some ini-options
     ini_set('pcre.backtrack_limit', 999999999);
     ini_set('pcre.recursion_limit', 999999999);
     ini_set('memory_limit', '64M');
     // set a default timezone if no one was set by PHP.ini
     if (ini_get('date.timezone') == '') {
         date_default_timezone_set('Europe/Brussels');
     }
     /**
      * At first we enable the error reporting. Later on it will be disabled based on the
      * value of SPOON_DEBUG, but for now it's required to see possible errors while trying
      * to include the globals file(s).
      */
     error_reporting(E_ALL | E_STRICT);
     ini_set('display_errors', 'On');
     // require globals
     $this->requireGlobals();
     // get last modified time for globals
     $lastModifiedTime = @filemtime(PATH_LIBRARY . '/globals.php');
     // reset lastmodified time if needed (SPOON_DEBUG is enabled or we don't get a decent timestamp)
     if ($lastModifiedTime === false || SPOON_DEBUG) {
         $lastModifiedTime = time();
     }
     // define as a constant
     define('LAST_MODIFIED_TIME', $lastModifiedTime);
     // define constants
     $this->definePaths();
     $this->defineURLs();
     // set include path
     $this->setIncludePath();
     // set debugging
     $this->setDebugging();
     // require spoon
     require_once 'spoon/spoon.php';
     // require frontend-classes
     $this->requireFrontendClasses();
     // disable magic quotes
     SpoonFilter::disableMagicQuotes();
 }
Example #3
0
 /**
  * @param string $type The type of init to load, possible values: Backend, BackendAjax, BackendCronjob
  */
 public function initialize($type)
 {
     $type = (string) $type;
     // check if this is a valid type
     if (!in_array($type, $this->allowedTypes)) {
         throw new InvalidInitTypeException($type, $this->allowedTypes);
     }
     // set type
     $this->type = $type;
     // set a default timezone if no one was set by PHP.ini
     if (ini_get('date.timezone') == '') {
         date_default_timezone_set('Europe/Brussels');
     }
     \SpoonFilter::disableMagicQuotes();
     $this->initSession();
 }
Example #4
0
 /**
  * @param string $type The type of init to load, possible values: Backend, BackendAjax, BackendCronjob
  */
 public function initialize($type)
 {
     $type = (string) $type;
     // check if this is a valid type
     if (!in_array($type, $this->allowedTypes)) {
         exit('Invalid init-type');
     }
     // set type
     $this->type = $type;
     // set a default timezone if no one was set by PHP.ini
     if (ini_get('date.timezone') == '') {
         date_default_timezone_set('Europe/Brussels');
     }
     $this->definePaths();
     $this->setDebugging();
     \SpoonFilter::disableMagicQuotes();
     $this->initSession();
 }
Example #5
0
 /**
  * Default constructor
  *
  * @return	void
  * @param	string $type	The type of init to load, possible values are: backend, backend_ajax, backend_cronjob, backend_js.
  */
 public function __construct($type)
 {
     // init vars
     $allowedTypes = array('backend', 'backend_direct', 'backend_ajax', 'backend_js', 'backend_cronjob');
     $type = (string) $type;
     // check if this is a valid type
     if (!in_array($type, $allowedTypes)) {
         exit('Invalid init-type');
     }
     // set type
     $this->type = $type;
     // register the autoloader
     spl_autoload_register(array('BackendInit', 'autoLoader'));
     // set some ini-options
     ini_set('pcre.backtrack_limit', 999999999);
     ini_set('pcre.recursion_limit', 999999999);
     ini_set('memory_limit', '64M');
     // set a default timezone if no one was set by PHP.ini
     if (ini_get('date.timezone') == '') {
         date_default_timezone_set('Europe/Brussels');
     }
     /**
      * At first we enable the error reporting. Later on it will be disabled based on the
      * value of SPOON_DEBUG, but for now it's required to see possible errors while trying
      * to include the globals file(s).
      */
     error_reporting(E_ALL | E_STRICT);
     ini_set('display_errors', 'On');
     // require globals
     $this->requireGlobals();
     // define constants
     $this->definePaths();
     $this->defineURLs();
     // set include path
     $this->setIncludePath();
     // set debugging
     $this->setDebugging();
     // require spoon
     require_once 'spoon/spoon.php';
     // require backend-classes
     $this->requireBackendClasses();
     // disable magic quotes
     SpoonFilter::disableMagicQuotes();
 }
Example #6
0
 /**
  * @param string $type The type of init to load, possible values are: frontend, frontend_ajax, frontend_js.
  */
 public function initialize($type)
 {
     parent::initialize($type);
     \SpoonFilter::disableMagicQuotes();
 }
Example #7
0
 /**
  * @param string $type The type of init to load, possible values are: frontend, frontend_ajax, frontend_js.
  */
 public function initialize($type)
 {
     parent::initialize($type);
     $this->requireFrontendClasses();
     \SpoonFilter::disableMagicQuotes();
 }