From e817a477690183b8df2bf02183c478b24c8ea6ff Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 14 May 2012 14:35:57 -0400 Subject: [PATCH] Miscellaneous improvements --- app/{ => views}/errors/error_404.php | 0 app/{ => views}/errors/error_db.php | 0 app/{ => views}/errors/error_general.php | 0 .../errors/error_php_exception.php | 0 assets/css.php | 4 +- assets/js.php | 6 +- docs/classes/DB.html | 2 +- docs/classes/DB_PDO.html | 2 +- docs/classes/DB_Reg.html | 2 +- docs/classes/DB_SQL.html | 2 +- docs/classes/DB_Util.html | 2 +- docs/classes/Firebird.html | 2 +- docs/classes/Firebird_Result.html | 2 +- docs/classes/Firebird_SQL.html | 2 +- docs/classes/Firebird_Util.html | 2 +- docs/classes/MM.html | 2 +- docs/classes/MM_Controller.html | 2 +- docs/classes/MM_Model.html | 2 +- docs/classes/MM_Output.html | 2 +- docs/classes/MM_Page.html | 2 +- docs/classes/MM_Session.html | 2 +- docs/classes/MySQL.html | 2 +- docs/classes/MySQL_SQL.html | 2 +- docs/classes/MySQL_Util.html | 2 +- docs/classes/ODBC.html | 2 +- docs/classes/ODBC_SQL.html | 2 +- docs/classes/ODBC_Util.html | 2 +- docs/classes/PgSQL.html | 2 +- docs/classes/PgSQL_SQL.html | 2 +- docs/classes/PgSQL_Util.html | 2 +- docs/classes/Query_Builder.html | 2 +- docs/classes/SQLite.html | 2 +- docs/classes/SQLite_SQL.html | 2 +- docs/classes/SQLite_Util.html | 2 +- docs/classes/Settings.html | 2 +- docs/classes/Welcome.html | 2 +- docs/classes/Welcome_Model.html | 2 +- docs/classes/miniMVC.html | 2 +- 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 | 8 +- docs/packages/.html | 2 +- docs/packages/Default.html | 9 +- docs/packages/Query.Drivers.html | 2 +- docs/packages/Query.Helper Classes.html | 2 +- docs/packages/Query.Query.html | 2 +- docs/packages/Query.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 | 96 ++++++++++--------- sys/common.php | 6 +- sys/core/controller.php | 4 +- sys/core/db.php | 10 +- sys/core/miniMVC.php | 22 ++--- sys/core/output.php | 6 +- sys/core/page.php | 22 ++--- sys/libraries/session.php | 12 ++- tests/dbTest.php | 28 ------ 63 files changed, 160 insertions(+), 165 deletions(-) rename app/{ => views}/errors/error_404.php (100%) rename app/{ => views}/errors/error_db.php (100%) rename app/{ => views}/errors/error_general.php (100%) rename app/{ => views}/errors/error_php_exception.php (100%) delete mode 100644 tests/dbTest.php diff --git a/app/errors/error_404.php b/app/views/errors/error_404.php similarity index 100% rename from app/errors/error_404.php rename to app/views/errors/error_404.php diff --git a/app/errors/error_db.php b/app/views/errors/error_db.php similarity index 100% rename from app/errors/error_db.php rename to app/views/errors/error_db.php diff --git a/app/errors/error_general.php b/app/views/errors/error_general.php similarity index 100% rename from app/errors/error_general.php rename to app/views/errors/error_general.php diff --git a/app/errors/error_php_exception.php b/app/views/errors/error_php_exception.php similarity index 100% rename from app/errors/error_php_exception.php rename to app/views/errors/error_php_exception.php diff --git a/assets/css.php b/assets/css.php index 22c0668..f66a381 100755 --- a/assets/css.php +++ b/assets/css.php @@ -84,11 +84,11 @@ while($i < $pia_len) }; $css = ''; -$modified = array(); +$modified = []; if (isset($groups[$_GET['g']])) { - foreach($groups[$_GET['g']] as $file) + foreach($groups[$_GET['g']] as &$file) { $new_file = $css_root.$file; $css .= file_get_contents($new_file); diff --git a/assets/js.php b/assets/js.php index 12b7e16..2e0d61a 100755 --- a/assets/js.php +++ b/assets/js.php @@ -45,7 +45,7 @@ function get_files() $js = ''; - foreach($groups[$_GET['g']] as $file) + foreach($groups[$_GET['g']] as &$file) { $new_file = realpath($js_root.$file); $js .= file_get_contents($new_file); @@ -95,7 +95,7 @@ while($i < $pia_len) }; $js = ''; -$modified = array(); +$modified = []; // -------------------------------------------------------------------------- @@ -104,7 +104,7 @@ if (isset($groups[$_GET['g']])) { $cache_file = $js_root.'cache/'.$_GET['g']; - foreach($groups[$_GET['g']] as $file) + foreach($groups[$_GET['g']] as &$file) { $new_file = realpath($js_root.$file); $modified[] = filemtime($new_file); diff --git a/docs/classes/DB.html b/docs/classes/DB.html index 5e6e321..657fb6b 100644 --- a/docs/classes/DB.html +++ b/docs/classes/DB.html @@ -1585,7 +1585,7 @@ for complex select queries
+ generated on 2012-05-14T14:35:13-04:00.
diff --git a/docs/classes/DB_PDO.html b/docs/classes/DB_PDO.html index cab3cbb..9b46bd5 100644 --- a/docs/classes/DB_PDO.html +++ b/docs/classes/DB_PDO.html @@ -708,7 +708,7 @@ the connection/database
+ generated on 2012-05-14T14:35:12-04:00.
diff --git a/docs/classes/DB_Reg.html b/docs/classes/DB_Reg.html index 58bd6a0..7d3d3d6 100644 --- a/docs/classes/DB_Reg.html +++ b/docs/classes/DB_Reg.html @@ -154,7 +154,7 @@ and organizes database connections

+ generated on 2012-05-14T14:35:12-04:00.
diff --git a/docs/classes/DB_SQL.html b/docs/classes/DB_SQL.html index f5c5492..7e78039 100644 --- a/docs/classes/DB_SQL.html +++ b/docs/classes/DB_SQL.html @@ -300,7 +300,7 @@ specified table
+ generated on 2012-05-14T14:35:12-04:00.
diff --git a/docs/classes/DB_Util.html b/docs/classes/DB_Util.html index 001c8f5..c4ca088 100644 --- a/docs/classes/DB_Util.html +++ b/docs/classes/DB_Util.html @@ -211,7 +211,7 @@
+ generated on 2012-05-14T14:35:12-04:00.
diff --git a/docs/classes/Firebird.html b/docs/classes/Firebird.html index 80b9821..a6ee92a 100644 --- a/docs/classes/Firebird.html +++ b/docs/classes/Firebird.html @@ -870,7 +870,7 @@ the last query executed
+ generated on 2012-05-14T14:35:13-04:00.
diff --git a/docs/classes/Firebird_Result.html b/docs/classes/Firebird_Result.html index f35b663..db56305 100644 --- a/docs/classes/Firebird_Result.html +++ b/docs/classes/Firebird_Result.html @@ -506,7 +506,7 @@ the query
+ generated on 2012-05-14T14:35:12-04:00.
diff --git a/docs/classes/Firebird_SQL.html b/docs/classes/Firebird_SQL.html index c004da2..4a83093 100644 --- a/docs/classes/Firebird_SQL.html +++ b/docs/classes/Firebird_SQL.html @@ -310,7 +310,7 @@
+ generated on 2012-05-14T14:35:12-04:00.
diff --git a/docs/classes/Firebird_Util.html b/docs/classes/Firebird_Util.html index 481f3d9..62c0905 100644 --- a/docs/classes/Firebird_Util.html +++ b/docs/classes/Firebird_Util.html @@ -214,7 +214,7 @@
+ generated on 2012-05-14T14:35:13-04:00.
diff --git a/docs/classes/MM.html b/docs/classes/MM.html index 80755c3..4f010d6 100644 --- a/docs/classes/MM.html +++ b/docs/classes/MM.html @@ -436,7 +436,7 @@ dynamic methods
+ generated on 2012-05-14T14:35:13-04:00.
diff --git a/docs/classes/MM_Controller.html b/docs/classes/MM_Controller.html index 5de85e1..b2f5054 100644 --- a/docs/classes/MM_Controller.html +++ b/docs/classes/MM_Controller.html @@ -762,7 +762,7 @@
+ generated on 2012-05-14T14:35:13-04:00.
diff --git a/docs/classes/MM_Model.html b/docs/classes/MM_Model.html index c073a5c..4253cf2 100644 --- a/docs/classes/MM_Model.html +++ b/docs/classes/MM_Model.html @@ -726,7 +726,7 @@
+ generated on 2012-05-14T14:35:13-04:00.
diff --git a/docs/classes/MM_Output.html b/docs/classes/MM_Output.html index 3562934..84c7fb0 100644 --- a/docs/classes/MM_Output.html +++ b/docs/classes/MM_Output.html @@ -642,7 +642,7 @@ Used for outputing HTML
+ generated on 2012-05-14T14:35:13-04:00.
diff --git a/docs/classes/MM_Page.html b/docs/classes/MM_Page.html index 8e4d99b..f7628c8 100644 --- a/docs/classes/MM_Page.html +++ b/docs/classes/MM_Page.html @@ -974,7 +974,7 @@ supports

+ generated on 2012-05-14T14:35:13-04:00.
diff --git a/docs/classes/MM_Session.html b/docs/classes/MM_Session.html index 708a7b0..593fc58 100644 --- a/docs/classes/MM_Session.html +++ b/docs/classes/MM_Session.html @@ -146,7 +146,7 @@
+ generated on 2012-05-14T14:35:13-04:00.
diff --git a/docs/classes/MySQL.html b/docs/classes/MySQL.html index d233094..fe9d2f9 100644 --- a/docs/classes/MySQL.html +++ b/docs/classes/MySQL.html @@ -906,7 +906,7 @@ the connection/database
+ generated on 2012-05-14T14:35:12-04:00.
diff --git a/docs/classes/MySQL_SQL.html b/docs/classes/MySQL_SQL.html index bfd9531..987a216 100644 --- a/docs/classes/MySQL_SQL.html +++ b/docs/classes/MySQL_SQL.html @@ -315,7 +315,7 @@
+ generated on 2012-05-14T14:35:12-04:00.
diff --git a/docs/classes/MySQL_Util.html b/docs/classes/MySQL_Util.html index 736079f..0090be8 100644 --- a/docs/classes/MySQL_Util.html +++ b/docs/classes/MySQL_Util.html @@ -210,7 +210,7 @@
+ generated on 2012-05-14T14:35:12-04:00.
diff --git a/docs/classes/ODBC.html b/docs/classes/ODBC.html index 6925f15..836f01f 100644 --- a/docs/classes/ODBC.html +++ b/docs/classes/ODBC.html @@ -908,7 +908,7 @@ the connection/database
+ generated on 2012-05-14T14:35:12-04:00.
diff --git a/docs/classes/ODBC_SQL.html b/docs/classes/ODBC_SQL.html index 14af1d8..fd19b0b 100644 --- a/docs/classes/ODBC_SQL.html +++ b/docs/classes/ODBC_SQL.html @@ -310,7 +310,7 @@
+ generated on 2012-05-14T14:35:12-04:00.
diff --git a/docs/classes/ODBC_Util.html b/docs/classes/ODBC_Util.html index d80f42f..2b84c0e 100644 --- a/docs/classes/ODBC_Util.html +++ b/docs/classes/ODBC_Util.html @@ -205,7 +205,7 @@
+ generated on 2012-05-14T14:35:12-04:00.
diff --git a/docs/classes/PgSQL.html b/docs/classes/PgSQL.html index b8c2d15..a615a75 100644 --- a/docs/classes/PgSQL.html +++ b/docs/classes/PgSQL.html @@ -908,7 +908,7 @@ the connection/database
+ generated on 2012-05-14T14:35:12-04:00.
diff --git a/docs/classes/PgSQL_SQL.html b/docs/classes/PgSQL_SQL.html index feda8d6..27f6123 100644 --- a/docs/classes/PgSQL_SQL.html +++ b/docs/classes/PgSQL_SQL.html @@ -310,7 +310,7 @@
+ generated on 2012-05-14T14:35:12-04:00.
diff --git a/docs/classes/PgSQL_Util.html b/docs/classes/PgSQL_Util.html index 7d89fb1..0ff5418 100644 --- a/docs/classes/PgSQL_Util.html +++ b/docs/classes/PgSQL_Util.html @@ -210,7 +210,7 @@
+ generated on 2012-05-14T14:35:12-04:00.
diff --git a/docs/classes/Query_Builder.html b/docs/classes/Query_Builder.html index 751a0d4..854c0f8 100644 --- a/docs/classes/Query_Builder.html +++ b/docs/classes/Query_Builder.html @@ -1224,7 +1224,7 @@ for complex select queries
+ generated on 2012-05-14T14:35:12-04:00.
diff --git a/docs/classes/SQLite.html b/docs/classes/SQLite.html index a2945b0..51342e4 100644 --- a/docs/classes/SQLite.html +++ b/docs/classes/SQLite.html @@ -923,7 +923,7 @@ method if the database does not support 'TRUNCATE';
+ generated on 2012-05-14T14:35:12-04:00.
diff --git a/docs/classes/SQLite_SQL.html b/docs/classes/SQLite_SQL.html index fbe22bd..ebd8170 100644 --- a/docs/classes/SQLite_SQL.html +++ b/docs/classes/SQLite_SQL.html @@ -310,7 +310,7 @@
+ generated on 2012-05-14T14:35:12-04:00.
diff --git a/docs/classes/SQLite_Util.html b/docs/classes/SQLite_Util.html index 7c70983..a2faa3a 100644 --- a/docs/classes/SQLite_Util.html +++ b/docs/classes/SQLite_Util.html @@ -210,7 +210,7 @@
+ generated on 2012-05-14T14:35:12-04:00.
diff --git a/docs/classes/Settings.html b/docs/classes/Settings.html index 6df3349..ae61737 100644 --- a/docs/classes/Settings.html +++ b/docs/classes/Settings.html @@ -246,7 +246,7 @@ directly - the settings should be safe!
+ generated on 2012-05-14T14:35:12-04:00.
diff --git a/docs/classes/Welcome.html b/docs/classes/Welcome.html index c33a5b7..1c07920 100644 --- a/docs/classes/Welcome.html +++ b/docs/classes/Welcome.html @@ -904,7 +904,7 @@
+ generated on 2012-05-14T14:35:13-04:00.
diff --git a/docs/classes/Welcome_Model.html b/docs/classes/Welcome_Model.html index 621c5a5..298369b 100644 --- a/docs/classes/Welcome_Model.html +++ b/docs/classes/Welcome_Model.html @@ -844,7 +844,7 @@
+ generated on 2012-05-14T14:35:13-04:00.
diff --git a/docs/classes/miniMVC.html b/docs/classes/miniMVC.html index 6f67354..d2e7827 100644 --- a/docs/classes/miniMVC.html +++ b/docs/classes/miniMVC.html @@ -613,7 +613,7 @@
+ generated on 2012-05-14T14:35:13-04:00.
diff --git a/docs/deprecated.html b/docs/deprecated.html index 0dcaaab..01e780e 100644 --- a/docs/deprecated.html +++ b/docs/deprecated.html @@ -69,7 +69,7 @@
+ generated on 2012-05-14T14:35:13-04:00.
diff --git a/docs/errors.html b/docs/errors.html index e8795e3..4a255d9 100644 --- a/docs/errors.html +++ b/docs/errors.html @@ -109,7 +109,7 @@
+ generated on 2012-05-14T14:35:13-04:00.
diff --git a/docs/graph_class.html b/docs/graph_class.html index 3acc308..79bb30a 100644 --- a/docs/graph_class.html +++ b/docs/graph_class.html @@ -66,7 +66,7 @@
+ generated on 2012-05-14T14:35:13-04:00.
diff --git a/docs/index.html b/docs/index.html index 72e80c4..a7fa4ae 100644 --- a/docs/index.html +++ b/docs/index.html @@ -84,7 +84,7 @@
+ generated on 2012-05-14T14:35:12-04:00.
diff --git a/docs/markers.html b/docs/markers.html index aebb8ee..0099b24 100644 --- a/docs/markers.html +++ b/docs/markers.html @@ -183,7 +183,7 @@
+ generated on 2012-05-14T14:35:13-04:00.
diff --git a/docs/namespaces/default.html b/docs/namespaces/default.html index 78a02a5..51979a9 100644 --- a/docs/namespaces/default.html +++ b/docs/namespaces/default.html @@ -698,13 +698,19 @@ instantiates the specific db driver

+ 
+

Define a session id to namespace sessions

+
Unknown 
+
+

+
+ generated on 2012-05-14T14:35:12-04:00.
diff --git a/docs/packages/.html b/docs/packages/.html index 2b39caa..962b809 100644 --- a/docs/packages/.html +++ b/docs/packages/.html @@ -69,7 +69,7 @@
+ generated on 2012-05-14T14:35:12-04:00.
diff --git a/docs/packages/Default.html b/docs/packages/Default.html index ea51adc..8014bf4 100644 --- a/docs/packages/Default.html +++ b/docs/packages/Default.html @@ -79,6 +79,7 @@
  • STATIC_LIB_PATH
    STATIC_LIB_PATH
  • STYLE_PATH
    STYLE_PATH
  • URL_INDEX_FILE
    URL_INDEX_FILE
  • +
  • Define a session id to namespace sessions
    Unknown
  • @@ -181,13 +182,19 @@

    + 
    +

    Define a session id to namespace sessions

    +
    Unknown 
    +
    +

    +
    + generated on 2012-05-14T14:35:12-04:00.
    diff --git a/docs/packages/Query.Drivers.html b/docs/packages/Query.Drivers.html index fd4cdd1..a281995 100644 --- a/docs/packages/Query.Drivers.html +++ b/docs/packages/Query.Drivers.html @@ -213,7 +213,7 @@ data-fetching methods

    + generated on 2012-05-14T14:35:12-04:00.
    diff --git a/docs/packages/Query.Helper Classes.html b/docs/packages/Query.Helper Classes.html index 7d76cfe..295c989 100644 --- a/docs/packages/Query.Helper Classes.html +++ b/docs/packages/Query.Helper Classes.html @@ -99,7 +99,7 @@
    + generated on 2012-05-14T14:35:12-04:00.
    diff --git a/docs/packages/Query.Query.html b/docs/packages/Query.Query.html index 4b88ede..917c71d 100644 --- a/docs/packages/Query.Query.html +++ b/docs/packages/Query.Query.html @@ -117,7 +117,7 @@ instantiates the specific db driver

    + generated on 2012-05-14T14:35:12-04:00.
    diff --git a/docs/packages/Query.html b/docs/packages/Query.html index fae4b62..081332c 100644 --- a/docs/packages/Query.html +++ b/docs/packages/Query.html @@ -318,7 +318,7 @@ instantiates the specific db driver

    + generated on 2012-05-14T14:35:12-04:00.
    diff --git a/docs/packages/miniMVC.App.html b/docs/packages/miniMVC.App.html index efb47fd..e1954ba 100644 --- a/docs/packages/miniMVC.App.html +++ b/docs/packages/miniMVC.App.html @@ -141,7 +141,7 @@
    + generated on 2012-05-14T14:35:12-04:00.
    diff --git a/docs/packages/miniMVC.Libraries.html b/docs/packages/miniMVC.Libraries.html index f2f424b..86a14a0 100644 --- a/docs/packages/miniMVC.Libraries.html +++ b/docs/packages/miniMVC.Libraries.html @@ -91,7 +91,7 @@
    + generated on 2012-05-14T14:35:12-04:00.
    diff --git a/docs/packages/miniMVC.System.html b/docs/packages/miniMVC.System.html index 5cbffce..b4301fa 100644 --- a/docs/packages/miniMVC.System.html +++ b/docs/packages/miniMVC.System.html @@ -139,7 +139,7 @@
    + generated on 2012-05-14T14:35:12-04:00.
    diff --git a/docs/packages/miniMVC.html b/docs/packages/miniMVC.html index c7b26e8..bea599b 100644 --- a/docs/packages/miniMVC.html +++ b/docs/packages/miniMVC.html @@ -490,7 +490,7 @@ display them cleanly
    + generated on 2012-05-14T14:35:12-04:00.
    diff --git a/docs/structure.xml b/docs/structure.xml index a77f72a..18b1402 100644 --- a/docs/structure.xml +++ b/docs/structure.xml @@ -5468,7 +5468,7 @@ the last query executed]]> - + Convention-based micro-framework for PHP

    ]]>
    @@ -5490,7 +5490,7 @@ the last query executed]]>
    $instance - + @@ -5522,7 +5522,7 @@ the last query executed]]> $options - + array @@ -5538,7 +5538,7 @@ the last query executed]]> $params - + array @@ -5565,7 +5565,7 @@ the last query executed]]> $params - + @@ -5582,7 +5582,7 @@ the last query executed]]>
    - + Convention-based micro-framework for PHP

    ]]>
    @@ -5620,7 +5620,7 @@ the last query executed]]> $params - + @@ -5650,7 +5650,7 @@ the last query executed]]>
    $params - + @@ -5693,7 +5693,7 @@ the last query executed]]> $members - + @@ -5721,7 +5721,7 @@ dynamic methods]]> $params - + @@ -5759,7 +5759,7 @@ dynamic methods]]> $members - + @@ -5783,7 +5783,7 @@ dynamic methods]]> $args - + @@ -5840,7 +5840,7 @@ dynamic methods]]>
    - + Convention-based micro-framework for PHP

    ]]>
    @@ -6345,7 +6345,7 @@ supports

    ]]> $data - + @@ -6407,7 +6407,7 @@ page.

    ]]>
    - + Convention-based micro-framework for PHP

    ]]>
    @@ -6472,7 +6472,7 @@ page.

    ]]> $args - + @@ -6502,7 +6502,7 @@ page.

    ]]> $data - + array @@ -6513,7 +6513,7 @@ page.

    ]]>
    - + Convention-based micro-framework for PHP

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

    ]]>
    @@ -6653,95 +6653,103 @@ Used for outputing HTML]]>
    - + + Unknown + + + + + + + MM_Session \MM_Session - + - - + + - + $sess - + - + array - + __construct function - + - + __set function - + - + string - + mixed - + void - + $key - + $val - + __get function - + - + string - + mixed - + $key - + destroy function - + - + void
    - + Convention-based micro-framework for PHP

    ]]>
    diff --git a/sys/common.php b/sys/common.php index 99a9d05..70ab714 100644 --- a/sys/common.php +++ b/sys/common.php @@ -117,7 +117,7 @@ function on_exception($exception) // Contain the content for buffering ob_start(); - include(MM_APP_PATH.'/errors/error_php_exception.php'); + include(MM_APP_PATH.'/views/errors/error_php_exception.php'); $buffer = ob_get_contents(); ob_end_clean(); @@ -159,7 +159,7 @@ function show_404() // This is passed to the error template $message = '404 Not Found'; - include(MM_APP_PATH.'/errors/error_404.php'); + include(MM_APP_PATH.'/views/errors/error_404.php'); $buffer = ob_get_contents(); ob_end_clean(); @@ -184,7 +184,7 @@ function show_error($message, $status_code=null) // Contain the content for buffering ob_start(); - include(MM_APP_PATH.'/errors/error_general.php'); + include(MM_APP_PATH.'/views/errors/error_general.php'); $buffer = ob_get_contents(); ob_end_clean(); diff --git a/sys/core/controller.php b/sys/core/controller.php index 989bee8..fd96cac 100644 --- a/sys/core/controller.php +++ b/sys/core/controller.php @@ -50,7 +50,7 @@ class MM_Controller extends miniMVC { * @param array $args * @return void */ - public function load_model($file, $args=array()) + public function load_model($file, $args=[]) { // The module is set via the router $module = strtolower(MM_MOD); @@ -82,7 +82,7 @@ class MM_Controller extends miniMVC { * @param bool $return * @return mixed */ - public function load_view($file, array $data=array(), $return=FALSE) + public function load_view($file, array $data=[], $return=FALSE) { $path = ""; diff --git a/sys/core/db.php b/sys/core/db.php index 1da7cbd..4381bc2 100644 --- a/sys/core/db.php +++ b/sys/core/db.php @@ -28,7 +28,7 @@ class DB extends Query_Builder { * * @var array */ - private static $instance = array(); + private static $instance = []; /** * Indexed singleton method @@ -37,7 +37,7 @@ class DB extends Query_Builder { * @param array $options * @return DB */ - public static function &get_instance($dbname="default", array $options=array()) + public static function &get_instance($dbname="default", array $options=[]) { if ( ! isset(self::$instance[$dbname])) { @@ -67,7 +67,7 @@ class DB extends Query_Builder { * * @param array $params */ - function __construct(array $params=array()) + function __construct(array $params=[]) { // Let's try connecting now! parent::__construct($params); @@ -83,7 +83,7 @@ class DB extends Query_Builder { * @param array $params * @return mixed */ - public function __call($name, $params=array()) + public function __call($name, $params=[]) { return parent::__call($name, $params); } @@ -97,7 +97,7 @@ class DB extends Query_Builder { */ public function get_last_error() { - $error = array(); + $error = []; if (isset($this->statement)) { diff --git a/sys/core/miniMVC.php b/sys/core/miniMVC.php index a870bb6..f93f933 100644 --- a/sys/core/miniMVC.php +++ b/sys/core/miniMVC.php @@ -29,10 +29,10 @@ trait JSObject { * @param array $members * @return void */ - public function __construct($members = array()) + public function __construct($members = []) { // Add the passed parameters to the object - foreach($members as $name => $value) + foreach($members as $name => &$value) { $this->$name = $value; } @@ -46,7 +46,7 @@ trait JSObject { * @param string $name * @param array $params */ - public function __call($name, $params = array()) + public function __call($name, $params = []) { if(is_callable($this->$name)) { @@ -68,7 +68,7 @@ trait JSObject { { $args = func_get_args(); $method = ( ! empty($args)) ? $args[0] : "print_r"; - $data = (isset($args[1])) ? $args[1] : array(); + $data = (isset($args[1])) ? $args[1] : []; if(empty($data)) { @@ -111,7 +111,7 @@ trait JSObject { * * @param array $args */ - public static function __invoke($args = array()) + public static function __invoke($args = []) { $class = __CLASS__; return new $class($args); @@ -148,7 +148,7 @@ trait Singleton { * @param array $params * @return self */ - public static function __invoke($params = array()) + public static function __invoke($params = []) { return self::get_instance($params); } @@ -202,12 +202,12 @@ class MM extends ArrayObject { * * @param array */ - public function __construct($members = array()) + public function __construct($members = []) { parent::__construct($members); // Add the passed parameters to the object - foreach($members as $name => $value) + foreach($members as $name => &$value) { $this->$name = $value; } @@ -223,7 +223,7 @@ class MM extends ArrayObject { * @param array $params * @return mixed */ - public function __call($name, $params = array()) + public function __call($name, $params = []) { // Allow array operations on the object if (substr($name, 0, 6) === 'array_' && is_callable($name)) @@ -265,7 +265,7 @@ class miniMVC extends MM { * * @param array $members */ - public function __construct($members = array()) + public function __construct($members = []) { // Allow the class to be used like an array parent::__construct($members); @@ -281,7 +281,7 @@ class miniMVC extends MM { * @param string $name * @param array $args */ - public function __call($name, $args = array()) + public function __call($name, $args = []) { // Allow array operations on the object if (substr($name, 0, 6) === 'array_' && is_callable($name)) diff --git a/sys/core/output.php b/sys/core/output.php index 8a6e926..79f0c4e 100644 --- a/sys/core/output.php +++ b/sys/core/output.php @@ -42,7 +42,7 @@ class MM_Output extends MM { public function __construct() { $this->buffer = ""; - $this->headers = array(); + $this->headers = []; } /** @@ -131,7 +131,7 @@ class MM_Output extends MM { public function flush_headers() { // Set headers - foreach($this->headers as $key => $val) + foreach($this->headers as $key => &$val) { if ( ! isset($val)) { @@ -144,7 +144,7 @@ class MM_Output extends MM { } // Empty headers - $this->headers = array(); + $this->headers = []; } } // End of Output.php \ No newline at end of file diff --git a/sys/core/page.php b/sys/core/page.php index e8cba24..8336a72 100644 --- a/sys/core/page.php +++ b/sys/core/page.php @@ -199,11 +199,11 @@ class MM_Page extends MM { */ public function set_css_group($group) { - $link = array( + $link = [ 'href' => STYLE_PATH . $group, 'rel' => 'stylesheet', 'type' => 'text/css' - ); + ]; $this->css .= $this->_link_tag($link); return $this; @@ -305,12 +305,12 @@ class MM_Page extends MM { $css_file = $name; } - $this->css_tags .= $this->_link_tag(array( + $this->css_tags .= $this->_link_tag([ 'rel' => 'stylesheet', 'type' => 'text/css', 'media' => $media, 'href' => $css_file, - )); + ]); return $this; } @@ -339,15 +339,15 @@ class MM_Page extends MM { */ public function build_header($html5 = TRUE) { - $data = array(); + $data = []; //Set Meta Tags $this->meta = ($html5 == TRUE) ? ''. $this->meta - : $this->_meta(array( + : $this->_meta([ 'http-equiv' => 'Content-Type', 'content' => 'text/html; charset=utf-8', - )) . $this->meta; + ]) . $this->meta; $data['meta'] = $this->meta; @@ -397,7 +397,7 @@ class MM_Page extends MM { */ public function build_footer() { - $data = array(); + $data = []; $data['foot_js'] = ($this->foot_js != "") ? $this->foot_js : ''; @@ -470,7 +470,7 @@ class MM_Page extends MM { * @param string $view * @param array $data */ - function render($view, $data=array()) + function render($view, $data=[]) { $this->build_header(); $this->mm->load_view($view, $data); @@ -506,7 +506,7 @@ class MM_Page extends MM { { $string = " $v) + foreach($params as $k => &$v) { $string .= $k.'="'.$v.'" '; } @@ -528,7 +528,7 @@ class MM_Page extends MM { { $string = " $v) + foreach($params as $k => &$v) { $string .= $k . '="'.$v.'" '; } diff --git a/sys/libraries/session.php b/sys/libraries/session.php index 920f793..aaed19c 100644 --- a/sys/libraries/session.php +++ b/sys/libraries/session.php @@ -12,6 +12,11 @@ */ // -------------------------------------------------------------------------- +/** + * Define a session id to namespace sessions + */ +define(SESS_ID, 'MM_SESSION'); +// -------------------------------------------------------------------------- /** * Class to improve handling of PHP sessions @@ -42,13 +47,10 @@ class MM_Session{ protected function __construct() { session_start(); - - // Create a unique session id to prevent collisions - $sess_id = uniqid(uniqid(), TRUE); // Save a reference to the session for later access - $_SESSION[$sess_id] = []; - $this->sess =& $_SESSION[$sess_id]; + $_SESSION[SESS_ID] = (isset($_SESSION[SESS_ID]) ?: []; + $this->sess =& $_SESSION[SESS_ID]; } // -------------------------------------------------------------------------- diff --git a/tests/dbTest.php b/tests/dbTest.php deleted file mode 100644 index c306c28..0000000 --- a/tests/dbTest.php +++ /dev/null @@ -1,28 +0,0 @@ -