Overview

Namespaces

  • codemania
    • core
      • exception
    • library
      • database
        • drivers
  • None
  • PHP

Classes

  • Cookie
  • Core
  • Crypt
  • HTTP
  • Request
  • Route
  • Security
  • Singleton
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download
 1: <?php
 2: namespace codemania\core;
 3: //use codemania\core\Config;
 4: defined('CM_ROOT') or exit('Заперт доступа!');
 5: class Core {
 6:     static public $_debug = false;
 7:     static public $config;
 8:     static public function init(array $options) {
 9:         if (isset($options['debug'])) {
10:             self::$_debug = (bool)$options['debug'];
11:         }
12:         self::_set_handlers();
13: //        if ( ! self::$config instanceof Config) {
14: //            self::$config = new Config;
15: //        }
16:     }
17:     static public function check_php_version($phpversion) {
18:         if ( ! (version_compare(PHP_VERSION, $phpversion) >= 0)) {
19:             throw new \LogicException('Данная библиотека требует версию PHP >= '. $phpversion .'!');
20:         }
21:     }
22:     static private function _set_handlers() {
23:         if (self::$_debug) {
24:             set_exception_handler(array(
25:                 'codemania\core\exception\ExceptionHandler',
26:                 'init',
27:             ));
28:         }
29:     }
30: }
CodeMania Framework API documentation generated by ApiGen 2.8.0