From a8cbfb0cbe2d52e39a29e50492f0f3b3d60a4db9 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Tue, 15 May 2012 16:53:10 -0400 Subject: [PATCH] miscellaneous tweaks --- docs/classes/DB.html | 2 +- docs/classes/MM.html | 2 +- docs/classes/MM_Controller.html | 6 ++-- docs/classes/MM_Data_Store.html | 2 +- docs/classes/MM_Model.html | 17 +++++++--- docs/classes/MM_Output.html | 2 +- docs/classes/MM_Page.html | 2 +- docs/classes/MM_Session.html | 2 +- docs/classes/Welcome.html | 6 ++-- docs/classes/Welcome_Model.html | 6 ++-- docs/classes/miniMVC.html | 6 ++-- docs/deprecated.html | 2 +- docs/errors.html | 2 +- docs/graph_class.html | 2 +- docs/index.html | 2 +- docs/markers.html | 2 +- docs/namespaces/default.html | 2 +- docs/packages/.html | 2 +- docs/packages/Default.html | 2 +- docs/packages/miniMVC.App.html | 2 +- docs/packages/miniMVC.Libraries.html | 2 +- docs/packages/miniMVC.System.html | 2 +- docs/packages/miniMVC.html | 2 +- docs/structure.xml | 48 ++++++++++++++++------------ index.php | 2 +- sys/common.php | 10 +++--- sys/core/db.php | 3 +- sys/core/miniMVC.php | 4 +-- sys/core/model.php | 5 +-- sys/core/page.php | 26 +++++++-------- sys/libraries/data_store.php | 2 +- 31 files changed, 101 insertions(+), 76 deletions(-) diff --git a/docs/classes/DB.html b/docs/classes/DB.html index 9d66a27..a1ef97f 100644 --- a/docs/classes/DB.html +++ b/docs/classes/DB.html @@ -159,7 +159,7 @@
+ generated on 2012-05-15T16:52:58-04:00.
diff --git a/docs/classes/MM.html b/docs/classes/MM.html index e164b09..6b7bc4f 100644 --- a/docs/classes/MM.html +++ b/docs/classes/MM.html @@ -433,7 +433,7 @@ dynamic methods
+ generated on 2012-05-15T16:52:58-04:00.
diff --git a/docs/classes/MM_Controller.html b/docs/classes/MM_Controller.html index 13ab78f..a994d56 100644 --- a/docs/classes/MM_Controller.html +++ b/docs/classes/MM_Controller.html @@ -367,7 +367,7 @@

Method to load classes into the singleton

-
load_class(string $name) : void
+
load_class(string $name) : object
Inherited

@@ -380,6 +380,8 @@

$name

string
+

Returns

+
object
@@ -759,7 +761,7 @@
+ generated on 2012-05-15T16:52:58-04:00.
diff --git a/docs/classes/MM_Data_Store.html b/docs/classes/MM_Data_Store.html index 1e4daed..52bc82d 100644 --- a/docs/classes/MM_Data_Store.html +++ b/docs/classes/MM_Data_Store.html @@ -199,7 +199,7 @@ of the singleton
+ generated on 2012-05-15T16:52:58-04:00.
diff --git a/docs/classes/MM_Model.html b/docs/classes/MM_Model.html index 20cd616..536ce09 100644 --- a/docs/classes/MM_Model.html +++ b/docs/classes/MM_Model.html @@ -150,9 +150,16 @@

Initialize the model class

-
__construct() : void
+
__construct(array $args) : void
-

+
+

+

Parameters

+
+

$args

+array +
+

append() @@ -363,7 +370,7 @@

Method to load classes into the singleton

-
load_class(string $name) : void
+
load_class(string $name) : object
Inherited

@@ -376,6 +383,8 @@

$name

string
+

Returns

+
object
@@ -709,7 +718,7 @@
+ generated on 2012-05-15T16:52:58-04:00.
diff --git a/docs/classes/MM_Output.html b/docs/classes/MM_Output.html index cd6baa7..81d4966 100644 --- a/docs/classes/MM_Output.html +++ b/docs/classes/MM_Output.html @@ -639,7 +639,7 @@ Used for outputing HTML
+ generated on 2012-05-15T16:52:58-04:00.
diff --git a/docs/classes/MM_Page.html b/docs/classes/MM_Page.html index 49ed5f8..8937794 100644 --- a/docs/classes/MM_Page.html +++ b/docs/classes/MM_Page.html @@ -971,7 +971,7 @@ supports

+ generated on 2012-05-15T16:52:58-04:00.
diff --git a/docs/classes/MM_Session.html b/docs/classes/MM_Session.html index 76aa76b..b2b1da5 100644 --- a/docs/classes/MM_Session.html +++ b/docs/classes/MM_Session.html @@ -143,7 +143,7 @@
+ generated on 2012-05-15T16:52:58-04:00.
diff --git a/docs/classes/Welcome.html b/docs/classes/Welcome.html index b7081f0..2594ad8 100644 --- a/docs/classes/Welcome.html +++ b/docs/classes/Welcome.html @@ -417,7 +417,7 @@

