Example #1
0
 public static function init()
 {
     define('RT_START_TIME', time());
     // framework start time
     require_once 'sfYaml/sfYaml.php';
     // start session support
     session_start();
     // load config file
     self::loadConfig();
     self::loadModel();
     //load routes file
     self::loadRoute();
     // register view classes
     self::registerViewClasses();
     // Load helpers
     $helpers = rtConfig::get('default_helpers', array());
     foreach ($helpers as $helper) {
         UseHelper($helper);
     }
 }
Example #2
0
File: Mf.php Project: reeze/mf-php
 public static function init()
 {
     define('MF_START_TIME', time());
     // framework start time
     define('VIEWS_DIR', APP_DIR . DS . 'views');
     //include helpers
     require_once 'util/mfUtils.class.php';
     if (!APP_DIR) {
         throw new MfException('Application path havn\'t set yet');
     }
     if (!defined('MF_ENV')) {
         define('MF_EVN', 'dev');
     }
     // default env
     // start session support
     session_start();
     // We have to explict require auto load class here
     require_once MF_CORE_DIR . '/autoload/mfAutoloader.class.php';
     mfAutoLoader::initPath();
     require_once 'sfYaml/sfYaml.php';
     // load config file
     self::loadConfig();
     self::loadModel();
     // register view classes
     self::registerViewClasses();
     $config_path = ROOT_DIR . DS . 'config';
     $env_file = $config_path . DS . 'env' . DS . MF_ENV . '.php';
     if (!file_exists($env_file)) {
         throw new MfException("Missing env file: {$env_file}");
     }
     // use default helpers: url, view
     UseHelper("Url", 'View', 'Asset');
     // include env config file
     require_once $env_file;
     // add controller class path
     mfAutoLoader::addPath(APP_DIR . DS . 'controllers');
     mfAutoLoader::addPath(APP_DIR . DS . 'components');
     mfAutoLoader::addPath(APP_DIR . DS . 'models');
     mfAutoLoader::addPath(APP_DIR . DS . 'models' . DS . 'generated');
 }