miniMVC

Query
<p>Free Query Builder / Database Abstraction Layer</p>

Timothy J. Warren

Copyright (c) 2012

https://github.com/aviat4ion/Query

http://philsturgeon.co.uk/code/dbad-license

DB_Reg
\DB_Reg
Connection registry
<p>Decouples the Settings class from the query builder and organizes database connections</p>

Query

Helper Classes

$instance array() Static array of connections get_db function Registry access method `string` `object` $key __construct function Private constructor `string` $key get_connections function Return exiting connections `array` remove_db function Remove a database connection `string` `void` $key
Query
<p>Free Query Builder / Database Abstraction Layer</p>

Query

Timothy J. Warren

Copyright (c) 2012

https://github.com/aviat4ion/Query

http://philsturgeon.co.uk/code/dbad-license

Settings
\Settings
Class for manipulating datbase connections, and miscellaneous settings

Query

Helper Classes

$current Settings object represented by the currently loaded JSON file $instance Singleton instance get_instance function Static method to retreive current instance of the singleton `\Settings` __construct function Load the settings file - private so it can't be loaded directly - the settings should be safe! __destruct function Output the settings on destruct __get function Magic method to simplify isset checking for config options `string` `mixed` $key __set function Magic method to simplify setting config options `string` `` $key $val add_db function Add a database connection `string` `array` $name $params edit_db function Edit a database connection `string` `array` $name $params remove_db function Remove a database connection `string` $name get_dbs function Retreive all db connections `array` get_db function Retreive a specific database connection `string` `object` $name
Query
<p>Free Query Builder / Database Abstraction Layer</p>

Timothy J. Warren

Copyright (c) 2012

https://github.com/aviat4ion/Query

http://philsturgeon.co.uk/code/dbad-license

Query

DB_SQL
\DB_SQL
Abstract parent for database manipulation subclasses

Query

Query

max
function Get the max keyword sql `string`
min
function Get the min keyword sql `string`
distinct
function Get the 'distinct' keyword `string`
avg
function Get the 'average' keyword `string`
sum
function Get the 'sum' keyword `string`
limit
function Get database specific sql for limit clause `` `string` `int` `int` `string` $sql $limit $offset FALSE
random
function Get the sql for random ordering `` `string`
db_list
function Returns sql to list other databases `string`
table_list
function Returns sql to list tables `string`
system_table_list
function Returns sql to list system tables `string`
view_list
function Returns sql to list views `string`
trigger_list
function Returns sql to list triggers `string`
function_list
function Return sql to list functions `FALSE`
procedure_list
function Return sql to list stored procedures `string`
sequence_list
function Return sql to list sequences `string`
Query
<p>Free Query Builder / Database Abstraction Layer</p>

Query

Timothy J. Warren

Copyright (c) 2012

https://github.com/aviat4ion/Query

http://philsturgeon.co.uk/code/dbad-license

DB_PDO
\DB_PDO
\PDO
Base Database class
<p>Extends PDO to simplify cross-database issues</p>

Query

Query

$statement Reference to the last executed query `mixed` $escape_char '"' Character to escape identifiers `string` $sql Reference to sql sub class `Object` $util Reference to util sub class `Object` __construct function PDO constructor wrapper `string` `string` `string` `array` $dsn $username NULL $password NULL $driver_options array() prepare_query function Simplifies prepared statements for database queries `string` `array` `mixed` $sql $data prepare_execute function Create and execute a prepared statement with the provided parameters `string` `array` `\PDOStatement` $sql $params get_query_data function Retreives the data from a select query `\PDOStatement` `array` $statement affected_rows function Returns number of rows affected by an INSERT, UPDATE, DELETE type query `\PDOStatement` `int` $statement '' get_last_error function Return the last error for the current database connection `string` quote_ident function Surrounds the string with the databases identifier escape characters `mixed` `string` $ident _quote function Helper method for quote_ident `mixed` `mixed` $str empty_table function Deletes all the rows from a table. Does the same as the truncate method if the database does not support 'TRUNCATE'; `string` `mixed` $table get_schemas function Return schemas for databases that list them `array` get_tables function Return list of tables for the current database `array` get_dbs function Return list of dbs for the current connection, if possible `array` get_views function Return list of views for the current database `array` get_sequences function Return list of sequences for the current database, if they exist `array` get_functions function Return list of function for the current database `array` get_procedures function Return list of stored procedures for the current database `array` get_triggers function Return list of triggers for the current database `array` get_system_tables function Retreives an array of non-user-created tables for the connection/database `array` driver_query function Method to simplify retreiving db results for meta-data queries `string` `bool` `mixed` $sql $filtered_index TRUE num_rows function Return the number of rows returned for a SELECT query `int` truncate function Empty the passed table `string` `void` $table switch_db function Connect to a different database `string` `void` $name
Query
<p>Free Query Builder / Database Abstraction Layer</p>

