From a2fa2d917fd8b33a01c62a97e620b9c782fea2e5 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Tue, 1 May 2012 15:22:29 -0400 Subject: [PATCH] Routing fixes. Fix issue #1 --- docs/classes/DB.html | 108 +- docs/classes/DB_PDO.html | 18 +- docs/classes/DB_Reg.html | 2 +- docs/classes/DB_SQL.html | 2 +- docs/classes/DB_Util.html | 2 +- docs/classes/Firebird.html | 22 +- 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 | 9 +- docs/classes/MM_Model.html | 2 +- docs/classes/MM_Output.html | 2 +- docs/classes/MM_Page.html | 2 +- docs/classes/MySQL.html | 22 +- docs/classes/MySQL_SQL.html | 2 +- docs/classes/MySQL_Util.html | 2 +- docs/classes/ODBC.html | 22 +- docs/classes/ODBC_SQL.html | 2 +- docs/classes/ODBC_Util.html | 2 +- docs/classes/PgSQL.html | 22 +- docs/classes/PgSQL_SQL.html | 2 +- docs/classes/PgSQL_Util.html | 2 +- docs/classes/Query_Builder.html | 84 +- docs/classes/SQLite.html | 22 +- docs/classes/SQLite_SQL.html | 2 +- docs/classes/SQLite_Util.html | 2 +- docs/classes/Settings.html | 2 +- docs/classes/Welcome.html | 15 +- 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 | 2 +- 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.System.html | 2 +- docs/packages/miniMVC.html | 8 +- docs/structure.xml | 1209 +++++++++++++---------- sys/Query | 2 +- sys/common.php | 46 +- sys/controller.php | 27 +- 50 files changed, 1054 insertions(+), 658 deletions(-) diff --git a/docs/classes/DB.html b/docs/classes/DB.html index 2add494..94c171e 100644 --- a/docs/classes/DB.html +++ b/docs/classes/DB.html @@ -113,11 +113,13 @@ passed array with key / value pairs
where()
  • WHERE NOT IN (FOO) clause
    where_not_in()
  • String together the sql statements for sending to the db
    _compile()
  • +
  • Simplify building having clauses
    _having()
  • Simplify 'like' methods
    _like()
  • Clear out the class variables, so the next query can be run
    _reset()
  • Method to simplify select_ methods
    _select()
  • Do all the repeditive stuff for where/having type methods
    _where()
  • Simplify where_in methods
    _where_in()
  • +
  • Simplify generating where string
    _where_string()
  • Convenience property for connection management
    $conn_name
  • @@ -781,7 +783,7 @@ prefixed with 'OR NOT'

    Where clause prefixed with "OR"

    -
    or_where(string $field, mixed $val) : \DB
    +
    or_where(string $key, mixed $val) : \DB
    Inherited

    @@ -797,7 +799,7 @@ prefixed with 'OR NOT'

    Parameters

    -

    $field

    +

    $key

    string
    @@ -1200,16 +1202,55 @@ passed array with key / value pairs
    \$string
    -
    -

    Simplify 'like' methods

    -
    _like(string $field, mixed $val, string $pos, string $like, string $conj) 
    +
    +

    Simplify building having clauses

    +
    _having(mixed $key, mixed $val, string $conj) : \DB
    Inherited

    - +
    + + + + + + + + +
    inherited_from\Query_Builder::_having()
    fluentThis method is part of a fluent interface and will return the same instance
    +

    Parameters

    +
    +

    $key

    +mixed +
    +
    +

    $val

    +mixed +
    +
    +

    $conj

    +string +
    +

    Returns

    + +
    +
    +
    +

    Simplify 'like' methods

    +
    _like(string $field, mixed $val, string $pos, string $like, string $conj) : \DB
    +
    Inherited
    +
    +

    + + -
    inherited_from \Query_Builder::_like()
    + + +fluent +This method is part of a fluent interface and will return the same instance + +

    Parameters

    $field

    @@ -1231,11 +1272,13 @@ passed array with key / value pairs

    $conj

    string
    +

    Returns

    +

    Clear out the class variables, so the next query can be run

    -
    _reset() 
    +
    _reset() : void
    Inherited

    @@ -1293,14 +1336,20 @@ passed array with key / value pairs

    Simplify where_in methods

    -
    _where_in(mixed $key, mixed $val, $in, $conj) : void
    +
    _where_in(mixed $key, mixed $val, $in, $conj) : \DB
    Inherited

    - +
    + -
    inherited_from \Query_Builder::_where_in()
    + + +fluent +This method is part of a fluent interface and will return the same instance + +

    Parameters

    $key

    @@ -1316,6 +1365,41 @@ passed array with key / value pairs

    $conj

    string

    +

    Returns

    + +
    +
    +
    +

    Simplify generating where string

    +
    _where_string(mixed $key, mixed $val, string $conj) : \DB
    +
    Inherited
    +
    +

    + + + + + + + + + +
    inherited_from\Query_Builder::_where_string()
    fluentThis method is part of a fluent interface and will return the same instance
    +

    Parameters

    +
    +

    $key

    +mixed +
    +
    +

    $val

    +mixed +
    +
    +

    $conj

    +string +
    +

    Returns

    +

    @@ -1520,7 +1604,7 @@ for complex select queries

    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/DB_PDO.html b/docs/classes/DB_PDO.html index 69d11e6..6a3c342 100644 --- a/docs/classes/DB_PDO.html +++ b/docs/classes/DB_PDO.html @@ -114,6 +114,7 @@ the connection/database
    get_system_tables()
  • Connect to a different database
    switch_db()
  • Empty the passed table
    truncate()
  • +
  • Helper method for quote_ident
    _quote()
  • Method to simplify retreiving db results for meta-data queries
    driver_query()
  • @@ -611,6 +612,21 @@ the connection/database
    +
    +

    Helper method for quote_ident

    +
    _quote(mixed $str) : mixed
    +
    +
    +

    +

    Parameters

    +
    +

    $str

    +mixed +
    +

    Returns

    +
    mixed
    +
    +

    Method to simplify retreiving db results for meta-data queries

    driver_query(string $sql, bool $filtered_index) : mixed
    @@ -663,7 +679,7 @@ the connection/database
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/DB_Reg.html b/docs/classes/DB_Reg.html index 5630c2e..a2ec244 100644 --- a/docs/classes/DB_Reg.html +++ b/docs/classes/DB_Reg.html @@ -152,7 +152,7 @@ and organizes database connections

    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/DB_SQL.html b/docs/classes/DB_SQL.html index 8c2a09b..1cf4890 100644 --- a/docs/classes/DB_SQL.html +++ b/docs/classes/DB_SQL.html @@ -269,7 +269,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/DB_Util.html b/docs/classes/DB_Util.html index 59a9627..5747504 100644 --- a/docs/classes/DB_Util.html +++ b/docs/classes/DB_Util.html @@ -209,7 +209,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/Firebird.html b/docs/classes/Firebird.html index 3eea771..64af4b0 100644 --- a/docs/classes/Firebird.html +++ b/docs/classes/Firebird.html @@ -106,6 +106,7 @@ the connection/database
    get_system_tables()
  • Doesn't apply to Firebird
    switch_db()
  • Empty a database table
    truncate()
  • +
  • Helper method for quote_ident
    _quote()
  • Method to simplify retreiving db results for meta-data queries
    driver_query()
  • @@ -720,6 +721,25 @@ the connection/database +
    +

    Helper method for quote_ident

    +
    _quote(mixed $str) : mixed
    +
    Inherited
    +
    +

    + + + +
    inherited_from\DB_PDO::_quote()
    +

    Parameters

    +
    +

    $str

    +mixed +
    +

    Returns

    +
    mixed
    +
    +

    Method to simplify retreiving db results for meta-data queries

    driver_query(string $sql, bool $filtered_index) : mixed
    @@ -813,7 +833,7 @@ the last query executed
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/Firebird_Result.html b/docs/classes/Firebird_Result.html index 627f3f6..7f131bc 100644 --- a/docs/classes/Firebird_Result.html +++ b/docs/classes/Firebird_Result.html @@ -504,7 +504,7 @@ the query
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/Firebird_SQL.html b/docs/classes/Firebird_SQL.html index 34faa94..62a4149 100644 --- a/docs/classes/Firebird_SQL.html +++ b/docs/classes/Firebird_SQL.html @@ -297,7 +297,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/Firebird_Util.html b/docs/classes/Firebird_Util.html index b9bc7f3..843b517 100644 --- a/docs/classes/Firebird_Util.html +++ b/docs/classes/Firebird_Util.html @@ -212,7 +212,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/MM.html b/docs/classes/MM.html index 673e308..b7fa0f3 100644 --- a/docs/classes/MM.html +++ b/docs/classes/MM.html @@ -434,7 +434,7 @@ dynamic methods
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/MM_Controller.html b/docs/classes/MM_Controller.html index c3cff15..c8a95b7 100644 --- a/docs/classes/MM_Controller.html +++ b/docs/classes/MM_Controller.html @@ -108,6 +108,7 @@
    unserialize()
    +
  • Name of the current module
    $module
  • Reference to output class
    $output
  • Instance of Page class
    $page
  • @@ -738,6 +739,12 @@

     Properties

    + 
    +

    Name of the current module

    +
    $module : string
    +
    +

    +
     

    Reference to output class

    $output : \MM_Output
    @@ -763,7 +770,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/MM_Model.html b/docs/classes/MM_Model.html index 31146be..09e722d 100644 --- a/docs/classes/MM_Model.html +++ b/docs/classes/MM_Model.html @@ -728,7 +728,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/MM_Output.html b/docs/classes/MM_Output.html index f18b19b..9cac4e6 100644 --- a/docs/classes/MM_Output.html +++ b/docs/classes/MM_Output.html @@ -640,7 +640,7 @@ Used for outputing HTML
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/MM_Page.html b/docs/classes/MM_Page.html index 03d931e..c716c7b 100644 --- a/docs/classes/MM_Page.html +++ b/docs/classes/MM_Page.html @@ -972,7 +972,7 @@ supports

    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/MySQL.html b/docs/classes/MySQL.html index 346ef91..1e3d7ba 100644 --- a/docs/classes/MySQL.html +++ b/docs/classes/MySQL.html @@ -114,6 +114,7 @@ the connection/database
    get_system_tables()
  • Connect to a different database
    switch_db()
  • Empty a table
    truncate()
  • +
  • Helper method for quote_ident
    _quote()
  • Method to simplify retreiving db results for meta-data queries
    driver_query()
  • @@ -775,6 +776,25 @@ the connection/database +
    +

    Helper method for quote_ident

    +
    _quote(mixed $str) : mixed
    +
    Inherited
    +
    +

    + + + +
    inherited_from\DB_PDO::_quote()
    +

    Parameters

    +
    +

    $str

    +mixed +
    +

    Returns

    +
    mixed
    +
    +

    Method to simplify retreiving db results for meta-data queries

    driver_query(string $sql, bool $filtered_index) : mixed
    @@ -849,7 +869,7 @@ the connection/database
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/MySQL_SQL.html b/docs/classes/MySQL_SQL.html index 277b76f..1c1d4a0 100644 --- a/docs/classes/MySQL_SQL.html +++ b/docs/classes/MySQL_SQL.html @@ -281,7 +281,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/MySQL_Util.html b/docs/classes/MySQL_Util.html index da8cc4c..b3c6f0b 100644 --- a/docs/classes/MySQL_Util.html +++ b/docs/classes/MySQL_Util.html @@ -208,7 +208,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/ODBC.html b/docs/classes/ODBC.html index 7e68505..06f41a8 100644 --- a/docs/classes/ODBC.html +++ b/docs/classes/ODBC.html @@ -114,6 +114,7 @@ the connection/database
    get_system_tables()
  • Doesn't apply to ODBC
    switch_db()
  • Empty the current database
    truncate()
  • +
  • Helper method for quote_ident
    _quote()
  • Method to simplify retreiving db results for meta-data queries
    driver_query()
  • @@ -777,6 +778,25 @@ the connection/database +
    +

    Helper method for quote_ident

    +
    _quote(mixed $str) : mixed
    +
    Inherited
    +
    +

    + + + +
    inherited_from\DB_PDO::_quote()
    +

    Parameters

    +
    +

    $str

    +mixed +
    +

    Returns

    +
    mixed
    +
    +

    Method to simplify retreiving db results for meta-data queries

    driver_query(string $sql, bool $filtered_index) : mixed
    @@ -851,7 +871,7 @@ the connection/database
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/ODBC_SQL.html b/docs/classes/ODBC_SQL.html index 624fd56..1011d69 100644 --- a/docs/classes/ODBC_SQL.html +++ b/docs/classes/ODBC_SQL.html @@ -281,7 +281,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/ODBC_Util.html b/docs/classes/ODBC_Util.html index eace60b..3be31bf 100644 --- a/docs/classes/ODBC_Util.html +++ b/docs/classes/ODBC_Util.html @@ -203,7 +203,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/PgSQL.html b/docs/classes/PgSQL.html index f4e6ee9..4fd78ee 100644 --- a/docs/classes/PgSQL.html +++ b/docs/classes/PgSQL.html @@ -114,6 +114,7 @@ the connection/database
    get_system_tables()
  • Connect to a different database
    switch_db()
  • Empty a table
    truncate()
  • +
  • Helper method for quote_ident
    _quote()
  • Method to simplify retreiving db results for meta-data queries
    driver_query()
  • @@ -771,6 +772,25 @@ the connection/database +
    +

    Helper method for quote_ident

    +
    _quote(mixed $str) : mixed
    +
    Inherited
    +
    +

    + + + +
    inherited_from\DB_PDO::_quote()
    +

    Parameters

    +
    +

    $str

    +mixed +
    +

    Returns

    +
    mixed
    +
    +

    Method to simplify retreiving db results for meta-data queries

    driver_query(string $sql, bool $filtered_index) : mixed
    @@ -851,7 +871,7 @@ the connection/database
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/PgSQL_SQL.html b/docs/classes/PgSQL_SQL.html index 208c75d..06e8dd5 100644 --- a/docs/classes/PgSQL_SQL.html +++ b/docs/classes/PgSQL_SQL.html @@ -297,7 +297,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/PgSQL_Util.html b/docs/classes/PgSQL_Util.html index 6dfbb58..d25e102 100644 --- a/docs/classes/PgSQL_Util.html +++ b/docs/classes/PgSQL_Util.html @@ -208,7 +208,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/Query_Builder.html b/docs/classes/Query_Builder.html index d1e17a0..febe99e 100644 --- a/docs/classes/Query_Builder.html +++ b/docs/classes/Query_Builder.html @@ -108,11 +108,13 @@ passed array with key / value pairs
    where()
  • WHERE NOT IN (FOO) clause
    where_not_in()
  • String together the sql statements for sending to the db
    _compile()
  • +
  • Simplify building having clauses
    _having()
  • Simplify 'like' methods
    _like()
  • Clear out the class variables, so the next query can be run
    _reset()
  • Method to simplify select_ methods
    _select()
  • Do all the repeditive stuff for where/having type methods
    _where()
  • Simplify where_in methods
    _where_in()
  • +
  • Simplify generating where string
    _where_string()
  • Convenience property for connection management
    $conn_name
  • @@ -619,7 +621,7 @@ prefixed with 'OR NOT'

    Where clause prefixed with "OR"

    -
    or_where(string $field, mixed $val) : \Query_Builder
    +
    or_where(string $key, mixed $val) : \Query_Builder

    @@ -629,7 +631,7 @@ prefixed with 'OR NOT'

    Parameters

    -

    $field

    +

    $key

    string
    @@ -952,12 +954,43 @@ passed array with key / value pairs
    \$string
    -
    -

    Simplify 'like' methods

    -
    _like(string $field, mixed $val, string $pos, string $like, string $conj) 
    +
    +

    Simplify building having clauses

    +
    _having(mixed $key, mixed $val, string $conj) : \Query_Builder

    + + + +
    fluentThis method is part of a fluent interface and will return the same instance
    +

    Parameters

    +
    +

    $key

    +mixed +
    +
    +

    $val

    +mixed +
    +
    +

    $conj

    +string +
    +

    Returns

    + +
    +
    +
    +

    Simplify 'like' methods

    +
    _like(string $field, mixed $val, string $pos, string $like, string $conj) : \Query_Builder
    +
    +
    +

    + + + +
    fluentThis method is part of a fluent interface and will return the same instance

    Parameters

    $field

    @@ -979,11 +1012,13 @@ passed array with key / value pairs

    $conj

    string
    +

    Returns

    +

    Clear out the class variables, so the next query can be run

    -
    _reset() 
    +
    _reset() : void

    @@ -1027,10 +1062,14 @@ passed array with key / value pairs

    Simplify where_in methods

    -
    _where_in(mixed $key, mixed $val, $in, $conj) : void
    +
    _where_in(mixed $key, mixed $val, $in, $conj) : \Query_Builder

    + + + +
    fluentThis method is part of a fluent interface and will return the same instance

    Parameters

    $key

    @@ -1046,6 +1085,35 @@ passed array with key / value pairs

    $conj

    string

    +

    Returns

    + +
    +
    +
    +

    Simplify generating where string

    +
    _where_string(mixed $key, mixed $val, string $conj) : \Query_Builder
    +
    +
    +

    + + + +
    fluentThis method is part of a fluent interface and will return the same instance
    +

    Parameters

    +
    +

    $key

    +mixed +
    +
    +

    $val

    +mixed +
    +
    +

    $conj

    +string +
    +

    Returns

    +

    @@ -1154,7 +1222,7 @@ for complex select queries

    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/SQLite.html b/docs/classes/SQLite.html index 391c4b4..80ea2bc 100644 --- a/docs/classes/SQLite.html +++ b/docs/classes/SQLite.html @@ -114,6 +114,7 @@ method if the database does not support 'TRUNCATE';
    empty_table()Empty a table
    truncate()
  • Unload a database from the current connection
    unload_database()
  • +
  • Helper method for quote_ident
    _quote()
  • Method to simplify retreiving db results for meta-data queries
    driver_query()
  • @@ -792,6 +793,25 @@ method if the database does not support 'TRUNCATE'; +
    +

    Helper method for quote_ident

    +
    _quote(mixed $str) : mixed
    +
    Inherited
    +
    +

    + + + +
    inherited_from\DB_PDO::_quote()
    +

    Parameters

    +
    +

    $str

    +mixed +
    +

    Returns

    +
    mixed
    +
    +

    Method to simplify retreiving db results for meta-data queries

    driver_query(string $sql, bool $filtered_index) : mixed
    @@ -866,7 +886,7 @@ method if the database does not support 'TRUNCATE';
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/SQLite_SQL.html b/docs/classes/SQLite_SQL.html index d10de8f..86138bd 100644 --- a/docs/classes/SQLite_SQL.html +++ b/docs/classes/SQLite_SQL.html @@ -281,7 +281,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/SQLite_Util.html b/docs/classes/SQLite_Util.html index 17ff11f..5f6730b 100644 --- a/docs/classes/SQLite_Util.html +++ b/docs/classes/SQLite_Util.html @@ -208,7 +208,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/Settings.html b/docs/classes/Settings.html index d7bf84b..852d87a 100644 --- a/docs/classes/Settings.html +++ b/docs/classes/Settings.html @@ -244,7 +244,7 @@ directly - the settings should be safe!
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/Welcome.html b/docs/classes/Welcome.html index 052a817..9da3312 100644 --- a/docs/classes/Welcome.html +++ b/docs/classes/Welcome.html @@ -110,6 +110,7 @@
    unserialize()
    +
  • Name of the current module
    $module
  • Reference to output class
    $output
  • Instance of Page class
    $page
  • @@ -868,6 +869,18 @@

     Properties

    + 
    +

    Name of the current module

    +
    $module : string
    +
    Inherited
    +
    +

    + + + +
    inherited_from\MM_Controller::$$module
    +
    +
     

    Reference to output class

    $output : \MM_Output
    @@ -905,7 +918,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/Welcome_Model.html b/docs/classes/Welcome_Model.html index ed5fc61..22e7d11 100644 --- a/docs/classes/Welcome_Model.html +++ b/docs/classes/Welcome_Model.html @@ -846,7 +846,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/classes/miniMVC.html b/docs/classes/miniMVC.html index cb52553..0ce298e 100644 --- a/docs/classes/miniMVC.html +++ b/docs/classes/miniMVC.html @@ -615,7 +615,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/deprecated.html b/docs/deprecated.html index a376717..1dcc3bc 100644 --- a/docs/deprecated.html +++ b/docs/deprecated.html @@ -67,7 +67,7 @@
    + generated on 2012-05-01T15:21:51-04:00.
    diff --git a/docs/errors.html b/docs/errors.html index 1c42f82..737a9ef 100644 --- a/docs/errors.html +++ b/docs/errors.html @@ -106,7 +106,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/graph_class.html b/docs/graph_class.html index 2349ef0..ef5bccf 100644 --- a/docs/graph_class.html +++ b/docs/graph_class.html @@ -64,7 +64,7 @@
    + generated on 2012-05-01T15:21:51-04:00.
    diff --git a/docs/index.html b/docs/index.html index 246203e..38d9a7b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -80,7 +80,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/markers.html b/docs/markers.html index 70d14a1..7923db7 100644 --- a/docs/markers.html +++ b/docs/markers.html @@ -69,7 +69,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/namespaces/default.html b/docs/namespaces/default.html index 0031517..827408f 100644 --- a/docs/namespaces/default.html +++ b/docs/namespaces/default.html @@ -295,13 +295,13 @@ with array_map and glob

    Calls the appropriate module/controller/function based on the url

    -
    route() 
    +
    route() : void

    General 404 function

    -
    show_404() 
    +
    show_404() : void

    @@ -326,7 +326,7 @@ with array_map and glob

    Function to run on script shutdown -used to catch most fatal errors, and display them cleanly

    -
    shutdown() 
    +
    shutdown() : void

    @@ -719,7 +719,7 @@ instantiates the specific db driver

    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/packages/.html b/docs/packages/.html index fc88f66..7f3009a 100644 --- a/docs/packages/.html +++ b/docs/packages/.html @@ -67,7 +67,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/packages/Default.html b/docs/packages/Default.html index bf4a4ba..5ff4316 100644 --- a/docs/packages/Default.html +++ b/docs/packages/Default.html @@ -185,7 +185,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/packages/Query.Drivers.html b/docs/packages/Query.Drivers.html index 4b0dfb5..5acbad9 100644 --- a/docs/packages/Query.Drivers.html +++ b/docs/packages/Query.Drivers.html @@ -211,7 +211,7 @@ data-fetching methods

    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/packages/Query.Helper Classes.html b/docs/packages/Query.Helper Classes.html index ba20165..7ca8f74 100644 --- a/docs/packages/Query.Helper Classes.html +++ b/docs/packages/Query.Helper Classes.html @@ -97,7 +97,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/packages/Query.Query.html b/docs/packages/Query.Query.html index ef905af..5e5f107 100644 --- a/docs/packages/Query.Query.html +++ b/docs/packages/Query.Query.html @@ -115,7 +115,7 @@ instantiates the specific db driver

    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/packages/Query.html b/docs/packages/Query.html index e54afac..7b8c3e5 100644 --- a/docs/packages/Query.html +++ b/docs/packages/Query.html @@ -316,7 +316,7 @@ instantiates the specific db driver

    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/packages/miniMVC.App.html b/docs/packages/miniMVC.App.html index c283c92..b335eaa 100644 --- a/docs/packages/miniMVC.App.html +++ b/docs/packages/miniMVC.App.html @@ -139,7 +139,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/packages/miniMVC.System.html b/docs/packages/miniMVC.System.html index 896ea24..21958e7 100644 --- a/docs/packages/miniMVC.System.html +++ b/docs/packages/miniMVC.System.html @@ -137,7 +137,7 @@
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/packages/miniMVC.html b/docs/packages/miniMVC.html index b9e3554..0a9624a 100644 --- a/docs/packages/miniMVC.html +++ b/docs/packages/miniMVC.html @@ -294,13 +294,13 @@ display them cleanly
    shutdown

    Calls the appropriate module/controller/function based on the url

    -
    route() 
    +
    route() : void

    General 404 function

    -
    show_404() 
    +
    show_404() : void

    @@ -325,7 +325,7 @@ display them cleanly
    shutdown

    Function to run on script shutdown -used to catch most fatal errors, and display them cleanly

    -
    shutdown() 
    +
    shutdown() : void

    @@ -492,7 +492,7 @@ display them cleanly
    + generated on 2012-05-01T15:21:50-04:00.
    diff --git a/docs/structure.xml b/docs/structure.xml index 7f43b76..b56f1c4 100644 --- a/docs/structure.xml +++ b/docs/structure.xml @@ -562,7 +562,7 @@ directly - the settings should be safe!]]> - + Free Query Builder / Database Abstraction Layer

    ]]>
    @@ -788,197 +788,216 @@ directly - the settings should be safe!]]> - - empty_table + + _quote function - - + + - - string + + mixed - + mixed - + + $str + + + + + + empty_table + function + + + + + string + + + mixed + + + $table - + get_schemas function - + - + array - + get_tables function - + - + array - + get_dbs function - + - + array - + get_views function - + - + array - + get_sequences function - + - + array - + get_functions function - + - + array - + get_procedures function - + - + array - + get_triggers function - + - + array - + get_system_tables function - + - + array - + driver_query function - + - + string - + bool - + mixed - + $sql - + $filtered_index - + num_rows function - + - + int - + truncate function - + - + string - + void - + $table - + switch_db function - + - + string - + void - + $name @@ -986,7 +1005,7 @@ the connection/database]]>
    - + Free Query Builder / Database Abstraction Layer

    ]]>
    @@ -1379,7 +1398,7 @@ for complex select queries]]> - + _like function @@ -1400,133 +1419,136 @@ for complex select queries]]> string + + \$this + - + $field - + $val - + $pos - + $like - + $conj - + like function - + - + string - + mixed - + string - + \$this - + $field - + $val - + $pos - + or_like function - + - + string - + mixed - + string - + \$this - + $field - + $val - + $pos - + not_like function - + - + string - + mixed - + string - + \$this - + $field - + $val - + $pos @@ -1567,725 +1589,798 @@ for complex select queries]]> - - having + + _having function - - + + - + mixed - + mixed - + + string + + \$this - + $key - + $val - - - or_having - function - - - - - mixed - - - mixed - - - \$this - - - - $key - - - - - $val - - - - - - _where - function - - - - - mixed - - - mixed - - - array - - - - $key - - - - - $val - - - - - - _where_in - function - - - - - mixed - - - mixed - - - - - void - - - - $key - - - - - $val - - - - - $in - - - - + $conj - + + having + function + + + + + mixed + + + mixed + + + \$this + + + + $key + + + + + $val + + + + + + or_having + function + + + + + mixed + + + mixed + + + \$this + + + + $key + + + + + $val + + + + + + _where + function + + + + + mixed + + + mixed + + + array + + + + $key + + + + + $val + + + + + + _where_string + function + + + + + mixed + + + mixed + + + string + + + \$this + + + + $key + + + + + $val + + + + + $conj + + + + + + _where_in + function + + + + + mixed + + + mixed + + + + + \$this + + + + $key + + + + + $val + + + + + $in + + + + + $conj + + + + + where function - + - + mixed - + mixed - + \$this - + $key - + $val - + or_where function - + - + string - + mixed - + \$this - - $field - - - - - $val - - - - - - where_in - function - - - - - mixed - - - mixed - - - \$this - - - - $field - - - - - $val - - - - - - or_where_in - function - - - - - string - - - mixed - - - \$this - - - - $field - - - - - $val - - - - - - where_not_in - function - - - - - string - - - mixed - - - \$this - - - - $field - - - - - $val - - - - - - or_where_not_in - function - - - - - string - - - mixed - - - \$this - - - - $field - - - - - $val - - - - - - set - function - - - - - mixed - - - mixed - - - \$this - - - + $key - + + $val + + + + + + where_in + function + + + + + mixed + + + mixed + + + \$this + + + + $field + + + + + $val + + + + + + or_where_in + function + + + + + string + + + mixed + + + \$this + + + + $field + + + + + $val + + + + + + where_not_in + function + + + + + string + + + mixed + + + \$this + + + + $field + + + + + $val + + + + + + or_where_not_in + function + + + + + string + + + mixed + + + \$this + + + + $field + + + + + $val + + + + + + set + function + + + + + mixed + + + mixed + + + \$this + + + + $key + + + + $val - + join function - + - + string - + string - + string - + \$this - + $table - + $condition - + $type - + group_by function - + - + mixed - + \$this - + $field - + order_by function - + - + string - + string - + \$this - + $field - + $type - + limit function - + - + int - + int - + string - + $limit - + $offset - + group_start function - + - + + \$this + + + + + or_group_start + function + + + + \$this - or_group_start + or_not_group_start function +prefixed with 'OR NOT']]> \$this - - or_not_group_start + + group_end function - + \$this - - group_end - function - - - - - \$this - - - - + get function - + - - + + int - + int - + object - + $table - + $limit - + $offset - + get_where function - + - + string - + array - + int - + int - + object - + $table - + $where - + $limit - + $offset - + count_all function - + - + string - + int - + $table - + count_all_results function - + - + string - + int - + $table - + insert function - + - + string - + mixed - + mixed - + $table - + $data - + update function - + - + string - + mixed - + mixed - + $table - + $data - + delete function - + - + string - + mixed - + mixed - + $table - + $where - + __call function - + - + string - + array - + mixed - + $name - + $params - + _reset function - + + + void + - + _compile function - + - + string - + string - + \$string - + $type - + $table @@ -5176,7 +5271,7 @@ the last query executed]]>
    - + Convention-based micro-framework for PHP

    ]]>
    @@ -5186,13 +5281,13 @@ the last query executed]]>
    - + Query/autoload.php - + miniMVC.php - + shutdown function @@ -5200,235 +5295,244 @@ the last query executed]]> -used to catch most fatal errors, and display them cleanly]]> - - - - load_file - function - - - - - string - - - string - - + void - + + + load_file + function + + + + + string + + + string + + + void + + + $file - + $curr_path - + on_error function - + - + int - + string - + string - + int - + \ErrorException - + $severity - + $message - + $filepath - + $line - + on_exception function - + - + \Exception - + void - + $exception - + is_like_array function - + - + mixed - + bool - + $var - + show_404 function - + + + void + - + show_error function - + - + string - + int - + $message - + $status_code - + controller_methods function - + - + string - + array - + $controller - + route function - + + + void + - + site_url function - + - + string - + string - + $segment - + to_string function - + - + \object/array - + string - + string - + $data - + $method - + do_include function - + - + string - + void - + $path @@ -6442,7 +6546,7 @@ page.

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

    ]]>
    @@ -6473,74 +6577,85 @@ page.

    ]]>
    - + + $module + + + + + + string + + + + __construct function - + - + void - + load_model function - + - + string - + array - + void - + $file - + $args - + load_view function - + - + string - + array - + bool - + mixed - + $file - + $data array - + $return diff --git a/sys/Query b/sys/Query index f43e3c7..31ba088 160000 --- a/sys/Query +++ b/sys/Query @@ -1 +1 @@ -Subproject commit f43e3c7ccf1e4d63ba67f6ac51184f6b14818ce4 +Subproject commit 31ba0881ea6088c6b141d6b75d6f2f302e61585c diff --git a/sys/common.php b/sys/common.php index bb787a3..86f24ef 100644 --- a/sys/common.php +++ b/sys/common.php @@ -26,6 +26,8 @@ * Function to run on script shutdown * -used to catch most fatal errors, and * display them cleanly + * + * @return void */ function shutdown() { @@ -143,6 +145,8 @@ function is_like_array(&$var) /** * General 404 function + * + * @return void */ function show_404() { @@ -196,30 +200,10 @@ function show_error($message, $status_code=null) function controller_methods($controller) { $methods = get_class_methods($controller); - $num = count($methods); - - for($i=0; $i < $num; $i++) - { - $skip_methods = array( - 'load_file', - 'on_error', - 'on_exception', - 'show_404', - 'show_error', - 'controller_methods', - 'route', - 'site_url', - 'load_view', - 'get_instance', - ); - - // If the method starts with an underscore, or - // is in the blacklist of methods, it is not callable - if($methods[$i]{0} === "_" || in_array($methods[$i], $skip_methods)) - { - unset($methods[$i]); - } - } + + // Eliminate methods from Controller and Model classes + $skip_methods = array_merge(get_class_methods('MM_Controller'), get_class_methods('MM_Model')); + $methods = array_diff($methods, $skip_methods); return $methods; } @@ -228,13 +212,24 @@ function controller_methods($controller) /** * Calls the appropriate module/controller/function based on the url + * + * @return void */ function route() { + $sn = $_SERVER['SCRIPT_NAME']; + $ru = $_SERVER['REQUEST_URI']; + // Get the equivalent to path info $pi = (isset($_SERVER['PATH_INFO'])) - ? str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['REQUEST_URI']) + ? str_replace($sn, '', $ru) : '/'; + + // Make sure the home page works when in a sub_directory + if (strlen($sn) > strlen($ru)) + { + $pi = '/'; + } // Load the routes config file $routes = require_once(MM_APP_PATH.'config/routes.php'); @@ -322,6 +317,7 @@ function route() if(in_array($func, $methods)) { $class = new $controller; + $class->module = $module; return call_user_func(array($class, $func)); } diff --git a/sys/controller.php b/sys/controller.php index cc81792..223eb05 100644 --- a/sys/controller.php +++ b/sys/controller.php @@ -27,6 +27,13 @@ class MM_Controller extends miniMVC { * @var Page */ public $page; + + /** + * Name of the current module + * + * @var string + */ + public $module; /** * Create the controller object @@ -37,6 +44,7 @@ class MM_Controller extends miniMVC { { parent::__construct(); + // Create the page object $this->page = new MM_Page($this); } @@ -51,21 +59,10 @@ class MM_Controller extends miniMVC { */ public function load_model($file, $args=array()) { - $path = ""; - - // The module is the lower of the class name - // need to figure out a way to allow multiple controllers - // in one module - $module = strtolower(get_class($this)); - - $not_modules = array('miniMVC', 'page', 'db', 'output'); - - // If it's a module, look in the module view folder - if( ! in_array($module, $not_modules)) - { - $path = MM_MOD_PATH . "{$module}/models/{$file}.php"; - } - + // The module is set via the router + $module = strtolower($this->module); + $path = MM_MOD_PATH . "{$module}/models/{$file}.php"; + if(is_file($path)) { require_once($path);