Method to load classes into the singleton

-
load_class(string $name) : void
+
load_class(string $name) : object
Inherited

@@ -436,6 +436,8 @@

$name

string
+

Returns

+
object
@@ -901,7 +903,7 @@
+ generated on 2012-05-15T16:52:58-04:00.
diff --git a/docs/classes/Welcome_Model.html b/docs/classes/Welcome_Model.html index bf80e7e..773c793 100644 --- a/docs/classes/Welcome_Model.html +++ b/docs/classes/Welcome_Model.html @@ -405,7 +405,7 @@

Method to load classes into the singleton

-
load_class(string $name) : void
+
load_class(string $name) : object
Inherited

@@ -424,6 +424,8 @@

$name

string
+

Returns

+
object
@@ -823,7 +825,7 @@
+ generated on 2012-05-15T16:52:58-04:00.
diff --git a/docs/classes/miniMVC.html b/docs/classes/miniMVC.html index af2b603..e259247 100644 --- a/docs/classes/miniMVC.html +++ b/docs/classes/miniMVC.html @@ -330,7 +330,7 @@

Method to load classes into the singleton

-
load_class(string $name) : void
+
load_class(string $name) : object

@@ -339,6 +339,8 @@

$name

string
+

Returns

+
object
@@ -610,7 +612,7 @@
+ generated on 2012-05-15T16:52:58-04:00.
diff --git a/docs/deprecated.html b/docs/deprecated.html index b61d7b3..d492219 100644 --- a/docs/deprecated.html +++ b/docs/deprecated.html @@ -66,7 +66,7 @@
+ generated on 2012-05-15T16:52:58-04:00.
diff --git a/docs/errors.html b/docs/errors.html index 30c063d..37d2314 100644 --- a/docs/errors.html +++ b/docs/errors.html @@ -84,7 +84,7 @@
+ generated on 2012-05-15T16:52:58-04:00.
diff --git a/docs/graph_class.html b/docs/graph_class.html index 55498d0..983ee85 100644 --- a/docs/graph_class.html +++ b/docs/graph_class.html @@ -63,7 +63,7 @@
+ generated on 2012-05-15T16:52:58-04:00.
diff --git a/docs/index.html b/docs/index.html index aad033c..86ee527 100644 --- a/docs/index.html +++ b/docs/index.html @@ -78,7 +78,7 @@
+ generated on 2012-05-15T16:52:58-04:00.
diff --git a/docs/markers.html b/docs/markers.html index db2ef58..83eb960 100644 --- a/docs/markers.html +++ b/docs/markers.html @@ -68,7 +68,7 @@
+ generated on 2012-05-15T16:52:58-04:00.
diff --git a/docs/namespaces/default.html b/docs/namespaces/default.html index 177f894..66fd140 100644 --- a/docs/namespaces/default.html +++ b/docs/namespaces/default.html @@ -513,7 +513,7 @@ display them cleanly
+ generated on 2012-05-15T16:52:58-04:00.
diff --git a/docs/packages/.html b/docs/packages/.html index 1aa633e..0310f31 100644 --- a/docs/packages/.html +++ b/docs/packages/.html @@ -66,7 +66,7 @@
+ generated on 2012-05-15T16:52:58-04:00.
diff --git a/docs/packages/Default.html b/docs/packages/Default.html index 415ca19..147bea9 100644 --- a/docs/packages/Default.html +++ b/docs/packages/Default.html @@ -177,7 +177,7 @@
+ generated on 2012-05-15T16:52:58-04:00.
diff --git a/docs/packages/miniMVC.App.html b/docs/packages/miniMVC.App.html index 98f3c78..3e2cfde 100644 --- a/docs/packages/miniMVC.App.html +++ b/docs/packages/miniMVC.App.html @@ -138,7 +138,7 @@
+ generated on 2012-05-15T16:52:58-04:00.
diff --git a/docs/packages/miniMVC.Libraries.html b/docs/packages/miniMVC.Libraries.html index d0838f3..7a8613a 100644 --- a/docs/packages/miniMVC.Libraries.html +++ b/docs/packages/miniMVC.Libraries.html @@ -96,7 +96,7 @@
+ generated on 2012-05-15T16:52:58-04:00.
diff --git a/docs/packages/miniMVC.System.html b/docs/packages/miniMVC.System.html index b5db0d7..afcc4e4 100644 --- a/docs/packages/miniMVC.System.html +++ b/docs/packages/miniMVC.System.html @@ -136,7 +136,7 @@
+ generated on 2012-05-15T16:52:58-04:00.
diff --git a/docs/packages/miniMVC.html b/docs/packages/miniMVC.html index 2702e75..1ec758b 100644 --- a/docs/packages/miniMVC.html +++ b/docs/packages/miniMVC.html @@ -494,7 +494,7 @@ display them cleanly
+ generated on 2012-05-15T16:52:58-04:00.
diff --git a/docs/structure.xml b/docs/structure.xml index b6461b4..6ea9eba 100644 --- a/docs/structure.xml +++ b/docs/structure.xml @@ -1,6 +1,6 @@ - + Convention-based micro-framework for PHP

]]>
@@ -20,20 +20,28 @@
- + __construct function + + array + void + + $args + + array +
- + Convention-based micro-framework for PHP

]]>
@@ -107,47 +115,47 @@ array - + __call function - + - + string - + array - + mixed - + $name - + $params - + get_last_error function - + - + string
- + Convention-based micro-framework for PHP

]]>
@@ -361,8 +369,8 @@ dynamic methods]]> string - - void + + object
@@ -405,7 +413,7 @@ dynamic methods]]>
- + Convention-based micro-framework for PHP

]]>
@@ -1208,7 +1216,7 @@ Used for outputing HTML]]>
- + Convention-based micro-framework for PHP

]]>
@@ -1459,7 +1467,7 @@ of the singleton]]>
- + Convention-based micro-framework for PHP

]]>
@@ -1721,7 +1729,7 @@ display them cleanly]]>
- + Convention-based micro-framework for PHP

]]>
diff --git a/index.php b/index.php index bfe86e3..2b07ff2 100644 --- a/index.php +++ b/index.php @@ -31,7 +31,7 @@ if(ENVIRONMENT == 'DEVELOPMENT') { error_reporting(-1); } -else if(EVIRONMENT == 'PRODUCTION') +else if(ENVIRONMENT == 'PRODUCTION') { error_reporting(0); } diff --git a/sys/common.php b/sys/common.php index b9824d0..a6919f2 100644 --- a/sys/common.php +++ b/sys/common.php @@ -178,7 +178,7 @@ function show_error($message, $status_code=null) { if ( ! is_null($status_code)) { - @header("HTTP/1.1 {$status_code}", TRUE, (int)$status_code); + @header("HTTP/1.1 {$status_code}", TRUE, (int) $status_code); } // Contain the content for buffering @@ -241,8 +241,8 @@ function route() $controller = $routes['default_controller']; $func = "index"; $route_set = FALSE; - - // If it isn't the index page + + // If it isn't the index page if ( ! empty($pi) && $pi !== "/") { //Remove trailing slash and begining slash @@ -275,7 +275,7 @@ function route() } // Doesn't match a predefined route? - // Match on module/controller/method, controller/method, or method + // Match on module/controller/method, module/controller, controller/method, or method if ( ! $route_set) { $num_segments = 0; @@ -333,7 +333,7 @@ function route() return call_user_func_array([&$class, $func], []); } - // Function doesn't exist...404 + // Function doesn't exist...404 show_404(); die(); } diff --git a/sys/core/db.php b/sys/core/db.php index 003b42b..f663679 100644 --- a/sys/core/db.php +++ b/sys/core/db.php @@ -67,11 +67,10 @@ class DB extends Query_Builder { * * @param array $params */ - function __construct(array $params=[]) + public function __construct(array $params=[]) { // Let's try connecting now! parent::__construct($params); - } // -------------------------------------------------------------------------- diff --git a/sys/core/miniMVC.php b/sys/core/miniMVC.php index 1b5e66d..0033caa 100644 --- a/sys/core/miniMVC.php +++ b/sys/core/miniMVC.php @@ -313,7 +313,7 @@ class miniMVC extends MM { * Method to load classes into the singleton * * @param string $name - * @return void + * @return object */ public function load_class($name) { @@ -326,7 +326,7 @@ class miniMVC extends MM { // Try system library first, then app library $path = MM_SYS_PATH . "libraries/{$name}.php"; - $name = 'MM_'.$name; + $name = "MM_{$name}"; if ( ! is_file($path)) { diff --git a/sys/core/model.php b/sys/core/model.php index 833cbe1..98639ed 100644 --- a/sys/core/model.php +++ b/sys/core/model.php @@ -24,11 +24,12 @@ class MM_Model extends miniMVC { /** * Initialize the model class * + * @param array $args * @return void */ - public function __construct() + public function __construct(array $args = []) { - parent::__construct(); + parent::__construct($args); } } // End of model.php \ No newline at end of file diff --git a/sys/core/page.php b/sys/core/page.php index 8336a72..72e12c2 100644 --- a/sys/core/page.php +++ b/sys/core/page.php @@ -496,12 +496,12 @@ class MM_Page extends MM { // -------------------------------------------------------------------------- - /** - * Private helper function to generate meta tags - * - * @param array $params - * @return string - */ + /** + * Private helper function to generate meta tags + * + * @param array $params + * @return string + */ private function _meta($params) { $string = "current = new StdClass(); + $this->current = (object)[]; } else {