Query

Timothy J. Warren

Copyright (c) 2012

https://github.com/aviat4ion/Query

http://philsturgeon.co.uk/code/dbad-license

Query_Builder
\Query_Builder
Convienience class for creating sql queries - also the class that instantiates the specific db driver

Query

Query

$select_string Compiled 'select' clause `string` $from_string Compiled 'from' clause `string` $set_string Compiled arguments for insert / update `string` $order_string Order by clause `string` $group_string Group by clause `string` $set_array_keys Keys for insert/update statement `array` $order_array Key/val pairs for order by clause `array` $group_array Key/val pairs for group by clause `array` $values Values to apply to prepared statements `array` $limit Value for limit string `int` $offset Value for offset in limit string `int` $sql Alias to $this->db->sql `\DB_PDO` $query_map Query component order mapping for complex select queries <p>Format:</p> <p>array( 'type' => 'where', 'conjunction' => ' AND ', 'string' => 'k=?' )</p> `array` $having_map Map for having clause `array` $conn_name "" Convenience property for connection management `string` __construct function Constructor `object` $params select function Specifies rows to select in a query `string` `\$this` $fields _select function Method to simplify select_ methods `string` `string` `string` $field $as FALSE select_max function Selects the maximum value of a field from a query `string` `string` `\$this` $field $as FALSE select_min function Selects the minimum value of a field from a query `string` `string` `\$this` $field $as FALSE select_avg function Selects the average value of a field from a query `string` `string` `\$this` $field $as FALSE select_sum function Selects the sum of a field from a query `string` `string` `\$this` $field $as FALSE distinct function Adds the 'distinct' keyword to a query `\$this` from function Specify the database table to select from `string` `\$this` $dbname _like function Simplify 'like' methods `string` `mixed` `string` `string` `string` `\$this` $field $val $pos $like 'LIKE' $conj 'AND' like function Creates a Like clause in the sql statement `string` `mixed` `string` `\$this` $field $val $pos 'both' or_like function Generates an OR Like clause `string` `mixed` `string` `\$this` $field $val $pos 'both' not_like function Generates a NOT LIKE clause `string` `mixed` `string` `\$this` $field $val $pos 'both' or_not_like function Generates a OR NOT LIKE clause `string` `mixed` `string` `\$this` $field $val $pos 'both' _having function Simplify building having clauses `mixed` `mixed` `string` `\$this` $key $val array() $conj 'AND' having function Generates a 'Having' clause `mixed` `mixed` `\$this` $key $val array() or_having function Generates a 'Having' clause prefixed with 'OR' `mixed` `mixed` `\$this` $key $val array() _where function Do all the repeditive stuff for where/having type methods `mixed` `mixed` `array` $key $val array() _where_string function Simplify generating where string `mixed` `mixed` `string` `\$this` $key $val array() $conj 'AND' _where_in function Simplify where_in methods `mixed` `mixed` `` `` `\$this` $key $val array() $in 'IN' $conj 'AND' where function Specify condition(s) in the where clause of a query Note: this function works with key / value, or a passed array with key / value pairs `mixed` `mixed` `\$this` $key $val array() or_where function Where clause prefixed with "OR" `string` `mixed` `\$this` $key $val array() where_in function Where clause with 'IN' statement `mixed` `mixed` `\$this` $field $val array() or_where_in function Where in statement prefixed with "or" `string` `mixed` `\$this` $field $val array() where_not_in function WHERE NOT IN (FOO) clause `string` `mixed` `\$this` $field $val array() or_where_not_in function OR WHERE NOT IN (FOO) clause `string` `mixed` `\$this` $field $val array() set function Sets values for inserts / updates / deletes `mixed` `mixed` `\$this` $key $val NULL join function Creates a join phrase in a compiled query `string` `string` `string` `\$this` $table $condition $type '' group_by function Group the results by the selected field(s) `mixed` `\$this` $field order_by function Order the results by the selected field(s) `string` `string` `\$this` $field $type "" limit function Set a limit on the current sql statement `int` `int` `string` $limit $offset FALSE group_start function Adds a paren to the current query for query grouping `\$this` or_group_start function Adds a paren to the current query for query grouping, prefixed with 'OR' `\$this` or_not_group_start function Adds a paren to the current query for query grouping, prefixed with 'OR NOT' `\$this` group_end function Ends a query group `\$this` get function Select and retrieve all records from the current table, and/or execute current compiled query `` `int` `int` `object` $table '' $limit FALSE $offset FALSE get_where function Convience method for get() with a where clause `string` `array` `int` `int` `object` $table $where array() $limit FALSE $offset FALSE count_all function Retreive the number of rows in the selected table `string` `int` $table count_all_results function Retrieve the number of results for the generated query - used in place of the get() method `string` `int` $table '' insert function Creates an insert clause, and executes it `string` `mixed` `mixed` $table $data array() update function Creates an update clause, and executes it `string` `mixed` `mixed` $table $data array() delete function Deletes data from a table `string` `mixed` `mixed` $table $where '' __call function Calls a function further down the inheritence chain `string` `array` `mixed` $name $params _reset function Clear out the class variables, so the next query can be run `void` _compile function String together the sql statements for sending to the db `string` `string` `\$string` $type '' $table ''
Query
<p>Free Query Builder / Database Abstraction Layer</p>

