Beispiel #1
0
 /**
  * [configure description]
  * @param  array  $params [description]
  * @return [type]         [description]
  */
 public static function configure(array $params)
 {
     extract($params);
     /**
      * Setting the default date timezone
      */
     date_default_timezone_set($timezone);
     /**
      * Setting the default charset encoding
      */
     mb_internal_encoding($charset);
     ini_set('default_charset', $charset);
     define('URL', $url);
     /**
      * Determing that the $web_path is a real directory
      * @var string $web_path
      */
     if (is_dir($web_path)) {
         if (realpath($web_path) !== false) {
             define('WEBPATH', (isset($_SERVER['HTTPS']) ? 'https://' : 'http://') . getenv('HTTP_HOST') . '/' . $web_path . '/');
         }
     } else {
         if (!is_dir($web_path)) {
             Handler::handler(E_USER_ERROR, 'The ' . $web_path . ' is not a valid directory', 'index.php', 146);
         }
     }
 }
Beispiel #2
0
    }
} else {
    if (!is_dir($system_path)) {
        Handler::handler(E_USER_ERROR, 'The ' . $system_path . ' is not a valid directory', 'index.php', 146);
    }
}
/**
 * Determing that the $app_path is a real directory
 * @var string $app_path
 */
if (is_dir($app_path)) {
    if (realpath($app_path) !== false) {
        define('APPPATH', BASEPATH . $app_path . '/');
    }
} else {
    if (!is_dir($app_path)) {
        Handler::handler(E_USER_ERROR, 'The ' . $app_path . ' is not a valid directory', 'index.php', 138);
    }
}
/**
 * Loading our main kernel file
 * ----------------------------
 */
require_once SYSPATH . '/core/Core.php';
use Smooth\Core\Smooth;
/**
 * Initializing the configuration and running the Smooth framework
 * ----------------------------
 */
$smooth = new Smooth();
$smooth->run();