-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDevmo.php
More file actions
executable file
·27 lines (27 loc) · 844 Bytes
/
Copy pathDevmo.php
File metadata and controls
executable file
·27 lines (27 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
// set framework constants
if (!defined('DEVMO_PATH'))
define('DEVMO_PATH',preg_replace('=^(.+)/[^/]+$=','\1',__FILE__));
// require core classes
require_once DEVMO_PATH.'/devmo/Core.php';
// uses
use \devmo\Core;
use \devmo\Config;
// class
class Devmo extends \devmo\Object {
private static $init = false;
private static function init () {
Config::sortNamespacePathMap();
self::$init = true;
}
public static function run ($controller=null, $args=null) {
if (!self::$init)
self::init();
return Core::execute(($controller ? Core::formatPath($controller,'controllers') : null),$args)->getRoot();
}
}
// set default configs
Config::init();
Config::addNamespacePathMapping('devmo',DEVMO_PATH,false);
Config::setRequestBase(Devmo::getValue('SCRIPT_NAME',$_SERVER));
Config::setRequest(Devmo::getValue('PATH_INFO',$_SERVER));