Query

Timothy J. Warren

Copyright (c) 2012

https://github.com/aviat4ion/Query

http://philsturgeon.co.uk/code/dbad-license

DB_Util
\DB_Util
Abstract class defining database / table creation methods

Query

Query

$conn Reference to the current connection object __construct function Save a reference to the connection object for later use `object` $conn __call function Enable calling driver methods `string` `array` $method $args create_table function Get database-specific sql to create a new table `` `string` `array` `array` `array` `string` $name $columns $constraints array() array $indexes array() array delete_table function Get database-specific sql to drop a table `` `string` `string` $name backup_structure function Return an SQL file with the database table structure `` `string` backup_data function Return an SQL file with the database data as insert statements `` `string`
Query
<p>Free Query Builder / Database Abstraction Layer</p>

Query

Timothy J. Warren

Copyright (c) 2012

https://github.com/aviat4ion/Query

http://philsturgeon.co.uk/code/dbad-license

QBASE_PATH
dirname(__FILE__).'/'
Reference to root path
QDRIVER_PATH
QBASE_PATH.'drivers/'
Path to driver classes
do_include
function Bulk directory loading workaround for use with array_map and glob `string` `void` $path
db_filter
function Filter out db rows into one array `array` `mixed` `array` $array $index
Query
<p>Free Query Builder / Database Abstraction Layer</p>

Timothy J. Warren

Copyright (c) 2012

https://github.com/aviat4ion/Query

http://philsturgeon.co.uk/code/dbad-license

PgSQL_SQL
\PgSQL_SQL
\DB_SQL
PostgreSQL specifc SQL

Query

Drivers

limit
function Limit clause `string` `int` `int` `string` $sql $limit $offset FALSE
random
function Random ordering keyword `string`
db_list
function Returns sql to list other databases `string`
table_list
function Returns sql to list tables `string`
system_table_list
function Returns sql to list system tables `string`
view_list
function Returns sql to list views `string`
trigger_list
function Returns sql to list triggers `string`
function_list
function Return sql to list functions `FALSE`
procedure_list
function Return sql to list stored procedures `string`
sequence_list
function Return sql to list sequences `string`
column_list
function Return sql to list columns of the specified table `string` `string` $table
Query
<p>Free Query Builder / Database Abstraction Layer</p>

Query

Timothy J. Warren

Copyright (c) 2012

https://github.com/aviat4ion/Query

http://philsturgeon.co.uk/code/dbad-license

PgSQL_Util
\PgSQL_Util
\DB_Util
Posgres-specific backup, import and creation methods

Query

Drivers

__construct
function Save a reference to the current connection object `object` `void` $conn
create_table
function Database-specific method to create a new table `string` `array` `array` `array` `string` $name $columns $constraints array() array $indexes array() array
delete_table
function Database-specific SQL for dropping a table `string` `string` $name
backup_structure
function Create an SQL backup file for the current database's structure `string`
backup_data
function Create an SQL backup file for the current database's data `array` `string` $exclude array()
Query
<p>Free Query Builder / Database Abstraction Layer</p>

Query

Timothy J. Warren

Copyright (c) 2012

https://github.com/aviat4ion/Query

http://philsturgeon.co.uk/code/dbad-license

PgSQL
\PgSQL
\DB_PDO
PostgreSQL specifc class

Query

Drivers

__construct
function Connect to a PosgreSQL database `string` `string` `string` `array` $dsn $username null $password null $options array()
switch_db
function Connect to a different database `string` $name
truncate
function Empty a table `string` $table
get_schemas
function Get a list of schemas for the current connection `array`
Query
<p>Free Query Builder / Database Abstraction Layer</p>

