2.0 modular refactoring.

This commit is contained in:
Taylor Otwell
2011-08-18 23:23:57 -05:00
parent 4569ebec46
commit d9f2ba84c9
18 changed files with 180 additions and 73 deletions

View File

@@ -9,7 +9,6 @@ define('EXT', '.php');
// Define the core framework paths.
// --------------------------------------------------------------
define('BASE_PATH', realpath(str_replace('laravel', '', $system)).'/');
define('CONFIG_PATH', realpath($config).'/');
define('MODULE_PATH', realpath($modules).'/');
define('PACKAGE_PATH', realpath($packages).'/');
define('PUBLIC_PATH', realpath($public).'/');
@@ -22,16 +21,13 @@ unset($system, $config, $modules, $packages, $public, $storage);
// Define various other framework paths.
// --------------------------------------------------------------
define('CACHE_PATH', STORAGE_PATH.'cache/');
define('CONFIG_PATH', SYS_PATH.'config/');
define('DATABASE_PATH', STORAGE_PATH.'db/');
define('LANG_PATH', SYS_PATH.'lang/');
define('SCRIPT_PATH', PUBLIC_PATH.'js/');
define('SESSION_PATH', STORAGE_PATH.'sessions/');
define('STYLE_PATH', PUBLIC_PATH.'css/');
// --------------------------------------------------------------
// Define the default module.
// --------------------------------------------------------------
define('DEFAULT_MODULE', 'application');
// --------------------------------------------------------------
// Load the classes used by the auto-loader.
// --------------------------------------------------------------
@@ -40,13 +36,23 @@ require SYS_PATH.'config'.EXT;
require SYS_PATH.'module'.EXT;
require SYS_PATH.'arr'.EXT;
// --------------------------------------------------------------
// Define the default module.
// --------------------------------------------------------------
define('DEFAULT_MODULE', 'application');
// --------------------------------------------------------------
// Register the active modules.
// --------------------------------------------------------------
Module::$modules = $active;
Module::$modules = array_merge(array('application' => 'application'), $active);
unset($active);
// --------------------------------------------------------------
// Define the default module path.
// --------------------------------------------------------------
define('DEFAULT_MODULE_PATH', Module::path(DEFAULT_MODULE));
// --------------------------------------------------------------
// Register the auto-loader.
// --------------------------------------------------------------
@@ -142,6 +148,11 @@ define('ACTIVE_MODULE', (array_key_exists($segments[0], Module::$modules)) ? $se
// --------------------------------------------------------------
define('ACTIVE_MODULE_PATH', Module::path(ACTIVE_MODULE));
// --------------------------------------------------------------
// Register the filters for the default module.
// --------------------------------------------------------------
Routing\Filter::register(require DEFAULT_MODULE_PATH.'filters'.EXT);
// --------------------------------------------------------------
// Register the filters for the active module.
// --------------------------------------------------------------