Exemple #1
0
 public static function bootstrap($approot = null)
 {
     static $done = 0;
     if ($done) {
         return;
     }
     $done = 1;
     foreach ((array) xenon::config('framework.preload') as $preload) {
         class_exists($preload, true);
     }
     $dm = (int) xenon::config('framework.debuglevel');
     if ($dm == 0) {
         setenv("DEBUG=0");
     }
     if ($dm >= 1) {
         setenv("DEBUG=1");
     }
     if ($dm >= 2) {
         setenv("DEBUG_VERBOSE=1");
     }
     $path = getenv("CHERRY_LIB");
     require_once $path . '/lib/bootstrap.php';
     if (!$approot) {
         $approot = getcwd();
     } else {
         $approot = realpath($approot);
     }
     \Cherry\Base\PathResolver::getInstance()->setAppPath($approot);
     define("XENON_FWAPI", '\\xenon\\frameworks\\cherryphp');
 }
Exemple #2
0
 /**
  *
  *
  *
  *
  */
 public function loadView($view)
 {
     $path = PathResolver::getInstance()->getPath("{APP}/views/{$view}");
     require $path;
 }