Query

Timothy J. Warren

Copyright (c) 2012

https://github.com/aviat4ion/Query

http://philsturgeon.co.uk/code/dbad-license

ODBC_Util
\ODBC_Util
\DB_Util
ODBC-specific backup, import and creation methods

Query

Drivers

__construct
function Save a reference to the current connection object `object` `void` $conn
create_table
function Database-specific method to create a new table `string` `array` `array` `array` `string` $name $columns $constraints array() array $indexes array() array
delete_table
function Remove a table from the database `string` `string` $name
backup_structure
function Create an SQL backup file for the current database's structure `string`
backup_data
function Create an SQL backup file for the current database's data `string`
Query
<p>Free Query Builder / Database Abstraction Layer</p>

Query

Timothy J. Warren

Copyright (c) 2012

https://github.com/aviat4ion/Query

http://philsturgeon.co.uk/code/dbad-license

ODBC_SQL
\ODBC_SQL
\DB_SQL
ODBC SQL Class

Query

Drivers

limit
function Limit clause `string` `int` `int` `string` $sql $limit $offset FALSE
random
function Random ordering keyword `string`
db_list
function Returns sql to list other databases `FALSE`
table_list
function Returns sql to list tables `FALSE`
system_table_list
function Returns sql to list system tables `FALSE`
view_list
function Returns sql to list views `FALSE`
trigger_list
function Returns sql to list triggers `FALSE`
function_list
function Return sql to list functions `FALSE`
procedure_list
function Return sql to list stored procedures `FALSE`
sequence_list
function Return sql to list sequences `FALSE`
Query
<p>Free Query Builder / Database Abstraction Layer</p>

Query

Timothy J. Warren

Copyright (c) 2012

https://github.com/aviat4ion/Query

http://philsturgeon.co.uk/code/dbad-license

ODBC
\ODBC
\DB_PDO
ODBC Database Driver
<p>For general database access for databases not specified by the main drivers</p>

Query

Drivers

$escape_char '' Don't define the escape char - or define it in sub-drivers in a refactor __construct function Use ODBC to connect to a database `string` `string` `string` `array` $dsn $username null $password null $options array() switch_db function Doesn't apply to ODBC `string` `bool` $name truncate function Empty the current database `string` `void` $table
Query
<p>Free Query Builder / Database Abstraction Layer</p>

Query

Timothy J. Warren

Copyright (c) 2012

https://github.com/aviat4ion/Query

http://philsturgeon.co.uk/code/dbad-license

MySQL_Util
\MySQL_Util
\DB_Util
MySQL-specific backup, import and creation methods

Query

Drivers

__construct
function Save a reference to the current connection object `object` `void` $conn
create_table
function Convienience public function for creating a new MySQL table `string` `array` `array` `array` `string` $name $columns $constraints array() array $indexes array() array
delete_table
function Convience public function for droping a table `string` `string` $name
backup_structure
function Create an SQL backup file for the current database's structure `string`
backup_data
function Create an SQL backup file for the current database's data `array` `string` $exclude array()
Query
<p>Free Query Builder / Database Abstraction Layer</p>

Query

Timothy J. Warren

Copyright (c) 2012

https://github.com/aviat4ion/Query

http://philsturgeon.co.uk/code/dbad-license

MySQL
\MySQL
\DB_PDO
MySQL specific class

Query

Drivers

$escape_char '`' Set the backtick as the MySQL escape character `string` __construct function Connect to MySQL Database `string` `string` `string` `array` $dsn $username null $password null $options array() switch_db function Connect to a different database `string` $name truncate function Empty a table `string` $table
Query
<p>Free Query Builder / Database Abstraction Layer</p>

Query

Timothy J. Warren

Copyright (c) 2012

https://github.com/aviat4ion/Query

http://philsturgeon.co.uk/code/dbad-license

MySQL_SQL
\MySQL_SQL
\DB_SQL
MySQL specifc SQL

Query

Drivers

limit
function Limit clause `string` `int` `int` `string` $sql $limit $offset FALSE
random
function Random ordering keyword `string`
db_list
function Returns sql to list other databases `string`
table_list
function Returns sql to list tables `string`
system_table_list
function Overridden in MySQL class `string`
view_list
function Returns sql to list views `string`
trigger_list
function Returns sql to list triggers `string`
function_list
function Return sql to list functions `string`
procedure_list
function Return sql to list stored procedures `string`
sequence_list
function Return sql to list sequences `FALSE`
Query
<p>Free Query Builder / Database Abstraction Layer</p>

Query

