Skip to content
This repository was archived by the owner on Feb 20, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .gitignore
100755 → 100644
Empty file.
4 changes: 2 additions & 2 deletions Bootstrap.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
11 changes: 4 additions & 7 deletions Class/MyController.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}

}
Expand Down
2 changes: 1 addition & 1 deletion Common.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
8 changes: 7 additions & 1 deletion Public/index.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand All @@ -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();
Expand Down