Example #1
0
 /**
  * Logger class constructor, create the system.log file in the 
  * directory set in the config file.
  */
 public function __construct()
 {
     $this->_folder = Application::loadConfig('log_path');
     if (!is_readable($this->_folder . DS . $this->_file)) {
         file_put_contents($this->_folder . DS . $this->_file, '');
     }
 }
Example #2
0
 /**
  * Allow to the app to join data with the views
  * @param type $traverse
  */
 public function nexus($traverse)
 {
     $instance =& Controller::getInstance();
     foreach (get_object_vars($instance) as $_sl_key => $_sl_var) {
         if (!isset($this->buffer)) {
             $this->{$_sl_key} =& $instance->{$_sl_key};
         }
     }
     ob_start();
     if (isset($traverse['vars'])) {
         foreach ($traverse['vars'] as $key => $value) {
             ${$key} = $value;
         }
     }
     if (!@(include VIEWS_PATH . $traverse['views'] . ".php")) {
         echo "Error loading " . $traverse['views'] . " view";
     }
     $instance->buffer .= ob_get_clean();
     if (Application::loadConfig('compress') == 1) {
         $search = array('/\\>[^\\S ]+/s', '/[^\\S ]+\\</s', '/(\\s)+/s');
         $replace = array('>', '<', '\\1');
         $instance->buffer = preg_replace($search, $replace, $instance->buffer);
     }
 }
Example #3
0
 /**
  * Configure if the offline state
  */
 public function configure()
 {
     if (Application::loadConfig('offline') == 1) {
         $this->_path = $this->_routes['GET']['default_offline'];
     }
 }
Example #4
0
 /**
  * Set the default language
  */
 public function __construct()
 {
     $this->default = Application::loadConfig('language');
 }
Example #5
0
<?php

/**
 * Bootstrap File for including necessary config files and autoloader.
 * Also will be used as phpunit bootsrap
 *
 * @author Mikhail Lantukh <*****@*****.**>
 */
define('APP_PATH', __DIR__);
include_once __DIR__ . '/../src/Loader.php';
\Kernel\Router\Router::getInstance()->load(include 'routes.php');
Application::loadConfig(include 'config.php');
Example #6
0
 /**
  * Constructor class
  */
 public function __construct()
 {
     $this->enable = Application::loadConfig('cache');
     $this->_folder = Application::loadConfig('cache_path');
     $this->_cachetime = Application::loadConfig('cache_time');
 }