Timothy J. Warren

Copyright (c) 2012

https://github.com/aviat4ion/Query

http://philsturgeon.co.uk/code/dbad-license

SQLite_Util
\SQLite_Util
\DB_Util
SQLite-specific backup, import and creation methods

Query

Drivers

__construct
function Save a reference to the current connection object `object` `void` $conn
create_table
function Convenience public function to create a new table `string` `array` `array` `array` `string` $name $columns $constraints array() array $indexes array() array
delete_table
function SQL to drop the specified table `string` `string` $name
backup_data
function Create an SQL backup file for the current database's data `array` `string` $excluded array()
backup_structure
function Create an SQL backup file for the current database's structure `string`
Query
<p>Free Query Builder / Database Abstraction Layer</p>

Query

Timothy J. Warren

Copyright (c) 2012

https://github.com/aviat4ion/Query

http://philsturgeon.co.uk/code/dbad-license

SQLite
\SQLite
\DB_PDO
SQLite specific class

Query

Drivers

$statement Reference to the last executed sql query `\PDOStatement` __construct function Open SQLite Database `string` `string` `string` $dsn $user NULL $pass NULL switch_db function Doesn't apply to sqlite `string` $name truncate function Empty a table `string` $table get_tables function List tables for the current database `mixed` get_system_tables function List system tables for the current database `array` load_database function Load a database for the current connection `string` `string` $db $name unload_database function Unload a database from the current connection `string` $name
Query
<p>Free Query Builder / Database Abstraction Layer</p>

Query

Timothy J. Warren

Copyright (c) 2012

https://github.com/aviat4ion/Query

http://philsturgeon.co.uk/code/dbad-license

SQLite_SQL
\SQLite_SQL
\DB_SQL
SQLite Specific SQL

Query

Drivers

limit
function Limit clause `string` `int` `int` `string` $sql $limit $offset FALSE
random
function Random ordering keyword `string`
db_list
function Returns sql to list other databases `FALSE`
table_list
function Returns sql to list tables `string`
system_table_list
function Overridden in SQLite class `string`
view_list
function Returns sql to list views `string`
trigger_list
function Returns sql to list triggers `FALSE`
function_list
function Return sql to list functions `FALSE`
procedure_list
function Return sql to list stored procedures `FALSE`
sequence_list
function Return sql to list sequences `FALSE`
Query
<p>Free Query Builder / Database Abstraction Layer</p>

Query

Timothy J. Warren

Copyright (c) 2012

https://github.com/aviat4ion/Query

http://philsturgeon.co.uk/code/dbad-license

Firebird_SQL
\Firebird_SQL
\DB_SQL
Firebird Specific SQL

Query

Drivers

limit
function Limit clause `string` `int` `int` `string` $sql $limit $offset FALSE
random
function Random ordering keyword `string`
db_list
function Returns sql to list other databases `FALSE`
table_list
function Returns sql to list tables `string`
system_table_list
function Returns sql to list system tables `string`
view_list
function Returns sql to list views `string`
trigger_list
function Returns sql to list triggers `string`
function_list
function Return sql to list functions `string`
procedure_list
function Return sql to list stored procedures `string`
sequence_list
function Return sql to list sequences `string`
column_list
function Return sql to list columns of the specified table `string` `string` $table
Query
<p>Free Query Builder / Database Abstraction Layer</p>

Query

Timothy J. Warren

Copyright (c) 2012

https://github.com/aviat4ion/Query

http://philsturgeon.co.uk/code/dbad-license

Firebird_Result
\Firebird_Result
\PDOStatement
Firebird result class to emulate PDOStatement Class - only implements data-fetching methods

Query

Drivers

$statement Reference to fbird resource `resource` $row Current row in result array `int` $result array() Data pulled from query `` __construct function Create the object by passing the resource for the query `resource` $link bindColumn function Invalidate method for data consistency `mixed` `mixed` `int` `mixed` `array` `FALSE` $column $param $type NULL $maxlen NULL $driverdata NULL bindParam function Invalidate method for data consistency `mixed` `mixed` `int` `mixed` `array` `FALSE` $parameter $variable $data_type NULL $maxlen NULL $driverdata NULL bindValue function Invalidate method for data consistency `mixed` `mixed` `int` `FALSE` $parameter $variable $data_type NULL execute function Run a prepared statement query `array` `bool` $args NULL fetch function Emulate PDO fetch public function `int` `mixed` `mixed` `mixed` $fetch_style PDO::FETCH_ASSOC $statement NULL $offset NULL fetchAll function Emulate PDO fetchAll public function `int` `mixed` `mixed` `mixed` $fetch_style PDO::FETCH_ASSOC $statement NULL $ctor_args NULL fetchColumn function Emulate PDOStatement::fetchColumn `int` `mixed` $column_num 0 fetchObject function Emulate PDOStatement::fetchObject, but only for the default use `string` `array` `\stdClass` $class_name 'stdClass' $ctor_args array() rowCount function Return the number of rows affected by the previous query `int` errorCode function Method to emulate PDOStatement->errorCode `string` errorInfo function Method to emulate PDO->errorInfo / PDOStatement->errorInfo `array`
Query
<p>Free Query Builder / Database Abstraction Layer</p>

