From 62471a1fa84e616b67c947aaf87fe73fbf63ed1d Mon Sep 17 00:00:00 2001 From: josuesantos93 Date: Fri, 15 Feb 2013 02:39:55 -0200 Subject: [PATCH 1/6] Gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) mode change 100755 => 100644 .gitignore diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 index 410d053..f638a99 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ Storage/* !Storage/Log vendor composer.lock +/nbproject/private/ \ No newline at end of file From 6bb7ac0732d59b691db010e13e8215e8cd3a427b Mon Sep 17 00:00:00 2001 From: josuesantos93 Date: Fri, 15 Feb 2013 02:44:00 -0200 Subject: [PATCH 2/6] Directories tab --- Bootstrap.php | 4 ++-- Common.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) mode change 100755 => 100644 Bootstrap.php mode change 100755 => 100644 Common.php diff --git a/Bootstrap.php b/Bootstrap.php old mode 100755 new mode 100644 index d8d439f..367d115 --- a/Bootstrap.php +++ b/Bootstrap.php @@ -22,7 +22,7 @@ define('EXT', '.php'); // Directory separator (Unix-Style works on all OS) -define('DS', '/'); +define('DS', DIRECTORY_SEPARATOR); // Absolute path to the system folder define('SP', realpath(__DIR__). DS); @@ -37,7 +37,7 @@ // The current site path define('PATH', parse_url(getenv('REQUEST_URI'), PHP_URL_PATH)); -require(SP . 'vendor/autoload' . EXT); +require(SP . 'vendor' . DS . 'autoload' . EXT); // Include common system functions require(SP . 'Common' . EXT); diff --git a/Common.php b/Common.php old mode 100755 new mode 100644 index 519d5e9..87907b9 --- a/Common.php +++ b/Common.php @@ -66,7 +66,7 @@ function config($file = 'Config', $clear = FALSE) if(empty($configs[$file])) { //$configs[$file] = new \Micro\Config($file); - require(SP . 'Config/' . $file . EXT); + require(SP . 'Config' . DS . $file . EXT); $configs[$file] = (object) $config; //print dump($configs); } From 2f9aad0b5fa507cf09b4741bd5f0d507b4e7f57b Mon Sep 17 00:00:00 2001 From: josuesantos93 Date: Fri, 15 Feb 2013 03:31:39 -0200 Subject: [PATCH 3/6] Debug display for layout --- Class/MyController.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) mode change 100755 => 100644 Class/MyController.php diff --git a/Class/MyController.php b/Class/MyController.php old mode 100755 new mode 100644 index 37d2458..d7261cf --- a/Class/MyController.php +++ b/Class/MyController.php @@ -64,15 +64,12 @@ public function send() headers_sent() OR header('Content-Type: text/html; charset=utf-8'); $layout = new \Micro\View($this->template); + + if(config()->debug_mode) + $this->debug = new \Micro\View('System/Debug'); + $layout->set((array) $this); print $layout; - - $layout = NULL; - - if(config()->debug_mode) - { - print new \Micro\View('System/Debug'); - } } } From 8e6b2afc88e819b9bb6f507808ba40f1854598b8 Mon Sep 17 00:00:00 2001 From: josuesantos93 Date: Fri, 15 Feb 2013 04:19:01 -0200 Subject: [PATCH 4/6] Setting path to URI --- Public/index.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) mode change 100755 => 100644 Public/index.php diff --git a/Public/index.php b/Public/index.php old mode 100755 new mode 100644 index 8d90818..c0044c7 --- a/Public/index.php +++ b/Public/index.php @@ -14,6 +14,12 @@ // Include bootstrap require('../Bootstrap.php'); +//Define prefix URI sub-floder +define('PREFIX_URI', NULL); + +//Replace uri path +$path = str_ireplace(PREFIX_URI, '', PATH); + try { // Anything else before we start? @@ -23,7 +29,7 @@ $dispatch = new \Micro\Dispatch(config('Route')->routes); // Run controller based on URL path and HTTP request method - $controller = $dispatch->controller(PATH, getenv('REQUEST_METHOD')); + $controller = $dispatch->controller($path, getenv('REQUEST_METHOD')); // Send the controller response $controller->send(); From 57fa928b148b7e5814d705adac618df3cf2dbd38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Silva=20Santos?= Date: Fri, 15 Feb 2013 04:47:04 -0200 Subject: [PATCH 5/6] Update Class/MyController.php --- Class/MyController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Class/MyController.php b/Class/MyController.php index d7261cf..27dbdf2 100644 --- a/Class/MyController.php +++ b/Class/MyController.php @@ -65,8 +65,8 @@ public function send() $layout = new \Micro\View($this->template); - if(config()->debug_mode) - $this->debug = new \Micro\View('System/Debug'); + if(config()->debug_mode) + $this->debug = new \Micro\View('System/Debug'); $layout->set((array) $this); print $layout; From 40f4c2d0e48c04a1f4d588f6aec09075f2b5400a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Silva=20Santos?= Date: Fri, 15 Feb 2013 04:47:29 -0200 Subject: [PATCH 6/6] Update .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index f638a99..410d053 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,3 @@ Storage/* !Storage/Log vendor composer.lock -/nbproject/private/ \ No newline at end of file