diff --git a/sys/core/Controller.php b/Meta/Base/Controller.php old mode 100755 new mode 100644 similarity index 58% rename from sys/core/Controller.php rename to Meta/Base/Controller.php index 16e5874..9159eea --- a/sys/core/Controller.php +++ b/Meta/Base/Controller.php @@ -1,25 +1,23 @@ page = new Page(); } - $this->load_model('meta\data_model'); - $db = \miniMVC\db::get_instance(); + + $this->data_model = new Data_Model(); + + $db = \Meta\Base\db::get_instance(); $this->page->queries =& $db->queries; } // -------------------------------------------------------------------------- - /** - * Function for loading a model into the current class - * - * @param string $file - * @param array $args - * @return void - */ - public function load_model($file, $args=array()) - { - $segments = explode('\\', $file); - $file_name = end($segments); - - // The module is set via the router - $path = MM_APP_PATH . "models/{$file_name}.php"; - - if (is_file($path)) - { - require_once($path); - } - - if ( ! empty($args)) - { - - $this->$file_name = new $file($args); - } - else - { - $this->$file_name = new $file; - } - } - - // -------------------------------------------------------------------------- - /** * Function for loading a view * diff --git a/sys/core/Model.php b/Meta/Base/Model.php old mode 100755 new mode 100644 similarity index 69% rename from sys/core/Model.php rename to Meta/Base/Model.php index d3778ee..08e629e --- a/sys/core/Model.php +++ b/Meta/Base/Model.php @@ -1,25 +1,22 @@ errorInfo(); } - + list($code, $driver_code, $message) = $error; // Contain the content for buffering diff --git a/app/controllers/category.php b/Meta/Controller/Category.php old mode 100755 new mode 100644 similarity index 90% rename from app/controllers/category.php rename to Meta/Controller/Category.php index 64fdea1..ef79831 --- a/app/controllers/category.php +++ b/Meta/Controller/Category.php @@ -13,20 +13,14 @@ // -------------------------------------------------------------------------- +namespace Meta\Controller; + /** * Category controller * * @package meta */ -class category extends \miniMVC\Controller { - - /** - * Initialize the Controller - */ - public function __construct() - { - parent::__construct(); - } +class Category extends \Meta\Base\Controller { /** * Returns the sections / editing options for a category @@ -79,4 +73,4 @@ class category extends \miniMVC\Controller { } } -// End of genre.php \ No newline at end of file +// End of category.php \ No newline at end of file diff --git a/app/controllers/genre.php b/Meta/Controller/Genre.php old mode 100755 new mode 100644 similarity index 98% rename from app/controllers/genre.php rename to Meta/Controller/Genre.php index 776d4a0..ef06591 --- a/app/controllers/genre.php +++ b/Meta/Controller/Genre.php @@ -13,12 +13,14 @@ // -------------------------------------------------------------------------- +namespace Meta\Controller; + /** * Genre controller * * @package meta */ -class genre extends \miniMVC\Controller { +class Genre extends \Meta\Base\Controller { /** * Default controller method diff --git a/app/controllers/section.php b/Meta/Controller/Section.php old mode 100755 new mode 100644 similarity index 91% rename from app/controllers/section.php rename to Meta/Controller/Section.php index 1b6d1c1..b38fb47 --- a/app/controllers/section.php +++ b/Meta/Controller/Section.php @@ -13,20 +13,14 @@ // -------------------------------------------------------------------------- +namespace Meta\Controller; + /** * Section Controller * * @package meta */ -class section extends \miniMVC\Controller { - - /** - * Constructor - */ - public function __construct() - { - parent::__construct(); - } +class Section extends \Meta\Base\Controller { /** * Default controller method diff --git a/app/models/data_model.php b/Meta/Model/Data.php old mode 100755 new mode 100644 similarity index 98% rename from app/models/data_model.php rename to Meta/Model/Data.php index 8f64e2e..b5af021 --- a/app/models/data_model.php +++ b/Meta/Model/Data.php @@ -13,16 +13,13 @@ // -------------------------------------------------------------------------- -namespace meta; - -use \miniMVC\db; +namespace Meta\Model; +use \Meta\Base\db; /** - * Main Model for database interaction - * - * @package meta + * Main Model for DB interaction */ -class data_model extends \miniMVC\Model { +class Data extends \Meta\Base\Model { /** * Reference to database connection @@ -695,7 +692,5 @@ class data_model extends \miniMVC\Model { } } - } - -// End of data_model.php \ No newline at end of file +// End of data.php \ No newline at end of file diff --git a/app/config/config.php b/Meta/config/config.php old mode 100755 new mode 100644 similarity index 97% rename from app/config/config.php rename to Meta/config/config.php index 5cafe37..2133064 --- a/app/config/config.php +++ b/Meta/config/config.php @@ -42,7 +42,7 @@ define('BASE_URL', '//' . $_SERVER['HTTP_HOST'] . '/'); | slash. | */ -define('BASE_PATH', 'meta/'); +define('BASE_PATH', ''); /* |-------------------------------------------------------------------------- @@ -52,7 +52,7 @@ define('BASE_PATH', 'meta/'); | This determines whether "index.php" is in generated urls | */ -define('URL_INDEX_FILE', BASE_PATH . 'index.php/'); +define('URL_INDEX_FILE', BASE_PATH . ''); /* |-------------------------------------------------------------------------- diff --git a/app/config/routes.php b/Meta/config/routes.php old mode 100755 new mode 100644 similarity index 100% rename from app/config/routes.php rename to Meta/config/routes.php diff --git a/app/views/category_detail.php b/Meta/views/category_detail.php old mode 100755 new mode 100644 similarity index 78% rename from app/views/category_detail.php rename to Meta/views/category_detail.php index f3f8118..24c5a6d --- a/app/views/category_detail.php +++ b/Meta/views/category_detail.php @@ -1,8 +1,8 @@
-