Query

Timothy J. Warren

Copyright (c) 2012

https://github.com/aviat4ion/Query

http://philsturgeon.co.uk/code/dbad-license

Firebird
\Firebird
\DB_PDO
Firebird Database class
<p>PDO-firebird isn't stable, so this is a wrapper of the fbird_ public functions.</p>

Query

Drivers

$statement Reference to the last query executed `object` $statement_link Reference to the resource returned by the last query executed `resource` $trans Reference to the current transaction `resource` $conn Reference to the connection resource `resource` __construct function Open the link to the database `string` `string` `string` $dbpath $user 'sysdba' $pass 'masterkey' switch_db function Doesn't apply to Firebird `string` `FALSE` $name truncate function Empty a database table `string` $table query function Wrapper public function to better match PDO `string` `\$this` $sql prepare function Emulate PDO prepare `string` `array` `\$this` $query $options NULL beginTransaction function Start a database transaction `bool` commit function Commit a database transaction `bool` rollBack function Rollback a transaction `bool` prepare_execute function Prepare and execute a query `string` `array` `resource` $sql $args quote function Method to emulate PDO->quote `string` `int` `string` $str $param_type NULL errorInfo function Method to emulate PDO->errorInfo / PDOStatement->errorInfo `array` errorCode function Method to emulate PDO->errorCode `array` prepare_query function Bind a prepared query with arguments for executing `string` `array` `FALSE` $sql $params
Query
<p>Free Query Builder / Database Abstraction Layer</p>

Query

Timothy J. Warren

Copyright (c) 2012

https://github.com/aviat4ion/Query

http://philsturgeon.co.uk/code/dbad-license

Firebird_Util
\Firebird_Util
\DB_Util
Firebird-specific backup, import and creation methods

Query

Drivers

__construct
function Save a reference to the current connection object `object` `void` $conn
create_table
function Convienience public function to generate sql for creating a db table `string` `array` `array` `array` `string` $name $fields $constraints array() array $indexes array() array
delete_table
function Drop the selected table `string` `string` $name
backup_structure
function Create an SQL backup file for the current database's structure `string`
backup_data
function Create an SQL backup file for the current database's data `array` `bool` `string` $exclude array() $system_tables FALSE
MiniMVC
<p>Convention-based micro-framework for PHP</p>

miniMVC

Timothy J. Warren

Copyright (c) 2011 - 2012

https://github.com/timw4mail/miniMVC

http://philsturgeon.co.uk/code/dbad-license

MM_Model
\MM_Model
\miniMVC
Base Model Class

miniMVC

System

__construct
function Initialize the model class `void`
load_db
function Adds the database class to the current model class `string` `void` $name "default"
MiniMVC
<p>Convention-based micro-framework for PHP</p>

miniMVC

Timothy J. Warren

Copyright (c) 2011 - 2012

https://github.com/timw4mail/miniMVC

http://philsturgeon.co.uk/code/dbad-license

DB
\DB
\Query_Builder
Extend PHP's PDO class to add some more functionality

miniMVC

System

$instance array() DB connection instances `array` get_instance function Indexed singleton method `string` `array` `\DB` $dbname "default" $options array() array __construct function Constructor to override JSObject trait `array` $params array() array __call function Override __call in trait to call __call in Query Builder...lol `string` `array` `mixed` $name $params array() get_last_error function Returns the last error from the database `string`
MiniMVC
<p>Convention-based micro-framework for PHP</p>

miniMVC

Timothy J. Warren

Copyright (c) 2011 - 2012

https://github.com/timw4mail/miniMVC

http://philsturgeon.co.uk/code/dbad-license

__construct
function Constructor for creating the objects `array` `void` $members array()
__call
function PHP magic method to facilitate dynamic methods `string` `array` $name $params array()
__toString
function Prints out the contents of the object when used as a string `string`
__invoke
function PHP magic method that is called when an object is treated as a function `array` `\self` $params array()
get_instance
function Singleton getter function `\self`
__clone
function Magic function called when cloning an object
MM
\MM
\ArrayObject
Class for standalone JSObject objects

