Little fix. Now Cli Routes are enabled.
This commit is contained in:
@@ -22,13 +22,17 @@ class RouteCollection{
|
||||
private static function newObj(){
|
||||
if (!isset(self::$_route_collection)) {
|
||||
self::$_route_collection = new RouteCollection();
|
||||
if(php_sapi_name() == "cli"){
|
||||
self::$_route_collection->_uri = isset( $_SERVER['argv'][1] ) ? '/'. $_SERVER['argv'][1] : '/';
|
||||
}else{
|
||||
self::$_route_collection->_uri = isset( $_GET['uri'] ) ? '/'. $_GET['uri'] : '/';
|
||||
}
|
||||
self::$_route_collection->define_verb();
|
||||
}
|
||||
return self::$_route_collection;
|
||||
}
|
||||
|
||||
public function getInstance(){
|
||||
public static function getInstance(){
|
||||
if (!isset(self::$_route_collection)) {
|
||||
return self::newObj();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user