miniMVC

System

__construct
function Create the ArrayObject/JSObject hybrid object `` $members array()
__call
function Allow calling of array methods on the object and dynamic methods `string` `array` `mixed` $name $params array()
miniMVC
\miniMVC
\MM
Base class for the framework

miniMVC

System

$output Reference to output class `\MM_Output` __construct function Constructor - Any classes loaded here become subclasses of miniMVC `array` $members array() __call function PHP magic method to facilitate dynamic methods `string` `array` $name $args array() load_class function Method to load classes into the singleton `string` `void` $name unload function Convenience function to remove an object from the singleton `string` $name load_config function Convenience function to load config files `string` $name
MiniMVC
<p>Convention-based micro-framework for PHP</p>

miniMVC

Timothy J. Warren

Copyright (c) 2011 - 2012

https://github.com/timw4mail/miniMVC

http://philsturgeon.co.uk/code/dbad-license

MM_Page
\MM_Page
\MM
Class for building pages
<p>All methods are chainable, with the exception of the constructor, build_header(), build_footer(), and _headers() methods.</p>

miniMVC

System

$meta Meta tags `string` $head_js JS tags for the header `string` $foot_js JS tags for the footer `string` $css CSS tags for the page `string` $title Page title `string` $head_tags Additional header tags `string` $body_class Class(es) to apply to the main body tag `string` $body_id Id to apply to the body tag `string` $base Base tag `string` __construct function Set up the page class `` `void` $controller _headers function Sets server headers and doctype <p>Also sets page mime type, based on if sent as html or xhtml, and what the target browser supports</p> `bool` `\Page` $html5 set_meta function Set Meta <p>Sets meta tags, with codeigniter native meta tag helper</p> `array` `\Page` $meta set_head_js_group function Sets minified javascript group in header `string` `bool` `\Page` $group $debug FALSE set_css_group function Sets a minified css group `string` `\Page` $group set_foot_js_group function Sets a minified javascript group for the page footer `string` `bool` `\Page` $group $debug FALSE set_title function Sets html title string `string` `\Page` $title "" set_body_class function Sets custom body class `string` `\Page` $class "" set_body_id function Sets custom body id `string` `\Page` $id "" set_base function Sets custom base href `string` `\Page` $href set_css_tag function Sets custom css tags `string` `bool` `string` `\Page` $name $domain TRUE $media "all" set_head_tag function Sets a custom tag in the header `string` `\Page` $tag build_header function Sets custom page header `bool` `\Page` $html5 TRUE build_footer function Builds common footer with any additional js script_tag function Script Tag <p>Helper function for making script tags</p> `string` `bool` `string` $js $domain TRUE set_message function Set Message <p>Adds a message to the page</p> `string` `string` `bool` `void` $type $message $return FALSE redirect_303 function Redirect 303 <p>Shortcut function for 303 redirect</p> `string` $url render function Render <p>Shortcut function for building a page</p> `string` `array` $view $data array() output_string function Output String <p>Similar to render(), this is a shortcut to output a string in the body of the page.</p> `string` $string _meta function Private helper function to generate meta tags `array` `string` $params _link_tag function Private helper function to generate link tags `array` `string` $params
MiniMVC
<p>Convention-based micro-framework for PHP</p>

miniMVC

Timothy J. Warren

Copyright (c) 2011 - 2012

https://github.com/timw4mail/miniMVC

http://philsturgeon.co.uk/code/dbad-license

MM_Controller
\MM_Controller
\miniMVC
Base Controller Class

miniMVC

System

$page Instance of Page class `\Page` __construct function Create the controller object `void` load_model function Function for loading a model into the current class `string` `array` `void` $file $args array() load_view function Function for loading a view `string` `array` `bool` `mixed` $file $data array() array $return FALSE
MiniMVC
<p>Convention-based micro-framework for PHP</p>

Timothy J. Warren

Copyright (c) 2011 - 2012

https://github.com/timw4mail/miniMVC

http://philsturgeon.co.uk/code/dbad-license

MM_Output
\MM_Output
\MM
Class for displaying output and setting http headers

miniMVC

System

$buffer Content for outputting `string` $headers HTTP headers to send `array` __construct function Initialize the output class `void` __destruct function PHP magic method called when ending the script Used for outputing HTML `void` set_header function Sets a header for later output `string` `string` $key $val append_output function Adds text to the output buffer `string` $string set_output function Sets the output buffer `string` $string flush_headers function Sends headers and then removes them
MiniMVC
<p>Convention-based micro-framework for PHP</p>

miniMVC

Timothy J. Warren

Copyright (c) 2011 - 2012

https://github.com/timw4mail/miniMVC

http://philsturgeon.co.uk/code/dbad-license

MM_Session
\MM_Session
Class to improve handling of PHP sessions

miniMVC

Libraries

__construct
function Start a session
__set
function Set a session value `string` `mixed` `void` $key $val
__get
function Retreive a session value `string` `mixed` $key
destroy
function Destroy a session `void`
MiniMVC
<p>Convention-based micro-framework for PHP</p>

miniMVC

Timothy J. Warren

Copyright (c) 2011 - 2012

https://github.com/timw4mail/miniMVC

http://philsturgeon.co.uk/code/dbad-license

db/autoload.php
core/miniMVC.php
shutdown
function Function to run on script shutdown -used to catch most fatal errors, and display them cleanly `void`
load_file
function Function to search through the tree to find the necessary file `string` `string` `void` $file $curr_path ""
on_error
function Custom error handler `int` `string` `string` `int` `\ErrorException` $severity $message $filepath $line
on_exception
function Custom exception handlererror_get_last `\Exception` `void` $exception
is_like_array
function Utility function to check if a variable is set, and is an array or object `mixed` `bool` $var
show_404
function General 404 function `void`
show_error
function Fatal Error page function `string` `int` $message $status_code null
controller_methods
function Returns routable methods for the specified controller class `string` `array` $controller
route
function Calls the appropriate module/controller/function based on the url `void`
site_url
function Returns a full url from a url segment `string` `string` $segment
to_string
function Prints out the contents of the object `\object/array` `string` `string` $data $method 'print_r'
do_include
function Array_map callback to load a folder of classes at once `string` `void` $path
MiniMVC
<p>Convention-based micro-framework for PHP</p>

miniMVC

Timothy J. Warren

Copyright (c) 2011 - 2012

https://github.com/timw4mail/miniMVC

http://philsturgeon.co.uk/code/dbad-license

config/config.php
common.php
ENVIRONMENT
'DEVELOPMENT'
miniMVC bootstrap file

miniMVC

App

MM_BASE_PATH
__DIR__
MM_SYS_PATH
__DIR__.'/sys/'
MM_MOD_PATH
__DIR__.'/modules/'
MM_APP_PATH
__DIR__.'/app/'
MiniMVC
<p>Convention-based micro-framework for PHP</p>

miniMVC

Timothy J. Warren

Copyright (c) 2011 - 2012

https://github.com/timw4mail/miniMVC

http://philsturgeon.co.uk/code/dbad-license

SHOW_DEBUG_BACKTRACE
TRUE
Main config file

miniMVC

App

BASE_URL
$default_baseurl
URL_INDEX_FILE
'index.php/'
CONTENT_DOMAIN
BASE_URL
STATIC_LIB_PATH
CONTENT_DOMAIN.'assets/'
STYLE_PATH
STATIC_LIB_PATH . 'css.php/g/'
SCRIPT_PATH
STATIC_LIB_PATH . 'js.php/g/'
DEFAULT_TITLE
"miniMVC app"
DEFAULT_CSS_GROUP
"css"
DEFAULT_JS_GROUP
"js"
MiniMVC
<p>Convention-based micro-framework for PHP</p>

miniMVC

Timothy J. Warren

Copyright (c) 2011 - 2012

https://github.com/timw4mail/miniMVC

http://philsturgeon.co.uk/code/dbad-license

MiniMVC
<p>Convention-based micro-framework for PHP</p>

miniMVC

Timothy J. Warren

Copyright (c) 2011 - 2012

https://github.com/timw4mail/miniMVC

http://philsturgeon.co.uk/code/dbad-license

MiniMVC
<p>Convention-based micro-framework for PHP</p>

miniMVC

Timothy J. Warren

Copyright (c) 2011 - 2012

https://github.com/timw4mail/miniMVC

http://philsturgeon.co.uk/code/dbad-license

Welcome_Model
\Welcome_Model
\MM_Model
Model template class

miniMVC

App

__construct
function Initialize the model `void`
MiniMVC
<p>Convention-based micro-framework for PHP</p>

miniMVC

Timothy J. Warren

Copyright (c) 2011 - 2012

https://github.com/timw4mail/miniMVC

http://philsturgeon.co.uk/code/dbad-license

Welcome
\Welcome
\MM_Controller
Example Controller Class

miniMVC

App

__construct
function Initialize the constructor `void`
index
function Default route for the controller `void`
php
function welcome/php route `void`
todo
fixme