From c81acb398a72647df2f90fed4ad30d116c157ad8 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Mon, 26 Mar 2012 14:30:44 +0200 Subject: [PATCH 001/126] Added connection charset support for MySQL. The default charset is utf8. --- mysql/ez_sql_mysql.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/mysql/ez_sql_mysql.php b/mysql/ez_sql_mysql.php index 1c69c54c..df1b5586 100755 --- a/mysql/ez_sql_mysql.php +++ b/mysql/ez_sql_mysql.php @@ -2,6 +2,7 @@ /********************************************************************** * Author: Justin Vincent (jv@jvmultimedia.com) + * Stefanie Janine Stoelting (mail@stefanie-stoelting.de) * Web...: http://twitter.com/justinvincent * Name..: ezSQL_mysql * Desc..: mySQL component (part of ezSQL databse abstraction library) @@ -35,18 +36,23 @@ class ezSQL_mysql extends ezSQLcore var $dbpassword = false; var $dbname = false; var $dbhost = false; + var $charset = 'utf8'; /********************************************************************** * Constructor - allow the user to perform a qucik connect at the * same time as initialising the ezSQL_mysql class */ - function ezSQL_mysql($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') + function ezSQL_mysql($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $charset='') { $this->dbuser = $dbuser; $this->dbpassword = $dbpassword; $this->dbname = $dbname; $this->dbhost = $dbhost; + if ( ! empty($charset) ) + { + $this->charset = $charset; + } } /********************************************************************** @@ -67,7 +73,7 @@ function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhos * Try to connect to mySQL database server */ - function connect($dbuser='', $dbpassword='', $dbhost='localhost') + function connect($dbuser='', $dbpassword='', $dbhost='localhost', $charset='') { global $ezsql_mysql_str; $return_val = false; @@ -88,6 +94,12 @@ function connect($dbuser='', $dbpassword='', $dbhost='localhost') $this->dbuser = $dbuser; $this->dbpassword = $dbpassword; $this->dbhost = $dbhost; + if ( ! empty($charset) ) + { + $this->charset = $charset; + } + + mysql_set_charset($this->charset, $this->dbh); $return_val = true; } From f8de0f82f8d05b7f9a8d3007c74df57bac35cf17 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Mon, 26 Mar 2012 16:49:32 +0200 Subject: [PATCH 002/126] Added disconnect to the ezMySQL class. --- mysql/ez_sql_mysql.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mysql/ez_sql_mysql.php b/mysql/ez_sql_mysql.php index df1b5586..c340b238 100755 --- a/mysql/ez_sql_mysql.php +++ b/mysql/ez_sql_mysql.php @@ -278,6 +278,17 @@ function query($query) return $return_val; } + + /** + * Close the database connection + */ + function disconnect() + { + if ( $this->dbh ) + { + mysql_close($this->dbh); + } + } } From 25ab5c58aa59335fcf2fc2c534749f9c9f8309fa Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Mon, 26 Mar 2012 17:59:15 +0200 Subject: [PATCH 003/126] - Corrected the PostgreSQL connection - Added port support for the PostgreSQL connection - Added disconnect for the PostgreSQL connection --- postgresql/ez_sql_postgresql.php | 43 ++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/postgresql/ez_sql_postgresql.php b/postgresql/ez_sql_postgresql.php index af48b03a..52b37a49 100755 --- a/postgresql/ez_sql_postgresql.php +++ b/postgresql/ez_sql_postgresql.php @@ -2,9 +2,10 @@ /********************************************************************** * Author: Justin Vincent (jv@jvmultimedia.com) + * Stefanie Janine Stoelting (mail@stefanie-stoelting.de) * Web...: http://twitter.com/justinvincent * Name..: ezSQL_postgresql - * Desc..: mySQL component (part of ezSQL databse abstraction library) + * Desc..: PostgreSQL component (part of ezSQL databse abstraction library) * */ @@ -22,7 +23,7 @@ ); /********************************************************************** - * ezSQL Database specific class - mySQL + * ezSQL Database specific class - PostgreSQL */ if ( ! function_exists ('pg_connect') ) die('Fatal Error: ezSQL_postgresql requires PostgreSQL Lib to be compiled and or linked in to the PHP engine'); @@ -35,18 +36,20 @@ class ezSQL_postgresql extends ezSQLcore var $dbpassword = false; var $dbname = false; var $dbhost = false; + var $port = '5432'; /********************************************************************** * Constructor - allow the user to perform a qucik connect at the * same time as initialising the ezSQL_postgresql class */ - function ezSQL_postgresql($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') + function ezSQL_postgresql($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') { $this->dbuser = $dbuser; $this->dbpassword = $dbpassword; $this->dbname = $dbname; $this->dbhost = $dbhost; + $this->port = $port; } /********************************************************************** @@ -54,11 +57,11 @@ function ezSQL_postgresql($dbuser='', $dbpassword='', $dbname='', $dbhost='local * because std. connect already does what quick connect does - * but for the sake of consistency it has been included */ - - function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') + + function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') { $return_val = false; - if ( ! $this->connect($dbuser, $dbpassword, $dbname, $dbhost,true) ) ; + if ( ! $this->connect($dbuser, $dbpassword, $dbname, $dbhost, $port, true) ) ; else if ( ! $this->select($dbname) ) ; else $return_val = true; return $return_val; @@ -68,10 +71,11 @@ function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhos * Try to connect to mySQL database server */ - function connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') + function connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') { global $ezsql_postgresql_str; $return_val = false; + echo "

\$dbuser: $dbuser - \$dbpassword: $dbpassword - \$dbname: $dbname - \$dbhost: $dbhost - \$port: $port

\n"; // Must have a user and a password if ( ! $dbuser ) { @@ -79,7 +83,7 @@ function connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') $this->show_errors ? trigger_error($ezsql_postgresql_str[1],E_USER_WARNING) : null; } // Try to establish the server database handle - else if ( ! $this->dbh = @pg_connect("host=$dbhost user=$dbuser password=$dbpassword dbname=$dbname",true) ) //should be modified for port + else if ( ! $this->dbh = pg_connect("host=$dbhost port=$port dbname=$dbname user=$dbuser password=$dbpassword", true) ) { $this->register_error($ezsql_postgresql_str[2].' in '.__FILE__.' on line '.__LINE__); $this->show_errors ? trigger_error($ezsql_postgresql_str[2],E_USER_WARNING) : null; @@ -90,6 +94,7 @@ function connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') $this->dbpassword = $dbpassword; $this->dbhost = $dbhost; $this->dbname = $dbname; + $this->port = $port; $return_val = true; } @@ -101,10 +106,10 @@ function connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') * once again, function included for the sake of consistency */ - function select($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') + function select($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') { $return_val = false; - if ( ! $this->connect($dbuser, $dbpassword, $dbname, $dbhost,true) ) ; + if ( ! $this->connect($dbuser, $dbpassword, $dbname, $dbhost, $port, true) ) ; else if ( ! $this->select($dbname) ) ; else $return_val = true; return $return_val; @@ -136,12 +141,12 @@ function sysdate() function showTables() { - return "table_name FROM information_schema.tables WHERE table_schema = 'public' and table_type='BASE TABLE'"; + return "table_name FROM information_schema.tables WHERE table_schema = '$this->dbname' and table_type='BASE TABLE'"; } function descTable($tbl_name) { - return "ordinal_position, column_name, data_type, column_default, is_nullable, character_maximum_length, numeric_precision FROM information_schema.columns WHERE table_name = '$tbl_name' ORDER BY ordinal_position"; + return "ordinal_position, column_name, data_type, column_default, is_nullable, character_maximum_length, numeric_precision FROM information_schema.columns WHERE table_name = '$tbl_name' AND table_schema='$this->dbname' ORDER BY ordinal_position"; } function showDatabases() @@ -183,7 +188,7 @@ function query($query) // If there is no existing database connection then try to connect if ( ! isset($this->dbh) || ! $this->dbh ) { - $this->connect($this->dbuser, $this->dbpassword, $this->dbname); + $this->connect($this->dbuser, $this->dbpassword, $this->dbname, $this->dbhost, $this->port); } // Perform the query via std postgresql_query function.. @@ -268,7 +273,19 @@ function query($query) return $return_val; } + + /** + * Close the database connection + */ + function disconnect() + { + if ( $this->dbh ) + { + pg_close($this->dbh); + } + } } ?> + From cac28a4a909ee970c80c671fa1796fab302fa7b7 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Fri, 30 Mar 2012 16:51:22 +0200 Subject: [PATCH 004/126] Added gitigore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..bbf3a93a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/nbproject/private/ +~*.* From 80231e69eeab46350b758498001347e151584fbf Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Fri, 30 Mar 2012 16:52:39 +0200 Subject: [PATCH 005/126] Changed gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index bbf3a93a..9b7a3ca3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /nbproject/private/ +/nbproject/ +~ ~*.* From c221fbdd9b240e83ab9a0a79e155f898f7f907d1 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 14:36:12 +0200 Subject: [PATCH 006/126] Moved documentation files to the documentation directory. --- ez_sql_help.htm => _Documentation/ez_sql_help.htm | 0 ez_sql_with_smarty.html => _Documentation/ez_sql_with_smarty.html | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename ez_sql_help.htm => _Documentation/ez_sql_help.htm (100%) rename ez_sql_with_smarty.html => _Documentation/ez_sql_with_smarty.html (100%) diff --git a/ez_sql_help.htm b/_Documentation/ez_sql_help.htm similarity index 100% rename from ez_sql_help.htm rename to _Documentation/ez_sql_help.htm diff --git a/ez_sql_with_smarty.html b/_Documentation/ez_sql_with_smarty.html similarity index 100% rename from ez_sql_with_smarty.html rename to _Documentation/ez_sql_with_smarty.html From e123f0c741907674f1727d05b4e83d5f0b0a3a6b Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 15:50:15 +0200 Subject: [PATCH 007/126] - Changed the core class to PHP 5 syntax. - Cleared parameter formats from mixed commaspace / comma to comma space. - Added PHPDoc documentation tags and extended the documentation --- shared/ez_sql_core.php | 1319 ++++++++++++++++++++++------------------ 1 file changed, 736 insertions(+), 583 deletions(-) diff --git a/shared/ez_sql_core.php b/shared/ez_sql_core.php index 0675ec67..08dbf288 100755 --- a/shared/ez_sql_core.php +++ b/shared/ez_sql_core.php @@ -1,589 +1,742 @@ last_error = $err_str; - - // Capture all errors to an error array no matter what happens - $this->captured_errors[] = array - ( - 'error_str' => $err_str, - 'query' => $this->last_query - ); - } - - /********************************************************************** - * Turn error handling on or off.. - */ - - function show_errors() - { - $this->show_errors = true; - } - - function hide_errors() - { - $this->show_errors = false; - } - - /********************************************************************** - * Kill cached query results - */ - - function flush() - { - // Get rid of these - $this->last_result = null; - $this->col_info = null; - $this->last_query = null; - $this->from_disk_cache = false; - } - - /********************************************************************** - * Get one variable from the DB - see docs for more detail - */ - - function get_var($query=null,$x=0,$y=0) - { - - // Log how the function was called - $this->func_call = "\$db->get_var(\"$query\",$x,$y)"; - - // If there is a query then perform it if not then use cached results.. - if ( $query ) - { - $this->query($query); - } - - // Extract var out of cached results based x,y vals - if ( $this->last_result[$y] ) - { - $values = array_values(get_object_vars($this->last_result[$y])); - } - - // If there is a value return it else return null - return (isset($values[$x]) && $values[$x]!=='')?$values[$x]:null; - } - - /********************************************************************** - * Get one row from the DB - see docs for more detail - */ - - function get_row($query=null,$output=OBJECT,$y=0) - { - - // Log how the function was called - $this->func_call = "\$db->get_row(\"$query\",$output,$y)"; - - // If there is a query then perform it if not then use cached results.. - if ( $query ) - { - $this->query($query); - } - - // If the output is an object then return object using the row offset.. - if ( $output == OBJECT ) - { - return $this->last_result[$y]?$this->last_result[$y]:null; - } - // If the output is an associative array then return row as such.. - elseif ( $output == ARRAY_A ) - { - return $this->last_result[$y]?get_object_vars($this->last_result[$y]):null; - } - // If the output is an numerical array then return row as such.. - elseif ( $output == ARRAY_N ) - { - return $this->last_result[$y]?array_values(get_object_vars($this->last_result[$y])):null; - } - // If invalid output type was specified.. - else - { - $this->print_error(" \$db->get_row(string query, output type, int offset) -- Output type must be one of: OBJECT, ARRAY_A, ARRAY_N"); - } - - } - - /********************************************************************** - * Function to get 1 column from the cached result set based in X index - * see docs for usage and info - */ - - function get_col($query=null,$x=0) - { - - $new_array = array(); - - // If there is a query then perform it if not then use cached results.. - if ( $query ) - { - $this->query($query); - } - - // Extract the column values - for ( $i=0; $i < count($this->last_result); $i++ ) - { - $new_array[$i] = $this->get_var(null,$x,$i); - } - - return $new_array; - } - - - /********************************************************************** - * Return the the query as a result set - see docs for more details - */ - - function get_results($query=null, $output = OBJECT) - { - - // Log how the function was called - $this->func_call = "\$db->get_results(\"$query\", $output)"; - - // If there is a query then perform it if not then use cached results.. - if ( $query ) - { - $this->query($query); - } - - // Send back array of objects. Each row is an object - if ( $output == OBJECT ) - { - return $this->last_result; - } - elseif ( $output == ARRAY_A || $output == ARRAY_N ) - { - if ( $this->last_result ) - { - $i=0; - foreach( $this->last_result as $row ) - { - - $new_array[$i] = get_object_vars($row); - - if ( $output == ARRAY_N ) - { - $new_array[$i] = array_values($new_array[$i]); - } - - $i++; - } - - return $new_array; - } - else - { - return null; - } - } - } - - - /********************************************************************** - * Function to get column meta data info pertaining to the last query - * see docs for more info and usage - */ - - function get_col_info($info_type="name",$col_offset=-1) - { - - if ( $this->col_info ) - { - if ( $col_offset == -1 ) - { - $i=0; - foreach($this->col_info as $col ) - { - $new_array[$i] = $col->{$info_type}; - $i++; - } - return $new_array; - } - else - { - return $this->col_info[$col_offset]->{$info_type}; - } - - } - - } - - /********************************************************************** - * store_cache - */ - - function store_cache($query,$is_insert) - { - - // The would be cache file for this query - $cache_file = $this->cache_dir.'/'.md5($query); - - // disk caching of queries - if ( $this->use_disk_cache && ( $this->cache_queries && ! $is_insert ) || ( $this->cache_inserts && $is_insert )) - { - if ( ! is_dir($this->cache_dir) ) - { - $this->register_error("Could not open cache dir: $this->cache_dir"); - $this->show_errors ? trigger_error("Could not open cache dir: $this->cache_dir",E_USER_WARNING) : null; - } - else - { - // Cache all result values - $result_cache = array - ( - 'col_info' => $this->col_info, - 'last_result' => $this->last_result, - 'num_rows' => $this->num_rows, - 'return_value' => $this->num_rows, - ); - error_log ( serialize($result_cache), 3, $cache_file); - } - } - - } - - /********************************************************************** - * get_cache - */ - - function get_cache($query) - { - - // The would be cache file for this query - $cache_file = $this->cache_dir.'/'.md5($query); - - // Try to get previously cached version - if ( $this->use_disk_cache && file_exists($cache_file) ) - { - // Only use this cache file if less than 'cache_timeout' (hours) - if ( (time() - filemtime($cache_file)) > ($this->cache_timeout*3600) ) - { - unlink($cache_file); - } - else - { - $result_cache = unserialize(file_get_contents($cache_file)); - - $this->col_info = $result_cache['col_info']; - $this->last_result = $result_cache['last_result']; - $this->num_rows = $result_cache['num_rows']; - - $this->from_disk_cache = true; - - // If debug ALL queries - $this->trace || $this->debug_all ? $this->debug() : null ; - - return $result_cache['return_value']; - } - } - - } - - /********************************************************************** - * Dumps the contents of any input variable to screen in a nicely - * formatted and easy to understand way - any type: Object, Var or Array - */ - - function vardump($mixed='') - { - - // Start outup buffering - ob_start(); - - echo "

"; - echo "
";
-
-			if ( ! $this->vardump_called )
-			{
-				echo "ezSQL (v".EZSQL_VERSION.") Variable Dump..\n\n";
-			}
-
-			$var_type = gettype ($mixed);
-			print_r(($mixed?$mixed:"No Value / False"));
-			echo "\n\nType: " . ucfirst($var_type) . "\n";
-			echo "Last Query [$this->num_queries]: ".($this->last_query?$this->last_query:"NULL")."\n";
-			echo "Last Function Call: " . ($this->func_call?$this->func_call:"None")."\n";
-			echo "Last Rows Returned: ".count($this->last_result)."\n";
-			echo "
".$this->donation(); - echo "\n


"; - - // Stop output buffering and capture debug HTML - $html = ob_get_contents(); - ob_end_clean(); - - // Only echo output if it is turned on - if ( $this->debug_echo_is_on ) - { - echo $html; - } - - $this->vardump_called = true; - - return $html; - - } - - /********************************************************************** - * Alias for the above function - */ - - function dumpvar($mixed) - { - $this->vardump($mixed); - } - - /********************************************************************** - * Displays the last query string that was sent to the database & a - * table listing results (if there were any). - * (abstracted into a seperate file to save server overhead). - */ - - function debug($print_to_screen=true) - { - - // Start outup buffering - ob_start(); - - echo "
"; - - // Only show ezSQL credits once.. - if ( ! $this->debug_called ) - { - echo "ezSQL (v".EZSQL_VERSION.") Debug..

\n"; - } - - if ( $this->last_error ) - { - echo "Last Error -- [$this->last_error]

"; - } - - if ( $this->from_disk_cache ) - { - echo "Results retrieved from disk cache

"; - } - - echo "Query [$this->num_queries] -- "; - echo "[$this->last_query]

"; - - echo "Query Result.."; - echo "

"; - - if ( $this->col_info ) - { - - // ===================================================== - // Results top rows - - echo ""; - echo ""; - - - for ( $i=0; $i < count($this->col_info); $i++ ) - { - echo ""; - } - - echo ""; - - // ====================================================== - // print main results - - if ( $this->last_result ) - { - - $i=0; - foreach ( $this->get_results(null,ARRAY_N) as $one_row ) - { - $i++; - echo ""; - - foreach ( $one_row as $item ) - { - echo ""; - } - - echo ""; - } - - } // if last result - else - { - echo ""; - } - - echo "
(row){$this->col_info[$i]->type} {$this->col_info[$i]->max_length}
{$this->col_info[$i]->name}
$i$item
No Results
"; - - } // if col_info - else - { - echo "No Results"; - } - - echo "
".$this->donation()."
"; - - // Stop output buffering and capture debug HTML - $html = ob_get_contents(); - ob_end_clean(); - - // Only echo output if it is turned on - if ( $this->debug_echo_is_on && $print_to_screen) - { - echo $html; - } - - $this->debug_called = true; - - return $html; - - } - - /********************************************************************** - * Naughty little function to ask for some remuniration! - */ - - function donation() - { - return "If ezSQL has helped make a donation!?   "; - } - - /********************************************************************** - * Timer related functions - */ - - function timer_get_cur() - { - list($usec, $sec) = explode(" ",microtime()); - return ((float)$usec + (float)$sec); - } - - function timer_start($timer_name) - { - $this->timers[$timer_name] = $this->timer_get_cur(); - } - - function timer_elapsed($timer_name) - { - return round($this->timer_get_cur() - $this->timers[$timer_name],2); - } - - function timer_update_global($timer_name) - { - if ( $this->do_profile ) - { - $this->profile_times[] = array - ( - 'query' => $this->last_query, - 'time' => $this->timer_elapsed($timer_name) - ); - } - - $this->total_query_time += $this->timer_elapsed($timer_name); - } - - /********************************************************************** - * Creates a SET nvp sql string from an associative array (and escapes all values) - * - * Usage: - * - * $db_data = array('login'=>'jv','email'=>'jv@vip.ie', 'user_id' => 1, 'created' => 'NOW()'); - * - * $db->query("INSERT INTO users SET ".$db->get_set($db_data)); - * - * ...OR... - * - * $db->query("UPDATE users SET ".$db->get_set($db_data)." WHERE user_id = 1"); - * - * Output: - * - * login = 'jv', email = 'jv@vip.ie', user_id = 1, created = NOW() - */ - - function get_set($parms) - { - $sql = ''; - foreach ( $parms as $field => $val ) - { - if ( $val === 'true' ) $val = 1; - if ( $val === 'false' ) $val = 0; - - if ( $val == 'NOW()' ) - { - $sql .= "$field = ".$this->escape($val).", "; - } - else - { - $sql .= "$field = '".$this->escape($val)."', "; - } - } - - return substr($sql,0,-2); - } - - } + const ARRAY_A = true; + + /** + * Constant boolean + */ + const ARRAY_N = true; + + /** + * same as $debug_all + * @public boolean Default is false + */ + public $trace = false; + + /** + * same as $trace + * @public boolean Default is false + */ + public $debug_all = false; + + /** + * Debug is called + * @public boolean Default is false + */ + public $debug_called = false; + + /** + * Vardump called + * @public boolean Default is false + */ + public $vardump_called = false; + + /** + * Show errors + * @public boolean Default is false + */ + private $show_errors = true; + + /** + * Number of queries + * @public int Default is 0 + */ + public $num_queries = 0; + + /** + * The last query object + * @public object Default is null + */ + public $last_query = null; + + /** + * The last error object + * @public object Default is null + */ + public $last_error = null; + + /** + * The last column info + * @var object Default is null + */ + public $col_info = null; + + /** + * Captured errors + * @var array Default is empty array + */ + public $captured_errors = array(); + + /** + * Using the cache directory + * @var boolean Default is false + */ + public $cache_dir = false; + + /** + * Caching queries + * @var boolean Default is false + */ + public $cache_queries = false; + + /** + * Insert queries into the cache + * @var boolean Default is false + */ + public $cache_inserts = false; + + /** + * Using disk cache + * @var boolean Default is false + */ + public $use_disk_cache = false; + + /** + * The cache timeout in hours + * @var integer Default is 24 + */ + public $cache_timeout = 24; + + /** + * Timers + * @var array Default is empty array + */ + public $timers = array(); + + /** + * The total query time + * @var int Default is 0 + */ + public $total_query_time = 0; + + /** + * The time it took to establish a connection + * @var int Default is 0 + */ + public $db_connect_time = 0; + + /** + * The trace log + * @var array Default is empty array + */ + public $trace_log = array(); + + /** + * Use the trace log + * @var boolean Default is false + */ + public $use_trace_log = false; + + /** + * Use a SQL log file + * @var boolean Default is false + */ + public $sql_log_file = false; + + /** + * Using profiling + * @var boolean Default is false + */ + public $do_profile = false; + + /** + * Array for storing profiling times + * @var array Default is empty array + */ + public $profile_times = array(); + + /** + * == TJH == default now needed for echo of debug function + * The default for returning errors, turn it of, if you are not + * interested in seeing your database errors + * @var boolean Default is true + */ + public $debug_echo_is_on = true; + + /** + * Constructor of ezSQL + */ + public function __construct() { + + } // __construct + + /** + * Print SQL/DB error - over-ridden by specific DB class + * + * @param $err_str string + */ + function register_error($err_str) { + // Keep track of last error + $this->last_error = $err_str; + + // Capture all errors to an error array no matter what happens + $this->captured_errors[] = array + ( + 'error_str' => $err_str, + 'query' => $this->last_query + ); + } // register_error + + /** + * Turn error handling on, by default error handling is on + */ + function show_errors() { + $this->show_errors = true; + } // show_errors + + /** + * Turn error handling off + */ + function hide_errors() { + $this->show_errors = false; + } // hide_errors + + /** + * Kill cached query results + */ + function flush() { + // Get rid of these + $this->last_result = null; + $this->col_info = null; + $this->last_query = null; + $this->from_disk_cache = false; + } // flush + + /** + * Get one variable from the DB - see docs for more detail + * + * @param $query object A query object, default is null + * @param $x int Default is 0 + * @param $y int Default is 0 + * @return variant The value of a variable + */ + function get_var($query=null, $x=0, $y=0) { + // Log how the function was called + $this->func_call = "\$db->get_var(\"$query\",$x,$y)"; + + // If there is a query then perform it if not then use cached results.. + if ( $query ) + { + $this->query($query); + } + + // Extract public out of cached results based x,y vals + if ( $this->last_result[$y] ) + { + $values = array_values(get_object_vars($this->last_result[$y])); + } + + // If there is a value return it else return null + return (isset($values[$x]) && $values[$x]!=='')?$values[$x]:null; + } // get_var + + /** + * Get one row from the DB - see docs for more detail + * + * @param object $query Default is null + * @param bolean $output Default is the OBJECT constant + * @param int $y Default is 0 + * @return type + */ + function get_row($query=null, $output=self::OBJECT, $y=0) { + // Log how the function was called + $this->func_call = "\$db->get_row(\"$query\",$output,$y)"; + + // If there is a query then perform it if not then use cached results.. + if ( $query ) + { + $this->query($query); + } + + // If the output is an object then return object using the row offset.. + if ( $output == self::OBJECT ) + { + return $this->last_result[$y]?$this->last_result[$y]:null; + } + // If the output is an associative array then return row as such.. + elseif ( $output == self::ARRAY_A ) + { + return $this->last_result[$y]?get_object_vars($this->last_result[$y]):null; + } + // If the output is an numerical array then return row as such.. + elseif ( $output == self::ARRAY_N ) + { + return $this->last_result[$y]?array_values(get_object_vars($this->last_result[$y])):null; + } + // If invalid output type was specified.. + else + { + $this->print_error(" \$db->get_row(string query, output type, int offset) -- Output type must be one of: OBJECT, ARRAY_A, ARRAY_N"); + } + + } // get_row + + /** + * Function to get 1 column from the cached result set based in + * X index + * see docs for usage and info + * + * @param object $query Default is null + * @param type $x Default is 0 + * @return array + */ + function get_col($query=null, $x=0) { + + $new_array = array(); + + // If there is a query then perform it if not then use cached results.. + if ( $query ) + { + $this->query($query); + } + + // Extract the column values + for ( $i=0; $i < count($this->last_result); $i++ ) + { + $new_array[$i] = $this->get_var(null,$x,$i); + } + + return $new_array; + } // get_col + + + /** + * Return the the query as a result set - see docs for more + * details + * + * @param object $query Default is null + * @param boolean $output Default is the OBJECT constant + * @return array + */ + function get_results($query=null, $output=self::OBJECT) { + + // Log how the function was called + $this->func_call = "\$db->get_results(\"$query\", $output)"; + + // If there is a query then perform it if not then use cached results.. + if ( $query ) + { + $this->query($query); + } + + // Send back array of objects. Each row is an object + if ( $output == self::OBJECT ) + { + return $this->last_result; + } + elseif ( $output == self::RAY_A || $output == self::ARRAY_N ) + { + if ( $this->last_result ) + { + $i=0; + foreach( $this->last_result as $row ) + { + + $new_array[$i] = get_object_vars($row); + + if ( $output == self::ARRAY_N ) + { + $new_array[$i] = array_values($new_array[$i]); + } + + $i++; + } + + return $new_array; + } + else + { + return null; + } + } + } // get_results + + + /** + * Function to get column meta data info pertaining to the last + * query + * See docs for more info and usage + * + * @param type $info_type + * @param type $col_offset + * @return type + */ + function get_col_info($info_type='name', $col_offset=-1) { + + if ( $this->col_info ) + { + if ( $col_offset == -1 ) + { + $i=0; + foreach($this->col_info as $col ) + { + $new_array[$i] = $col->{$info_type}; + $i++; + } + return $new_array; + } + else + { + return $this->col_info[$col_offset]->{$info_type}; + } + + } + + } // get_col_info + + /** + * Store the cache + * + * @param object $query + * @param boolean $is_insert + */ + function store_cache($query, $is_insert) { + + // The would be cache file for this query + $cache_file = $this->cache_dir.'/'.md5($query); + + // disk caching of queries + if ( $this->use_disk_cache && ( $this->cache_queries && ! $is_insert ) || ( $this->cache_inserts && $is_insert )) + { + if ( ! is_dir($this->cache_dir) ) + { + $this->register_error("Could not open cache dir: $this->cache_dir"); + $this->show_errors ? trigger_error("Could not open cache dir: $this->cache_dir",E_USER_WARNING) : null; + } + else + { + // Cache all result values + $result_cache = array + ( + 'col_info' => $this->col_info, + 'last_result' => $this->last_result, + 'num_rows' => $this->num_rows, + 'return_value' => $this->num_rows, + ); + error_log ( serialize($result_cache), 3, $cache_file); + } + } + + } // store_cache + + /** + * Get the query cache of a query + * + * @param object $query + * @return object + */ + function get_cache($query) { + + // The would be cache file for this query + $cache_file = $this->cache_dir.'/'.md5($query); + + // Try to get previously cached version + if ( $this->use_disk_cache && file_exists($cache_file) ) + { + // Only use this cache file if less than 'cache_timeout' (hours) + if ( (time() - filemtime($cache_file)) > ($this->cache_timeout*3600) ) + { + unlink($cache_file); + } + else + { + $result_cache = unserialize(file_get_contents($cache_file)); + + $this->col_info = $result_cache['col_info']; + $this->last_result = $result_cache['last_result']; + $this->num_rows = $result_cache['num_rows']; + + $this->from_disk_cache = true; + + // If debug ALL queries + $this->trace || $this->debug_all ? $this->debug() : null ; + + return $result_cache['return_value']; + } + } + + } // get_cache + + /** + * Dumps the contents of any input variable to screen in a nicely formatted + * and easy to understand way - any type: Object, public or Array + * + * @param variant $mixed Default is empty String + * @return string Returns HTML result + */ + function vardump($mixed='') { + + // Start outup buffering + ob_start(); + + echo "

"; + echo "
";
+
+        if ( ! $this->vardump_called )
+        {
+            echo "ezSQL (v".EZSQL_VERSION.") Variable Dump..\n\n";
+        }
+
+        $var_type = gettype ($mixed);
+        print_r(($mixed?$mixed:"No Value / False"));
+        echo "\n\nType: " . ucfirst($var_type) . "\n";
+        echo "Last Query [$this->num_queries]: ".($this->last_query?$this->last_query:"NULL")."\n";
+        echo "Last Function Call: " . ($this->func_call?$this->func_call:"None")."\n";
+        echo "Last Rows Returned: ".count($this->last_result)."\n";
+        echo "
".$this->donation(); + echo "\n


"; + + // Stop output buffering and capture debug HTML + $html = ob_get_contents(); + ob_end_clean(); + + // Only echo output if it is turned on + if ( $this->debug_echo_is_on ) + { + echo $html; + } + + $this->vardump_called = true; + + return $html; + } // vardump + + /** + * An alias for vardump method + * + * @param variant $mixed Default is empty String + * @return string Returns HTML result + */ + function dumpvar($mixed) { + return $this->vardump($mixed); + } // dumpvar + + /** + * Displays the last query string that was sent to the database & a table + * listing results (if there were any). + * (Abstracted into a seperate files to save server overhead). + * + * @param boolean $print_to_screen Default is true + * @return string The HTML result + */ + function debug($print_to_screen=true) { + // Start outup buffering + ob_start(); + + echo "
"; + + // Only show ezSQL credits once.. + if ( ! $this->debug_called ) + { + echo "ezSQL (v".EZSQL_VERSION.") Debug..

\n"; + } + + if ( $this->last_error ) + { + echo "Last Error -- [$this->last_error]

"; + } + + if ( $this->from_disk_cache ) + { + echo "Results retrieved from disk cache

"; + } + + echo "Query [$this->num_queries] -- "; + echo "[$this->last_query]

"; + + echo "Query Result.."; + echo "

"; + + if ( $this->col_info ) + { + + // ===================================================== + // Results top rows + + echo ""; + echo ""; + + + for ( $i=0; $i < count($this->col_info); $i++ ) + { + echo ""; + } + + echo ""; + + // ====================================================== + // print main results + + if ( $this->last_result ) + { + + $i=0; + foreach ( $this->get_results(null, self::ARRAY_N) as $one_row ) + { + $i++; + echo ""; + + foreach ( $one_row as $item ) + { + echo ""; + } + + echo ""; + } + + } // if last result + else + { + echo ""; + } + + echo "
(row){$this->col_info[$i]->type} {$this->col_info[$i]->max_length}
{$this->col_info[$i]->name}
$i$item
No Results
"; + + } // if col_info + else + { + echo "No Results"; + } + + echo "
".$this->donation()."
"; + + // Stop output buffering and capture debug HTML + $html = ob_get_contents(); + ob_end_clean(); + + // Only echo output if it is turned on + if ( $this->debug_echo_is_on && $print_to_screen) + { + echo $html; + } + + $this->debug_called = true; + + return $html; + } // debug + + /** + * Naughty little function to ask for some remuniration! + * + * @return string An HTML string with payment information + */ + function donation() + { + return 'If ezSQL has helped make a donation!?   '; + } // donation + + /*************************************************************************** + * Timer related functions + ***************************************************************************/ + + /** + * Get current time + * + * @return float + */ + function timer_get_cur() { + list($usec, $sec) = explode(' ',microtime()); + return ((float)$usec + (float)$sec); + } // timer_get_cur + + /** + * Start a timer by name + * + * @param string $timer_name + */ + function timer_start($timer_name) { + $this->timers[$timer_name] = $this->timer_get_cur(); + } // timer_start + + /** + * Returns the elapsed time of the given timer by name + * + * @param string $timer_name + * @return float + */ + function timer_elapsed($timer_name) { + return round($this->timer_get_cur() - $this->timers[$timer_name],2); + } // timer_elapsed + + /** + * Update the global timer with an existing timer + * + * @param string $timer_name + */ + function timer_update_global($timer_name) { + if ( $this->do_profile ) + { + $this->profile_times[] = array + ( + 'query' => $this->last_query, + 'time' => $this->timer_elapsed($timer_name) + ); + } + + $this->total_query_time += $this->timer_elapsed($timer_name); + } // timer_update_global + + /** + * Creates a SET nvp sql string from an associative array (and escapes all values) + * + * $db_data = array('login'=>'jv','email'=>'jv@vip.ie', 'user_id' => 1, 'created' => 'NOW()'); + * + * $db->query("INSERT INTO users SET ".$db->get_set($db_data)); + * + * ...OR... + * + * $db->query("UPDATE users SET ".$db->get_set($db_data)." WHERE user_id = 1"); + * + * Output: + * + * login = 'jv', email = 'jv@vip.ie', user_id = 1, created = NOW() + * + * @param array $parms + * @return string + */ + function get_set($parms) { + $sql = ''; + + foreach ( $parms as $field => $val ) { + if ( $val === 'true' ) $val = 1; + if ( $val === 'false' ) $val = 0; + + if ( $val == 'NOW()' ) + { + $sql .= "$field = ".$this->escape($val).", "; + } + else + { + $sql .= "$field = '".$this->escape($val)."', "; + } + } + + return substr($sql,0,-2); + } // get_set + +} // ezSQLcore \ No newline at end of file From 6d5a35a8767ac636943641e32854cc19903895b1 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 15:51:19 +0200 Subject: [PATCH 008/126] Because of the upgrade to PHP 5 compatibility I've changed the version to 3.0 --- shared/ez_sql_core.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/ez_sql_core.php b/shared/ez_sql_core.php index 08dbf288..2f13d640 100755 --- a/shared/ez_sql_core.php +++ b/shared/ez_sql_core.php @@ -15,7 +15,7 @@ class ezSQLcore { /** * Constant string ezSQL version information */ - const EZSQL_VERSION = '2.15'; + const EZSQL_VERSION = '3.0'; /** * Constant boolean Object From c3e7fbdc5bed2b0fd28d66c1c358d4cd92d81db8 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 16:00:24 +0200 Subject: [PATCH 009/126] Changed doc tags for class variables from @public to @var --- shared/ez_sql_core.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/shared/ez_sql_core.php b/shared/ez_sql_core.php index 2f13d640..f9fd680b 100755 --- a/shared/ez_sql_core.php +++ b/shared/ez_sql_core.php @@ -34,13 +34,13 @@ class ezSQLcore { /** * same as $debug_all - * @public boolean Default is false + * @var boolean Default is false */ public $trace = false; /** * same as $trace - * @public boolean Default is false + * @var boolean Default is false */ public $debug_all = false; @@ -52,7 +52,7 @@ class ezSQLcore { /** * Vardump called - * @public boolean Default is false + * @var boolean Default is false */ public $vardump_called = false; @@ -64,19 +64,19 @@ class ezSQLcore { /** * Number of queries - * @public int Default is 0 + * @var int Default is 0 */ public $num_queries = 0; /** * The last query object - * @public object Default is null + * @var object Default is null */ public $last_query = null; /** * The last error object - * @public object Default is null + * @var object Default is null */ public $last_error = null; From 06e401e3e2be822e306825b25e986e4875ce5ace Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 16:29:02 +0200 Subject: [PATCH 010/126] Removed trailing spaces. --- mysql/ez_sql_mysql.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql/ez_sql_mysql.php b/mysql/ez_sql_mysql.php index c340b238..7f583aea 100755 --- a/mysql/ez_sql_mysql.php +++ b/mysql/ez_sql_mysql.php @@ -98,7 +98,7 @@ function connect($dbuser='', $dbpassword='', $dbhost='localhost', $charset='') { $this->charset = $charset; } - + mysql_set_charset($this->charset, $this->dbh); $return_val = true; } @@ -278,7 +278,7 @@ function query($query) return $return_val; } - + /** * Close the database connection */ From fc1c2911762c67f454d92340f17da19e4fa760f8 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 17:12:46 +0200 Subject: [PATCH 011/126] - Changed the core class to PHP 5 syntax. - Cleared parameter formats from mixed commaspace / comma to comma space. - Added PHPDoc documentation tags and extended the documentation - Changed the escape method to get a real escape for MS SQL Server --- mssql/ez_sql_mssql.php | 781 +++++++++++++++++++++-------------------- 1 file changed, 395 insertions(+), 386 deletions(-) diff --git a/mssql/ez_sql_mssql.php b/mssql/ez_sql_mssql.php index e6af6e0f..d4e5b614 100755 --- a/mssql/ez_sql_mssql.php +++ b/mssql/ez_sql_mssql.php @@ -1,387 +1,396 @@ 'Require $dbuser and $dbpassword to connect to a database server', - 2 => 'Error establishing mssql database connection. Correct user/password? Correct hostname? Database server running?', - 3 => 'Require $dbname to select a database', - 4 => 'SQL Server database connection is not active', - 5 => 'Unexpected error while trying to select database' - ); - - /********************************************************************** - * ezSQL Database specific class - mssql - */ - - if ( ! function_exists ('mssql_connect') ) die('Fatal Error: ezSQL_mssql requires ntwdblib.dll to be present in your winowds\system32 folder. Also enable MS-SQL extenstion in PHP.ini file '); - if ( ! class_exists ('ezSQLcore') ) die('Fatal Error: ezSQL_mssql requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); - - class ezSQL_mssql extends ezSQLcore - { - - var $dbuser = false; - var $dbpassword = false; - var $dbname = false; - var $dbhost = false; - //if we want to convert Queries in MySql syntax to MS-SQL syntax. Yes, there - //are some differences in query syntax. - var $convertMySqlToMSSqlQuery = TRUE; - - /********************************************************************** - * Constructor - allow the user to perform a qucik connect at the - * same time as initialising the ezSQL_mssql class - */ - - function ezSQL_mssql($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $convertMySqlToMSSqlQuery=true) - { - $this->dbuser = $dbuser; - $this->dbpassword = $dbpassword; - $this->dbname = $dbname; - $this->dbhost = $dbhost; - $this->convertMySqlToMSSqlQuery = $convertMySqlToMSSqlQuery; - } - - /********************************************************************** - * Short hand way to connect to mssql database server - * and select a mssql database at the same time - */ - - function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') - { - $return_val = false; - if ( ! $this->connect($dbuser, $dbpassword, $dbhost,true) ) ; - else if ( ! $this->select($dbname) ) ; - else $return_val = true; - return $return_val; - } - - /********************************************************************** - * Try to connect to mssql database server - */ - - function connect($dbuser='', $dbpassword='', $dbhost='localhost') - { - global $ezsql_mssql_str; $return_val = false; - - // Must have a user and a password - if ( ! $dbuser ) - { - $this->register_error($ezsql_mssql_str[1].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_mssql_str[1],E_USER_WARNING) : null; - } - // Try to establish the server database handle - - else if ( ! $this->dbh = @mssql_connect($dbhost,$dbuser,$dbpassword) ) - { - $this->register_error($ezsql_mssql_str[2].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_mssql_str[2],E_USER_WARNING) : null; - } - else - { - $this->dbuser = $dbuser; - $this->dbpassword = $dbpassword; - $this->dbhost = $dbhost; - $return_val = true; - } - - return $return_val; - } - - /********************************************************************** - * Try to select a mssql database - */ - - function select($dbname='') - { - global $ezsql_mssql_str; $return_val = false; - - // Must have a database name - if ( ! $dbname ) - { - $this->register_error($ezsql_mssql_str[3].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_mssql_str[3],E_USER_WARNING) : null; - } - - // Must have an active database connection - else if ( ! $this->dbh ) - { - $this->register_error($ezsql_mssql_str[4].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_mssql_str[4],E_USER_WARNING) : null; - } - - // Try to connect to the database - - else if ( !@mssql_select_db($dbname,$this->dbh) ) - { - $str = $ezsql_mssql_str[5]; - - $this->register_error($str.' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($str,E_USER_WARNING) : null; - } - else - { - $this->dbname = $dbname; - $return_val = true; - } - - return $return_val; - } - - /********************************************************************** - * Format a mssql string correctly for safe mssql insert - * (no mater if magic quotes are on or not) - */ - - function escape($str) - { - //not sure about this. - //applying following logic - //1. add 1 more ' to ' character - - return str_ireplace("'", "''", $str); - - } - - /********************************************************************** - * Return mssql specific system date syntax - * i.e. Oracle: SYSDATE mssql: NOW(), MS-SQL : getDate() - */ - - function sysdate() - { - return 'getDate()'; - } - - /********************************************************************** - * Perform mssql query and try to detirmin result value - */ - - function query($query) - { - - //if flag to convert query from MySql syntax to MS-Sql syntax is true - //convert the query - if($this->convertMySqlToMSSqlQuery == true) - $query = $this->ConvertMySqlToMSSql($query); - - - - // Initialise return - $return_val = 0; - - - // Flush cached values.. - $this->flush(); - - // For reg expressions - $query = trim($query); - - // Log how the function was called - $this->func_call = "\$db->query(\"$query\")"; - - // Keep track of the last query for debug.. - $this->last_query = $query; - - // Count how many queries there have been - $this->num_queries++; - - // Use core file cache function - if ( $cache = $this->get_cache($query) ) - { - return $cache; - } - - - // If there is no existing database connection then try to connect - if ( ! isset($this->dbh) || ! $this->dbh ) - { - $this->connect($this->dbuser, $this->dbpassword, $this->dbhost); - $this->select($this->dbname); - } - - - - - // Perform the query via std mssql_query function.. - - $this->result = @mssql_query($query); - - - - // If there is an error then take note of it.. - if ($this->result == false ) - { - - $get_errorcodeSql = "SELECT @@ERROR as errorcode"; - $error_res = @mssql_query($get_errorcodeSql, $this->dbh); - $errorCode = @mssql_result($error_res, 0, "errorcode"); - - $get_errorMessageSql = "SELECT severity as errorSeverity, text as errorText FROM sys.messages WHERE message_id = ".$errorCode ; - $errormessage_res = @mssql_query($get_errorMessageSql, $this->dbh); - if($errormessage_res) - { - $errorMessage_Row = @mssql_fetch_row($errormessage_res); - $errorSeverity = $errorMessage_Row[0]; - $errorMessage = $errorMessage_Row[1]; - } - - $sqlError = "ErrorCode: ".$errorCode." ### Error Severity: ".$errorSeverity." ### Error Message: ".$errorMessage." ### Query: ".$query; - - $is_insert = true; - $this->register_error($sqlError); - $this->show_errors ? trigger_error($sqlError ,E_USER_WARNING) : null; - return false; - } - - - - - // Query was an insert, delete, update, replace - $is_insert = false; - if ( preg_match("/^(insert|delete|update|replace)\s+/i",$query) ) - { - $this->rows_affected = @mssql_rows_affected($this->dbh); - - // Take note of the insert_id - if ( preg_match("/^(insert|replace)\s+/i",$query) ) - { - - $identityresultset = @mssql_query("select SCOPE_IDENTITY()"); - - if ($identityresultset != false ) - { - $identityrow = @mssql_fetch_row($identityresultset); - $this->insert_id = $identityrow[0]; - } - - } - - // Return number of rows affected - $return_val = $this->rows_affected; - } - // Query was a select - else - { - - // Take note of column info - $i=0; - while ($i < @mssql_num_fields($this->result)) - { - $this->col_info[$i] = @mssql_fetch_field($this->result); - $i++; - - } - - // Store Query Results - $num_rows=0; - - while ( $row = @mssql_fetch_object($this->result) ) - { - - // Store relults as an objects within main array - $this->last_result[$num_rows] = $row; - $num_rows++; - } - - @mssql_free_result($this->result); - - // Log number of rows the query returned - $this->num_rows = $num_rows; - - // Return number of rows selected - $return_val = $this->num_rows; - } - - // disk caching of queries - $this->store_cache($query,$is_insert); - - // If debug ALL queries - $this->trace || $this->debug_all ? $this->debug() : null ; - - return $return_val; - - } - - - - /********************************************************************** - * Convert a Query From MySql Syntax to MS-Sql syntax - Following conversions are made:- - 1. The '`' character used for MySql queries is not supported - the character is removed. - 2. FROM_UNIXTIME method is not supported. The Function is removed.It is replaced with - getDate(). Warning: This logic may not be right. - 3. unix_timestamp function is removed. - 4. LIMIT keyowrd is replaced with TOP keyword. Warning: Logic not fully tested. - - Note: This method is only a small attempt to convert the syntax. There are many aspects which are not covered here. - This method doesn't at all guarantee complete conversion. Certain queries will still - not work. e.g. MS SQL requires all columns in Select Clause to be present in 'group by' clause. - There is no such restriction in MySql. - */ - - function ConvertMySqlToMSSql($query) - { - - - //replace the '`' character used for MySql queries, but not - //supported in MS-Sql - - $query = str_replace("`", "", $query); - - //replace From UnixTime command in MS-Sql, doesn't work - - $pattern = "FROM_UNIXTIME\(([^/]{0,})\)"; - $replacement = "getdate()"; - //ereg($pattern, $query, $regs); - //we can get the Unix Time function parameter value from this string - //$valueInsideFromUnixTime = $regs[1]; - - $query = eregi_replace($pattern, $replacement, $query); - - - //replace LIMIT keyword. Works only on MySql not on MS-Sql - //replace it with TOP keyword - - $pattern = "LIMIT[^\w]{1,}([0-9]{1,})([\,]{0,})([0-9]{0,})"; - $replacement = ""; - eregi($pattern, $query, $regs); - $query = eregi_replace($pattern, $replacement, $query); - - if($regs[2]) - $query = str_ireplace("SELECT ", "SELECT TOP ".$regs[3]." ", $query); - else - { - if($regs[1]) - $query = str_ireplace("SELECT ", "SELECT TOP ".$regs[1]." ", $query); - } - - - //replace unix_timestamp function. Doesn't work in MS-Sql - $pattern = "unix_timestamp\(([^/]{0,})\)"; - $replacement = "\\1"; - $query = eregi_replace($pattern, $replacement, $query); - - return $query; - - } - - - - - } - - -?> +/** + * ezSQL Database specific class - mssql + * Microsoft Sql Server component (part of ezSQL databse abstraction library) - + * based on ezSql_mySql library class. + * + * @author ashank (ashank@gmail.com) + * @author Stefanie Janine Stoelting (mail@stefanie-stoelting.de) + * @link http://twitter.com/justinvincent + * @name ezSQL_mssql + * @package ezSQL + */ +class ezSQL_mssql extends ezSQLcore { + /** + * ezSQL error strings - mssql + * @var array Default 5 error messages + */ + private $ezsql_mssql_str = array + ( + 1 => 'Require $dbuser and $dbpassword to connect to a database server', + 2 => 'Error establishing mssql database connection. Correct user/password? Correct hostname? Database server running?', + 3 => 'Require $dbname to select a database', + 4 => 'SQL Server database connection is not active', + 5 => 'Unexpected error while trying to select database' + ); + + /** + * Database user name + * @var string + */ + private $dbuser; + + /** + * Database password for the given user + * @var string + */ + private $dbpassword; + + /** + * Database name + * @var string + */ + private $dbname; + + /** + * Host name or IP address + * @var string + */ + private $dbhost; + + /** + * If we want to convert Queries in MySql syntax to MS-SQL syntax. Yes, + * there are some differences in query syntax. + * @var boolean Default is true + */ + private $convertMySqlToMSSqlQuery = true; + + /** + * Constructor - allow the user to perform a qucik connect at the same time + * as initialising the ezSQL_mssql class + * + * @param string $dbuser The database user name + * @param string $dbpassword The database users password + * @param string $dbname The name of the database + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @param boolean $convertMySqlToMSSqlQuery Default is true + * @throws Exception Requires ntwdblib.dll and ez_sql_core.php + */ + public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $convertMySqlToMSSqlQuery=true) { + parent::__construct(); + + if ( ! function_exists ('mssql_connect') ) { + throw new Exception('Fatal Error: ezSQL_mssql requires ntwdblib.dll to be present in your winowds\system32 folder. Also enable MS-SQL extenstion in PHP.ini file '); + } + if ( ! class_exists ('ezSQLcore') ) { + throw new Exception('Fatal Error: ezSQL_mssql requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); + } + + $this->dbuser = $dbuser; + $this->dbpassword = $dbpassword; + $this->dbname = $dbname; + $this->dbhost = $dbhost; + $this->convertMySqlToMSSqlQuery = $convertMySqlToMSSqlQuery; + } // __construct + + /** + * Short hand way to connect to mssql database server and select a mssql + * database at the same time + * + * @param string $dbuser The database user name + * @param string $dbpassword The database users password + * @param string $dbname The name of the database + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @return boolean + */ + function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') { + $return_val = false; + if ( ! $this->connect($dbuser, $dbpassword, $dbhost,true) ) ; + else if ( ! $this->select($dbname) ) ; + else $return_val = true; + return $return_val; + } // quick_connect + + /** + * Try to connect to mssql database server + * + * @param string $dbuser The database user name + * @param string $dbpassword The database users password + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @return boolean + */ + function connect($dbuser='', $dbpassword='', $dbhost='localhost') { + $return_val = false; + + // Must have a user and a password + if ( ! $dbuser ) + { + $this->register_error($this->ezsql_mssql_str[1] . ' in ' . __FILE__ . ' on line ' .__LINE__); + $this->show_errors ? trigger_error($this->ezsql_mssql_str[1], E_USER_WARNING) : null; + } else if ( ! $this->dbh = @mssql_connect($dbhost, $dbuser, $dbpassword) ) { + // Try to establish the server database handle + $this->register_error($this->ezsql_mssql_str[2] . ' in ' .__FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_mssql_str[2], E_USER_WARNING) : null; + } else { + $this->dbuser = $dbuser; + $this->dbpassword = $dbpassword; + $this->dbhost = $dbhost; + $return_val = true; + } + + return $return_val; + } // connect + + /** + * Try to select a mssql database + * + * @param string $dbname The name of the database + * @return boolean + */ + function select($dbname='') { + $return_val = false; + + if ( ! $dbname ) { + // Must have a database name + $this->register_error($this->ezsql_mssql_str[3] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_mssql_str[3], E_USER_WARNING) : null; + } else if ( ! $this->dbh ) { + // Must have an active database connection + $this->register_error($this->ezsql_mssql_str[4] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_mssql_str[4], E_USER_WARNING) : null; + } else if ( !@mssql_select_db($dbname,$this->dbh) ) { + // Try to connect to the database + $str = $this->ezsql_mssql_str[5]; + + $this->register_error($str . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($str, E_USER_WARNING) : null; + } else { + $this->dbname = $dbname; + $return_val = true; + } + + return $return_val; + } // select + + /** + * Format a mssql string correctly for safe mssql insert + * + * @param string $str + * @return string + */ + function escape($str) { + $return_val = ''; + + if ( !isset($str) or empty($str) ) { + $return_val = ''; + } else if ( is_numeric($str) ) { + $return_val = $str; + } else { + $non_displayables = array( + '/%0[0-8bcef]/', // url encoded 00-08, 11, 12, 14, 15 + '/%1[0-9a-f]/', // url encoded 16-31 + '/[\x00-\x08]/', // 00-08 + '/\x0b/', // 11 + '/\x0c/', // 12 + '/[\x0e-\x1f]/' // 14-31 + ); + + foreach ( $non_displayables as $regex ) { + $str = preg_replace( $regex, '', $str ); + } + + $return_val = str_replace("'", "''", $str ); + } + + return $return_val; + } // escape + + /** + * Return mssql specific system date syntax + * i.e. Oracle: SYSDATE mssql: NOW(), MS-SQL : getDate() + * + * @return string + */ + function sysdate() { + return 'getDate()'; + } // sysdate + + + /** + * Perform the mssql query and try to determine the result value + * + * @param string $query + * @return boolean + */ + function query($query) { + + //if flag to convert query from MySql syntax to MS-Sql syntax is true + //convert the query + if($this->convertMySqlToMSSqlQuery == true) { + $query = $this->ConvertMySqlToMSSql($query); + } + + // Initialise return + $return_val = 0; + + // Flush cached values.. + $this->flush(); + + // For reg expressions + $query = trim($query); + + // Log how the function was called + $this->func_call = "\$db->query(\"$query\")"; + + // Keep track of the last query for debug.. + $this->last_query = $query; + + // Count how many queries there have been + $this->num_queries++; + + // Use core file cache function + if ( $cache = $this->get_cache($query) ) { + return $cache; + } + + + // If there is no existing database connection then try to connect + if ( ! isset($this->dbh) || ! $this->dbh ) { + $this->connect($this->dbuser, $this->dbpassword, $this->dbhost); + $this->select($this->dbname); + } + + // Perform the query via std mssql_query function.. + + $this->result = @mssql_query($query); + + // If there is an error then take note of it.. + if ($this->result == false ) { + + $get_errorcodeSql = "SELECT @@ERROR as errorcode"; + $error_res = @mssql_query($get_errorcodeSql, $this->dbh); + $errorCode = @mssql_result($error_res, 0, "errorcode"); + + $get_errorMessageSql = "SELECT severity as errorSeverity, text as errorText FROM sys.messages WHERE message_id = ".$errorCode ; + $errormessage_res = @mssql_query($get_errorMessageSql, $this->dbh); + if($errormessage_res) + { + $errorMessage_Row = @mssql_fetch_row($errormessage_res); + $errorSeverity = $errorMessage_Row[0]; + $errorMessage = $errorMessage_Row[1]; + } + + $sqlError = "ErrorCode: ".$errorCode." ### Error Severity: ".$errorSeverity." ### Error Message: ".$errorMessage." ### Query: ".$query; + + $is_insert = true; + $this->register_error($sqlError); + $this->show_errors ? trigger_error($sqlError ,E_USER_WARNING) : null; + return false; + } + + // Query was an insert, delete, update, replace + $is_insert = false; + if ( preg_match("/^(insert|delete|update|replace)\s+/i",$query) ) { + $this->rows_affected = @mssql_rows_affected($this->dbh); + + // Take note of the insert_id + if ( preg_match("/^(insert|replace)\s+/i",$query) ) { + + $identityresultset = @mssql_query("select SCOPE_IDENTITY()"); + + if ($identityresultset != false ) { + $identityrow = @mssql_fetch_row($identityresultset); + $this->insert_id = $identityrow[0]; + } + } + + // Return number of rows affected + $return_val = $this->rows_affected; + } else { + // Query was a select + + // Take note of column info + $i=0; + while ($i < @mssql_num_fields($this->result)) { + $this->col_info[$i] = @mssql_fetch_field($this->result); + $i++; + } + + // Store Query Results + $num_rows=0; + + while ( $row = @mssql_fetch_object($this->result) ) { + // Store relults as an objects within main array + $this->last_result[$num_rows] = $row; + $num_rows++; + } + + @mssql_free_result($this->result); + + // Log number of rows the query returned + $this->num_rows = $num_rows; + + // Return number of rows selected + $return_val = $this->num_rows; + } + + // disk caching of queries + $this->store_cache($query,$is_insert); + + // If debug ALL queries + $this->trace || $this->debug_all ? $this->debug() : null ; + + return $return_val; + } // query + + /** + * Convert a Query From MySql Syntax to MS-Sql syntax + * Following conversions are made: + * 1. The '`' character used for MySql queries is not supported - + * the character is removed. + * 2. FROM_UNIXTIME method is not supported. The Function is removed.It is + * replaced with getDate(). Warning: This logic may not be right. + * 3. unix_timestamp function is removed. + * 4. LIMIT keyowrd is replaced with TOP keyword. Warning: Logic not fully + * tested. + * + * Note: This method is only a small attempt to convert the syntax. There + * are many aspects which are not covered here. + * This method doesn't at all guarantee complete conversion. Certain + * queries will still not work. e.g. MS SQL requires all columns in + * Select Clause to be present in 'group by' clause. + * There is no such restriction in MySql. + * + * @param string $query + * @return string + */ + function ConvertMySqlToMSSql($query) { + // replace the '`' character used for MySql queries, but not + // supported in MS-Sql + + $query = str_replace('`', '', $query); + + // replace From UnixTime command in MS-Sql, doesn't work + $pattern = "FROM_UNIXTIME\(([^/]{0,})\)"; + $replacement = 'getdate()'; + //ereg($pattern, $query, $regs); + //we can get the Unix Time function parameter value from this string + //$valueInsideFromUnixTime = $regs[1]; + + $query = eregi_replace($pattern, $replacement, $query); + + // replace LIMIT keyword. Works only on MySql not on MS-Sql + // replace it with TOP keyword + $pattern = "LIMIT[^\w]{1,}([0-9]{1,})([\,]{0,})([0-9]{0,})"; + $replacement = ""; + eregi($pattern, $query, $regs); + $query = eregi_replace($pattern, $replacement, $query); + + if ( $regs[2] ) { + $query = str_ireplace('SELECT ', 'SELECT TOP ' . $regs[3] . ' ', $query); + } else if ( $regs[1] ) { + $query = str_ireplace('SELECT ', 'SELECT TOP ' . $regs[1] . ' ', $query); + } + + //replace unix_timestamp function. Doesn't work in MS-Sql + $pattern = "unix_timestamp\(([^/]{0,})\)"; + $replacement = "\\1"; + $query = eregi_replace($pattern, $replacement, $query); + + return $query; + } // ConvertMySqlToMSSql + +} // ezSQL_mssql \ No newline at end of file From 117964aa40656f722a64a1bf3e56c5245a64023d Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 17:21:39 +0200 Subject: [PATCH 012/126] Added PHPDoc license tag. --- mssql/ez_sql_mssql.php | 1 + 1 file changed, 1 insertion(+) diff --git a/mssql/ez_sql_mssql.php b/mssql/ez_sql_mssql.php index d4e5b614..d3c4cfe1 100755 --- a/mssql/ez_sql_mssql.php +++ b/mssql/ez_sql_mssql.php @@ -9,6 +9,7 @@ * @link http://twitter.com/justinvincent * @name ezSQL_mssql * @package ezSQL + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) */ class ezSQL_mssql extends ezSQLcore { /** From 59142a153b15e529e86ad7413fd2b89d1e2455b3 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 17:41:38 +0200 Subject: [PATCH 013/126] - Added PHPDoc license tag. - Changed formatting to fit standards - Methods with public --- shared/ez_sql_core.php | 552 +++++++++++++++++++---------------------- 1 file changed, 250 insertions(+), 302 deletions(-) diff --git a/shared/ez_sql_core.php b/shared/ez_sql_core.php index f9fd680b..94516657 100755 --- a/shared/ez_sql_core.php +++ b/shared/ez_sql_core.php @@ -1,196 +1,196 @@ last_error = $err_str; @@ -203,23 +203,23 @@ function register_error($err_str) { } // register_error /** - * Turn error handling on, by default error handling is on - */ - function show_errors() { + * Turn error handling on, by default error handling is on + */ + public function show_errors() { $this->show_errors = true; } // show_errors /** - * Turn error handling off - */ - function hide_errors() { + * Turn error handling off + */ + public function hide_errors() { $this->show_errors = false; } // hide_errors /** - * Kill cached query results - */ - function flush() { + * Kill cached query results + */ + public function flush() { // Get rid of these $this->last_result = null; $this->col_info = null; @@ -228,26 +228,24 @@ function flush() { } // flush /** - * Get one variable from the DB - see docs for more detail - * - * @param $query object A query object, default is null - * @param $x int Default is 0 - * @param $y int Default is 0 - * @return variant The value of a variable - */ - function get_var($query=null, $x=0, $y=0) { + * Get one variable from the DB - see docs for more detail + * + * @param $query object A query object, default is null + * @param $x int Default is 0 + * @param $y int Default is 0 + * @return variant The value of a variable + */ + public function get_var($query=null, $x=0, $y=0) { // Log how the function was called $this->func_call = "\$db->get_var(\"$query\",$x,$y)"; // If there is a query then perform it if not then use cached results.. - if ( $query ) - { + if ( $query ) { $this->query($query); } // Extract public out of cached results based x,y vals - if ( $this->last_result[$y] ) - { + if ( $this->last_result[$y] ) { $values = array_values(get_object_vars($this->last_result[$y])); } @@ -257,68 +255,59 @@ function get_var($query=null, $x=0, $y=0) { /** * Get one row from the DB - see docs for more detail - * + * * @param object $query Default is null * @param bolean $output Default is the OBJECT constant * @param int $y Default is 0 - * @return type + * @return type */ - function get_row($query=null, $output=self::OBJECT, $y=0) { + public function get_row($query=null, $output=self::OBJECT, $y=0) { // Log how the function was called $this->func_call = "\$db->get_row(\"$query\",$output,$y)"; // If there is a query then perform it if not then use cached results.. - if ( $query ) - { + if ( $query ) { $this->query($query); } // If the output is an object then return object using the row offset.. - if ( $output == self::OBJECT ) - { - return $this->last_result[$y]?$this->last_result[$y]:null; + if ( $output == self::OBJECT ) { + return $this->last_result[$y] ? $this->last_result[$y] : null; } // If the output is an associative array then return row as such.. - elseif ( $output == self::ARRAY_A ) - { - return $this->last_result[$y]?get_object_vars($this->last_result[$y]):null; - } - // If the output is an numerical array then return row as such.. - elseif ( $output == self::ARRAY_N ) - { + elseif ( $output == self::ARRAY_A ) { + return $this->last_result[$y] ? get_object_vars($this->last_result[$y]) : null; + } elseif ( $output == self::ARRAY_N ) { + // If the output is an numerical array then return row as such.. return $this->last_result[$y]?array_values(get_object_vars($this->last_result[$y])):null; - } - // If invalid output type was specified.. - else - { + } else { + // If invalid output type was specified.. $this->print_error(" \$db->get_row(string query, output type, int offset) -- Output type must be one of: OBJECT, ARRAY_A, ARRAY_N"); } } // get_row /** - * Function to get 1 column from the cached result set based in - * X index - * see docs for usage and info - * - * @param object $query Default is null - * @param type $x Default is 0 - * @return array - */ - function get_col($query=null, $x=0) { + * Function to get 1 column from the cached result set based in + * X index + * see docs for usage and info + * + * @param object $query Default is null + * @param type $x Default is 0 + * @return array + */ + public function get_col($query=null, $x=0) { $new_array = array(); // If there is a query then perform it if not then use cached results.. - if ( $query ) - { + if ( $query ) { $this->query($query); } // Extract the column values - for ( $i=0; $i < count($this->last_result); $i++ ) - { - $new_array[$i] = $this->get_var(null,$x,$i); + for ( $i=0; $i < count($this->last_result); $i++ ) { + $new_array[$i] = $this->get_var(null, $x, $i); } return $new_array; @@ -326,41 +315,34 @@ function get_col($query=null, $x=0) { /** - * Return the the query as a result set - see docs for more - * details - * - * @param object $query Default is null - * @param boolean $output Default is the OBJECT constant - * @return array - */ - function get_results($query=null, $output=self::OBJECT) { + * Return the the query as a result set - see docs for more + * details + * + * @param object $query Default is null + * @param boolean $output Default is the OBJECT constant + * @return array + */ + public function get_results($query=null, $output=self::OBJECT) { // Log how the function was called $this->func_call = "\$db->get_results(\"$query\", $output)"; // If there is a query then perform it if not then use cached results.. - if ( $query ) - { + if ( $query ) { $this->query($query); } // Send back array of objects. Each row is an object - if ( $output == self::OBJECT ) - { + if ( $output == self::OBJECT ) { return $this->last_result; - } - elseif ( $output == self::RAY_A || $output == self::ARRAY_N ) - { - if ( $this->last_result ) - { + } elseif ( $output == self::RAY_A || $output == self::ARRAY_N ) { + if ( $this->last_result ) { $i=0; - foreach( $this->last_result as $row ) - { + foreach( $this->last_result as $row ) { $new_array[$i] = get_object_vars($row); - if ( $output == self::ARRAY_N ) - { + if ( $output == self::ARRAY_N ) { $new_array[$i] = array_values($new_array[$i]); } @@ -368,9 +350,7 @@ function get_results($query=null, $output=self::OBJECT) { } return $new_array; - } - else - { + } else { return null; } } @@ -378,93 +358,77 @@ function get_results($query=null, $output=self::OBJECT) { /** - * Function to get column meta data info pertaining to the last - * query - * See docs for more info and usage - * - * @param type $info_type - * @param type $col_offset - * @return type - */ - function get_col_info($info_type='name', $col_offset=-1) { + * Function to get column meta data info pertaining to the last + * query + * See docs for more info and usage + * + * @param type $info_type + * @param type $col_offset + * @return type + */ + public function get_col_info($info_type='name', $col_offset=-1) { - if ( $this->col_info ) - { - if ( $col_offset == -1 ) - { + if ( $this->col_info ) { + if ( $col_offset == -1 ) { $i=0; - foreach($this->col_info as $col ) - { + foreach($this->col_info as $col ) { $new_array[$i] = $col->{$info_type}; $i++; } return $new_array; - } - else - { + } else { return $this->col_info[$col_offset]->{$info_type}; } - } } // get_col_info /** - * Store the cache - * - * @param object $query - * @param boolean $is_insert - */ - function store_cache($query, $is_insert) { + * Store the cache + * + * @param object $query + * @param boolean $is_insert + */ + public function store_cache($query, $is_insert) { // The would be cache file for this query $cache_file = $this->cache_dir.'/'.md5($query); // disk caching of queries - if ( $this->use_disk_cache && ( $this->cache_queries && ! $is_insert ) || ( $this->cache_inserts && $is_insert )) - { - if ( ! is_dir($this->cache_dir) ) - { + if ( $this->use_disk_cache && ( $this->cache_queries && ! $is_insert ) || ( $this->cache_inserts && $is_insert )) { + if ( ! is_dir($this->cache_dir) ) { $this->register_error("Could not open cache dir: $this->cache_dir"); $this->show_errors ? trigger_error("Could not open cache dir: $this->cache_dir",E_USER_WARNING) : null; - } - else - { + } else { // Cache all result values $result_cache = array - ( - 'col_info' => $this->col_info, - 'last_result' => $this->last_result, - 'num_rows' => $this->num_rows, - 'return_value' => $this->num_rows, - ); + ( + 'col_info' => $this->col_info, + 'last_result' => $this->last_result, + 'num_rows' => $this->num_rows, + 'return_value' => $this->num_rows, + ); error_log ( serialize($result_cache), 3, $cache_file); } } - } // store_cache /** * Get the query cache of a query - * + * * @param object $query * @return object */ - function get_cache($query) { - + public function get_cache($query) { // The would be cache file for this query $cache_file = $this->cache_dir.'/'.md5($query); // Try to get previously cached version - if ( $this->use_disk_cache && file_exists($cache_file) ) - { + if ( $this->use_disk_cache && file_exists($cache_file) ) { // Only use this cache file if less than 'cache_timeout' (hours) - if ( (time() - filemtime($cache_file)) > ($this->cache_timeout*3600) ) - { + if ( (time() - filemtime($cache_file)) > ($this->cache_timeout*3600) ) { unlink($cache_file); - } - else - { + } else { $result_cache = unserialize(file_get_contents($cache_file)); $this->col_info = $result_cache['col_info']; @@ -479,26 +443,23 @@ function get_cache($query) { return $result_cache['return_value']; } } - } // get_cache /** - * Dumps the contents of any input variable to screen in a nicely formatted + * Dumps the contents of any input variable to screen in a nicely formatted * and easy to understand way - any type: Object, public or Array - * + * * @param variant $mixed Default is empty String * @return string Returns HTML result */ - function vardump($mixed='') { - + public function vardump($mixed='') { // Start outup buffering ob_start(); echo "

"; - for ( $i=0; $i < count($this->col_info); $i++ ) - { + for ( $i=0; $i < count($this->col_info); $i++ ) { echo ""; } @@ -592,34 +547,29 @@ function debug($print_to_screen=true) { // ====================================================== // print main results - if ( $this->last_result ) - { + if ( $this->last_result ) { $i=0; - foreach ( $this->get_results(null, self::ARRAY_N) as $one_row ) - { + foreach ( $this->get_results(null, self::ARRAY_N) as $one_row ) { $i++; echo ""; - foreach ( $one_row as $item ) - { + foreach ( $one_row as $item ) { echo ""; } echo ""; } - } // if last result - else - { + } else { + // if last result echo ""; } echo "
"; echo "
";
 
-        if ( ! $this->vardump_called )
-        {
+        if ( ! $this->vardump_called ) {
             echo "ezSQL (v".EZSQL_VERSION.") Variable Dump..\n\n";
         }
 
@@ -516,8 +477,7 @@ function vardump($mixed='') {
         ob_end_clean();
 
         // Only echo output if it is turned on
-        if ( $this->debug_echo_is_on )
-        {
+        if ( $this->debug_echo_is_on ) {
             echo $html;
         }
 
@@ -528,52 +488,48 @@ function vardump($mixed='') {
 
     /**
      * An alias for vardump method
-     * 
+     *
      * @param variant $mixed Default is empty String
      * @return string Returns HTML result
      */
-    function dumpvar($mixed) {
+    public function dumpvar($mixed) {
         return $this->vardump($mixed);
     } // dumpvar
 
     /**
-     * Displays the last query string that was sent to the database & a table 
+     * Displays the last query string that was sent to the database & a table
      * listing results (if there were any).
      * (Abstracted into a seperate files to save server overhead).
-     * 
+     *
      * @param boolean $print_to_screen Default is true
      * @return string The HTML result
      */
-    function debug($print_to_screen=true) {
+    public function debug($print_to_screen=true) {
         // Start outup buffering
         ob_start();
 
         echo "
"; // Only show ezSQL credits once.. - if ( ! $this->debug_called ) - { + if ( ! $this->debug_called ) { echo "ezSQL (v".EZSQL_VERSION.") Debug..

\n"; } - if ( $this->last_error ) - { + if ( $this->last_error ) { echo "Last Error -- [$this->last_error]

"; } - if ( $this->from_disk_cache ) - { + if ( $this->from_disk_cache ) { echo "Results retrieved from disk cache

"; } echo "Query [$this->num_queries] -- "; echo "[$this->last_query]

"; - echo "Query Result.."; - echo "

"; + echo "Query Result.."; + echo "
"; - if ( $this->col_info ) - { + if ( $this->col_info ) { // ===================================================== // Results top rows @@ -582,8 +538,7 @@ function debug($print_to_screen=true) { echo "
(row){$this->col_info[$i]->type} {$this->col_info[$i]->max_length}
{$this->col_info[$i]->name}
$i$item
No Results
"; - } // if col_info - else - { + } else { + // if col_info echo "No Results"; } @@ -630,8 +580,7 @@ function debug($print_to_screen=true) { ob_end_clean(); // Only echo output if it is turned on - if ( $this->debug_echo_is_on && $print_to_screen) - { + if ( $this->debug_echo_is_on && $print_to_screen) { echo $html; } @@ -642,11 +591,10 @@ function debug($print_to_screen=true) { /** * Naughty little function to ask for some remuniration! - * + * * @return string An HTML string with payment information */ - function donation() - { + public public function donation() { return 'If ezSQL has helped make a donation!?   '; } // donation @@ -656,46 +604,45 @@ function donation() /** * Get current time - * + * * @return float */ - function timer_get_cur() { + public function timer_get_cur() { list($usec, $sec) = explode(' ',microtime()); return ((float)$usec + (float)$sec); } // timer_get_cur /** * Start a timer by name - * - * @param string $timer_name + * + * @param string $timer_name */ - function timer_start($timer_name) { + public function timer_start($timer_name) { $this->timers[$timer_name] = $this->timer_get_cur(); } // timer_start /** * Returns the elapsed time of the given timer by name - * + * * @param string $timer_name * @return float */ - function timer_elapsed($timer_name) { + public function timer_elapsed($timer_name) { return round($this->timer_get_cur() - $this->timers[$timer_name],2); } // timer_elapsed /** * Update the global timer with an existing timer - * - * @param string $timer_name + * + * @param string $timer_name */ - function timer_update_global($timer_name) { - if ( $this->do_profile ) - { + public function timer_update_global($timer_name) { + if ( $this->do_profile ) { $this->profile_times[] = array - ( - 'query' => $this->last_query, - 'time' => $this->timer_elapsed($timer_name) - ); + ( + 'query' => $this->last_query, + 'time' => $this->timer_elapsed($timer_name) + ); } $this->total_query_time += $this->timer_elapsed($timer_name); @@ -703,7 +650,7 @@ function timer_update_global($timer_name) { /** * Creates a SET nvp sql string from an associative array (and escapes all values) - * + * * $db_data = array('login'=>'jv','email'=>'jv@vip.ie', 'user_id' => 1, 'created' => 'NOW()'); * * $db->query("INSERT INTO users SET ".$db->get_set($db_data)); @@ -715,28 +662,29 @@ function timer_update_global($timer_name) { * Output: * * login = 'jv', email = 'jv@vip.ie', user_id = 1, created = NOW() - * + * * @param array $parms - * @return string + * @return string */ - function get_set($parms) { + public function get_set($parms) { $sql = ''; - - foreach ( $parms as $field => $val ) { - if ( $val === 'true' ) $val = 1; - if ( $val === 'false' ) $val = 0; - if ( $val == 'NOW()' ) - { - $sql .= "$field = ".$this->escape($val).", "; + foreach ( $parms as $field => $val ) { + if ( $val === 'true' ) { + $val = 1; + } + if ( $val === 'false' ) { + $val = 0; } - else - { - $sql .= "$field = '".$this->escape($val)."', "; + + if ( $val == 'NOW()' ) { + $sql .= "$field = " . $this->escape($val) . ', '; + } else { + $sql .= "$field = '".$this->escape($val).'\', '; } } - return substr($sql,0,-2); + return substr($sql, 0, -2); } // get_set } // ezSQLcore \ No newline at end of file From 0539f0b8108740af7e18c438962c472f8373b200 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 17:43:33 +0200 Subject: [PATCH 014/126] - Changed formatting to fit standards - Methods with public --- mssql/ez_sql_mssql.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mssql/ez_sql_mssql.php b/mssql/ez_sql_mssql.php index d3c4cfe1..4511f083 100755 --- a/mssql/ez_sql_mssql.php +++ b/mssql/ez_sql_mssql.php @@ -96,7 +96,7 @@ public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='loc * Default is localhost * @return boolean */ - function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') { + public function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') { $return_val = false; if ( ! $this->connect($dbuser, $dbpassword, $dbhost,true) ) ; else if ( ! $this->select($dbname) ) ; @@ -113,7 +113,7 @@ function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhos * Default is localhost * @return boolean */ - function connect($dbuser='', $dbpassword='', $dbhost='localhost') { + public function connect($dbuser='', $dbpassword='', $dbhost='localhost') { $return_val = false; // Must have a user and a password @@ -141,7 +141,7 @@ function connect($dbuser='', $dbpassword='', $dbhost='localhost') { * @param string $dbname The name of the database * @return boolean */ - function select($dbname='') { + public function select($dbname='') { $return_val = false; if ( ! $dbname ) { @@ -172,7 +172,7 @@ function select($dbname='') { * @param string $str * @return string */ - function escape($str) { + public function escape($str) { $return_val = ''; if ( !isset($str) or empty($str) ) { @@ -205,7 +205,7 @@ function escape($str) { * * @return string */ - function sysdate() { + public function sysdate() { return 'getDate()'; } // sysdate @@ -216,10 +216,10 @@ function sysdate() { * @param string $query * @return boolean */ - function query($query) { + public function query($query) { - //if flag to convert query from MySql syntax to MS-Sql syntax is true - //convert the query + // If flag to convert query from MySql syntax to MS-Sql syntax is true + // convert the query if($this->convertMySqlToMSSqlQuery == true) { $query = $this->ConvertMySqlToMSSql($query); } @@ -358,7 +358,7 @@ function query($query) { * @param string $query * @return string */ - function ConvertMySqlToMSSql($query) { + public function ConvertMySqlToMSSql($query) { // replace the '`' character used for MySql queries, but not // supported in MS-Sql From 27146c9615ccb40e586d3b4b5f9d221b55d373fd Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 18:09:21 +0200 Subject: [PATCH 015/126] - Changed the core class to PHP 5 syntax. - Cleared parameter formats from mixed commaspace / comma to comma space. - Added PHPDoc documentation tags and extended the documentation - Changed formatting to fit standards - Methods with public --- mysql/ez_sql_mysql.php | 612 +++++++++++++++++++++-------------------- 1 file changed, 320 insertions(+), 292 deletions(-) diff --git a/mysql/ez_sql_mysql.php b/mysql/ez_sql_mysql.php index 7f583aea..c230694d 100755 --- a/mysql/ez_sql_mysql.php +++ b/mysql/ez_sql_mysql.php @@ -1,295 +1,323 @@ 'Require $dbuser and $dbpassword to connect to a database server', - 2 => 'Error establishing mySQL database connection. Correct user/password? Correct hostname? Database server running?', - 3 => 'Require $dbname to select a database', - 4 => 'mySQL database connection is not active', - 5 => 'Unexpected error while trying to select database' - ); - - /********************************************************************** - * ezSQL Database specific class - mySQL - */ - - if ( ! function_exists ('mysql_connect') ) die('Fatal Error: ezSQL_mysql requires mySQL Lib to be compiled and or linked in to the PHP engine'); - if ( ! class_exists ('ezSQLcore') ) die('Fatal Error: ezSQL_mysql requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); - - class ezSQL_mysql extends ezSQLcore - { - - var $dbuser = false; - var $dbpassword = false; - var $dbname = false; - var $dbhost = false; - var $charset = 'utf8'; - - /********************************************************************** - * Constructor - allow the user to perform a qucik connect at the - * same time as initialising the ezSQL_mysql class - */ - - function ezSQL_mysql($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $charset='') - { - $this->dbuser = $dbuser; - $this->dbpassword = $dbpassword; - $this->dbname = $dbname; - $this->dbhost = $dbhost; - if ( ! empty($charset) ) - { - $this->charset = $charset; - } - } - - /********************************************************************** - * Short hand way to connect to mySQL database server - * and select a mySQL database at the same time - */ - - function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') - { - $return_val = false; - if ( ! $this->connect($dbuser, $dbpassword, $dbhost,true) ) ; - else if ( ! $this->select($dbname) ) ; - else $return_val = true; - return $return_val; - } - - /********************************************************************** - * Try to connect to mySQL database server - */ - - function connect($dbuser='', $dbpassword='', $dbhost='localhost', $charset='') - { - global $ezsql_mysql_str; $return_val = false; - - // Must have a user and a password - if ( ! $dbuser ) - { - $this->register_error($ezsql_mysql_str[1].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_mysql_str[1],E_USER_WARNING) : null; - } - // Try to establish the server database handle - else if ( ! $this->dbh = @mysql_connect($dbhost,$dbuser,$dbpassword,true,131074) ) - { - $this->register_error($ezsql_mysql_str[2].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_mysql_str[2],E_USER_WARNING) : null; - } - else - { - $this->dbuser = $dbuser; - $this->dbpassword = $dbpassword; - $this->dbhost = $dbhost; - if ( ! empty($charset) ) - { - $this->charset = $charset; - } - - mysql_set_charset($this->charset, $this->dbh); - $return_val = true; - } - - return $return_val; - } - - /********************************************************************** - * Try to select a mySQL database - */ - - function select($dbname='') - { - global $ezsql_mysql_str; $return_val = false; - - // Must have a database name - if ( ! $dbname ) - { - $this->register_error($ezsql_mysql_str[3].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_mysql_str[3],E_USER_WARNING) : null; - } - - // Must have an active database connection - else if ( ! $this->dbh ) - { - $this->register_error($ezsql_mysql_str[4].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_mysql_str[4],E_USER_WARNING) : null; - } - - // Try to connect to the database - else if ( !@mysql_select_db($dbname,$this->dbh) ) - { - // Try to get error supplied by mysql if not use our own - if ( !$str = @mysql_error($this->dbh)) - $str = $ezsql_mysql_str[5]; - - $this->register_error($str.' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($str,E_USER_WARNING) : null; - } - else - { - $this->dbname = $dbname; - $return_val = true; - } - - return $return_val; - } - - /********************************************************************** - * Format a mySQL string correctly for safe mySQL insert - * (no mater if magic quotes are on or not) - */ - - function escape($str) - { - // If there is no existing database connection then try to connect - if ( ! isset($this->dbh) || ! $this->dbh ) - { - $this->connect($this->dbuser, $this->dbpassword, $this->dbhost); - $this->select($this->dbname); - } - - return mysql_real_escape_string(stripslashes($str)); - } - - /********************************************************************** - * Return mySQL specific system date syntax - * i.e. Oracle: SYSDATE Mysql: NOW() - */ - - function sysdate() - { - return 'NOW()'; - } - - /********************************************************************** - * Perform mySQL query and try to detirmin result value - */ - - function query($query) - { - - // Initialise return - $return_val = 0; - - // Flush cached values.. - $this->flush(); - - // For reg expressions - $query = trim($query); - - // Log how the function was called - $this->func_call = "\$db->query(\"$query\")"; - - // Keep track of the last query for debug.. - $this->last_query = $query; - - // Count how many queries there have been - $this->num_queries++; - - // Use core file cache function - if ( $cache = $this->get_cache($query) ) - { - return $cache; - } - - // If there is no existing database connection then try to connect - if ( ! isset($this->dbh) || ! $this->dbh ) - { - $this->connect($this->dbuser, $this->dbpassword, $this->dbhost); - $this->select($this->dbname); - } - - // Perform the query via std mysql_query function.. - $this->result = @mysql_query($query,$this->dbh); - - // If there is an error then take note of it.. - if ( $str = @mysql_error($this->dbh) ) - { - $is_insert = true; - $this->register_error($str); - $this->show_errors ? trigger_error($str,E_USER_WARNING) : null; - return false; - } - - // Query was an insert, delete, update, replace - $is_insert = false; - if ( preg_match("/^(insert|delete|update|replace)\s+/i",$query) ) - { - $this->rows_affected = @mysql_affected_rows($this->dbh); - - // Take note of the insert_id - if ( preg_match("/^(insert|replace)\s+/i",$query) ) - { - $this->insert_id = @mysql_insert_id($this->dbh); - } - - // Return number fo rows affected - $return_val = $this->rows_affected; - } - // Query was a select - else - { - - // Take note of column info - $i=0; - while ($i < @mysql_num_fields($this->result)) - { - $this->col_info[$i] = @mysql_fetch_field($this->result); - $i++; - } - - // Store Query Results - $num_rows=0; - while ( $row = @mysql_fetch_object($this->result) ) - { - // Store relults as an objects within main array - $this->last_result[$num_rows] = $row; - $num_rows++; - } - - @mysql_free_result($this->result); - - // Log number of rows the query returned - $this->num_rows = $num_rows; - - // Return number of rows selected - $return_val = $this->num_rows; - } - - // disk caching of queries - $this->store_cache($query,$is_insert); - - // If debug ALL queries - $this->trace || $this->debug_all ? $this->debug() : null ; - - return $return_val; - - } - - /** - * Close the database connection - */ - function disconnect() - { - if ( $this->dbh ) +/** + * ezSQL Database specific class - mySQL + * Desc..: mySQL component (part of ezSQL databse abstraction library) + * + * @author Justin Vincent (jv@jvmultimedia.com) + * @author Stefanie Janine Stoelting (mail@stefanie-stoelting.de) + * @link http://twitter.com/justinvincent + * @name ezSQL_mysql + * @package ezSQL + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + * + */ +class ezSQL_mysql extends ezSQLcore { + /* + * ezSQL error strings - mySQL + * @var array + */ + private $ezsql_mysql_str = array + ( + 1 => 'Require $dbuser and $dbpassword to connect to a database server', + 2 => 'Error establishing mySQL database connection. Correct user/password? Correct hostname? Database server running?', + 3 => 'Require $dbname to select a database', + 4 => 'mySQL database connection is not active', + 5 => 'Unexpected error while trying to select database' + ); + + + /** + * Database user name + * @var string + */ + private $dbuser; + + /** + * Database password for the given user + * @var string + */ + private $dbpassword; + + /** + * Database name + * @var string + */ + private $dbname; + + /** + * Host name or IP address + * @var string + */ + private $dbhost; + + /** + * Database charset + * @var string Default is utf8 + */ + private $charset = 'utf8'; + + /** + * Constructor - allow the user to perform a qucik connect at the same time + * as initialising the ezSQL_mysql class + * + * @param string $dbuser The database user name + * @param string $dbpassword The database users password + * @param string $dbname The name of the database + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @param type $charset The database charset + * Default is empty string + */ + public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $charset='') { + parent::__construct(); + + if ( ! function_exists ('mysql_connect') ) die('Fatal Error: ezSQL_mysql requires mySQL Lib to be compiled and or linked in to the PHP engine'); + if ( ! class_exists ('ezSQLcore') ) die('Fatal Error: ezSQL_mysql requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); + + $this->dbuser = $dbuser; + $this->dbpassword = $dbpassword; + $this->dbname = $dbname; + $this->dbhost = $dbhost; + if ( ! empty($charset) ) { - mysql_close($this->dbh); + $this->charset = $charset; } - } - - } - -?> + } // __construct + + /********************************************************************** + * Short hand way to connect to mySQL database server + * and select a mySQL database at the same time + */ + + /** + * Short hand way to connect to mssql database server and select a mssql + * database at the same time + * + * @param string $dbuser The database user name + * @param string $dbpassword The database users password + * @param string $dbname The name of the database + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @return boolean + */ + public function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') { + $return_val = false; + if ( ! $this->connect($dbuser, $dbpassword, $dbhost,true) ) ; + else if ( ! $this->select($dbname) ) ; + else $return_val = true; + return $return_val; + } // quick_connect + + /********************************************************************** + * + */ + + /** + * Try to connect to mySQL database server + * + * @param string $dbuser The database user name + * @param string $dbpassword The database users password + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @param type $charset The database charset + * Default is empty string + * @return boolean + */ + public function connect($dbuser='', $dbpassword='', $dbhost='localhost', $charset='') { + $return_val = false; + + // Must have a user and a password + if ( ! $dbuser ) { + $this->register_error($this->ezsql_mysql_str[1] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_mysql_str[1], E_USER_WARNING) : null; + } else if ( ! $this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword, true, 131074) ) { + // Try to establish the server database handle + $this->register_error($this->ezsql_mysql_str[2] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_mysql_str[2], E_USER_WARNING) : null; + } else { + $this->dbuser = $dbuser; + $this->dbpassword = $dbpassword; + $this->dbhost = $dbhost; + + if ( ! empty($charset) ) { + $this->charset = $charset; + } + + mysql_set_charset($this->charset, $this->dbh); + $return_val = true; + } + + return $return_val; + } // connect + + /** + * Try to select a mySQL database + * + * @param string $dbname The name of the database + * @return boolean + */ + public function select($dbname='') { + $return_val = false; + + if ( ! $dbname ) { + // Must have a database name + $this->register_error($this->ezsql_mysql_str[3] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_mysql_str[3], E_USER_WARNING) : null; + } else if ( ! $this->dbh ) { + // Must have an active database connection + $this->register_error($this->ezsql_mysql_str[4] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_mysql_str[4], E_USER_WARNING) : null; + } else if ( !@mysql_select_db($dbname,$this->dbh) ) { + // Try to connect to the database + // Try to get error supplied by mysql if not use our own + if ( !$str = @mysql_error($this->dbh)) { + $str = $this->ezsql_mysql_str[5]; + } + + $this->register_error($str . ' in ' .__FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($str, E_USER_WARNING) : null; + } else { + $this->dbname = $dbname; + $return_val = true; + } + + return $return_val; + } // select + + /** + * Format a mySQL string correctly for safe mySQL insert + * (no mater if magic quotes are on or not) + * + * @param string $str + * @return string + */ + public function escape($str) { + // If there is no existing database connection then try to connect + if ( ! isset($this->dbh) || ! $this->dbh ) { + $this->connect($this->dbuser, $this->dbpassword, $this->dbhost); + $this->select($this->dbname); + } + + return mysql_real_escape_string(stripslashes($str)); + } // escape + + /** + * Return mySQL specific system date syntax + * i.e. Oracle: SYSDATE Mysql: NOW() + * + * @return string + */ + public function sysdate() { + return 'NOW()'; + } // sysdate + + /********************************************************************** + * + */ + + /** + * Perform mySQL query and try to detirmin result value + * + * @param type $query + * @return boolean + */ + public function query($query) { + + // Initialise return + $return_val = 0; + + // Flush cached values.. + $this->flush(); + + // For reg expressions + $query = trim($query); + + // Log how the function was called + $this->func_call = "\$db->query(\"$query\")"; + + // Keep track of the last query for debug.. + $this->last_query = $query; + + // Count how many queries there have been + $this->num_queries++; + + // Use core file cache function + if ( $cache = $this->get_cache($query) ) { + return $cache; + } + + // If there is no existing database connection then try to connect + if ( ! isset($this->dbh) || ! $this->dbh ) { + $this->connect($this->dbuser, $this->dbpassword, $this->dbhost); + $this->select($this->dbname); + } + + // Perform the query via std mysql_query function.. + $this->result = @mysql_query($query,$this->dbh); + + // If there is an error then take note of it.. + if ( $str = @mysql_error($this->dbh) ) { + $is_insert = true; + $this->register_error($str); + $this->show_errors ? trigger_error($str,E_USER_WARNING) : null; + return false; + } + + // Query was an insert, delete, update, replace + $is_insert = false; + if ( preg_match("/^(insert|delete|update|replace)\s+/i", $query) ) { + $this->rows_affected = @mysql_affected_rows($this->dbh); + + // Take note of the insert_id + if ( preg_match("/^(insert|replace)\s+/i", $query) ) { + $this->insert_id = @mysql_insert_id($this->dbh); + } + + // Return number fo rows affected + $return_val = $this->rows_affected; + } else { + // Query was a select + + // Take note of column info + $i=0; + while ($i < @mysql_num_fields($this->result)) { + $this->col_info[$i] = @mysql_fetch_field($this->result); + $i++; + } + + // Store Query Results + $num_rows=0; + while ( $row = @mysql_fetch_object($this->result) ) { + // Store relults as an objects within main array + $this->last_result[$num_rows] = $row; + $num_rows++; + } + + @mysql_free_result($this->result); + + // Log number of rows the query returned + $this->num_rows = $num_rows; + + // Return number of rows selected + $return_val = $this->num_rows; + } + + // disk caching of queries + $this->store_cache($query, $is_insert); + + // If debug ALL queries + $this->trace || $this->debug_all ? $this->debug() : null ; + + return $return_val; + } // query + + /** + * Close the database connection + */ + public function disconnect() { + if ( $this->dbh ) { + mysql_close($this->dbh); + } + } // function + +} // ezSQL_mysql \ No newline at end of file From fda39776495f0879e43e9dcd5bbd04ded47b70f3 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 18:13:33 +0200 Subject: [PATCH 016/126] Changed error from die to throw new Exception --- mysql/ez_sql_mysql.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/mysql/ez_sql_mysql.php b/mysql/ez_sql_mysql.php index c230694d..dcfcc862 100755 --- a/mysql/ez_sql_mysql.php +++ b/mysql/ez_sql_mysql.php @@ -69,19 +69,22 @@ class ezSQL_mysql extends ezSQLcore { * Default is empty string */ public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $charset='') { - parent::__construct(); + parent::__construct(); - if ( ! function_exists ('mysql_connect') ) die('Fatal Error: ezSQL_mysql requires mySQL Lib to be compiled and or linked in to the PHP engine'); - if ( ! class_exists ('ezSQLcore') ) die('Fatal Error: ezSQL_mysql requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); + if ( ! function_exists ('mysql_connect') ) { + throw new Exception('Fatal Error: ezSQL_mysql requires mySQL Lib to be compiled and or linked in to the PHP engine'); + } + if ( ! class_exists ('ezSQLcore') ) { + throw new Exception('Fatal Error: ezSQL_mysql requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); + } $this->dbuser = $dbuser; $this->dbpassword = $dbpassword; $this->dbname = $dbname; $this->dbhost = $dbhost; - if ( ! empty($charset) ) - { - $this->charset = $charset; - } + if ( ! empty($charset) ) { + $this->charset = $charset; + } } // __construct /********************************************************************** From 2bca259480fa21101860b085c7d2d7aa8752fc3e Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 18:17:57 +0200 Subject: [PATCH 017/126] Corrected an error of duplicated public on a function --- shared/ez_sql_core.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/shared/ez_sql_core.php b/shared/ez_sql_core.php index 94516657..d0a0ab3b 100755 --- a/shared/ez_sql_core.php +++ b/shared/ez_sql_core.php @@ -594,8 +594,13 @@ public function debug($print_to_screen=true) { * * @return string An HTML string with payment information */ - public public function donation() { - return 'If ezSQL has helped make a donation!?   '; + public function donation() { + $return_val = '' + . 'If ezSQL has helped make a donation!?   ' + . ''; + + return $return_val; } // donation /*************************************************************************** From 6fb8890fb8c3fdb2b21f9f8e0f0b86c49d9d9379 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 18:31:28 +0200 Subject: [PATCH 018/126] Added PHPDoc ignore tag to demos --- mssql/demo.php | 3 +++ mysql/demo.php | 3 +++ mysql/disk_cache_example.php | 3 +++ oracle8_9/demo.php | 7 +++++-- oracle8_9/disk_cache_example.php | 3 +++ pdo/demo.php | 7 +++++++ postgresql/demo.php | 3 +++ sqlite/demo.php | 33 +++++++++++++++++--------------- 8 files changed, 45 insertions(+), 17 deletions(-) diff --git a/mssql/demo.php b/mssql/demo.php index 98928c1d..0d38f2de 100755 --- a/mssql/demo.php +++ b/mssql/demo.php @@ -1,4 +1,7 @@ query("CREATE TABLE test_table ( MyColumnA INTEGER PRIMARY KEY, MyColumnB TEXT(32) );"); + $db->query("CREATE TABLE test_table ( MyColumnA INTEGER PRIMARY KEY, MyColumnB TEXT(32) );"); // Insert test data for($i=0;$i<3;++$i) From e146c1966e9e86d180870accd716aaafa9007e7d Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 18:34:01 +0200 Subject: [PATCH 019/126] Change log was not changed on git merge upstream/master , don't know why, but that's life sometimes --- readme.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readme.txt b/readme.txt index 0effac3f..4388b8ee 100755 --- a/readme.txt +++ b/readme.txt @@ -15,6 +15,10 @@ http://techzinglive.com Change Log: +2.17 - Updates to ezSQL_postgresql (thx Stefanie Janine Stoelting) + +2.16 - Added profiling functions to mySQL version & added fix to stop mySQL hanging on very long runnign scripts + 2.15 - Fixed long standing bug with $db->rows_affected (thx Pere Pasqual) 2.14 - Added sybase connector by Muhammad Iyas From e0d4dff8c932ad387cb4d8d809326a2cfe87505e Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 18:48:08 +0200 Subject: [PATCH 020/126] Corrected a PHPDoc parameter --- mysql/ez_sql_mysql.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql/ez_sql_mysql.php b/mysql/ez_sql_mysql.php index dcfcc862..167b47f3 100755 --- a/mysql/ez_sql_mysql.php +++ b/mysql/ez_sql_mysql.php @@ -65,8 +65,8 @@ class ezSQL_mysql extends ezSQLcore { * @param string $dbname The name of the database * @param string $dbhost The host name or IP address of the database server. * Default is localhost - * @param type $charset The database charset - * Default is empty string + * @param string $charset The database charset + * Default is empty string */ public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $charset='') { parent::__construct(); From 8a547f3c77f1567a6276cbeeaa9d74c2645642e3 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 18:57:06 +0200 Subject: [PATCH 021/126] Removed superfluous comment --- mysql/ez_sql_mysql.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/mysql/ez_sql_mysql.php b/mysql/ez_sql_mysql.php index 167b47f3..29e08dd8 100755 --- a/mysql/ez_sql_mysql.php +++ b/mysql/ez_sql_mysql.php @@ -87,11 +87,6 @@ public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='loc } } // __construct - /********************************************************************** - * Short hand way to connect to mySQL database server - * and select a mySQL database at the same time - */ - /** * Short hand way to connect to mssql database server and select a mssql * database at the same time From 2a7f67c75a7fc5d4acd43a204fabe6bb7a218952 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 18:57:36 +0200 Subject: [PATCH 022/126] Removed superfluous comment --- mysql/ez_sql_mysql.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/mysql/ez_sql_mysql.php b/mysql/ez_sql_mysql.php index 29e08dd8..a657f843 100755 --- a/mysql/ez_sql_mysql.php +++ b/mysql/ez_sql_mysql.php @@ -106,10 +106,6 @@ public function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='l return $return_val; } // quick_connect - /********************************************************************** - * - */ - /** * Try to connect to mySQL database server * @@ -209,10 +205,6 @@ public function sysdate() { return 'NOW()'; } // sysdate - /********************************************************************** - * - */ - /** * Perform mySQL query and try to detirmin result value * From 68c8afe9bc58d1775963ead44ca69d57a3a6eb6a Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 19:05:06 +0200 Subject: [PATCH 023/126] Corrected a typo --- mysql/ez_sql_mysql.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql/ez_sql_mysql.php b/mysql/ez_sql_mysql.php index a657f843..8cdb0f66 100755 --- a/mysql/ez_sql_mysql.php +++ b/mysql/ez_sql_mysql.php @@ -180,7 +180,7 @@ public function select($dbname='') { /** * Format a mySQL string correctly for safe mySQL insert - * (no mater if magic quotes are on or not) + * (no matter if magic quotes are on or not) * * @param string $str * @return string From ee9f0074bc0fdd6adc3e361c83ec9a742f2579c8 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 19:20:13 +0200 Subject: [PATCH 024/126] - Changed the core class to PHP 5 syntax. - Cleared parameter formats from mixed commaspace / comma to comma space. - Added PHPDoc documentation tags and extended the documentation - Changed formatting to fit standards - Methods with public --- postgresql/ez_sql_postgresql.php | 630 +++++++++++++++++-------------- 1 file changed, 340 insertions(+), 290 deletions(-) diff --git a/postgresql/ez_sql_postgresql.php b/postgresql/ez_sql_postgresql.php index 52b37a49..c666c95e 100755 --- a/postgresql/ez_sql_postgresql.php +++ b/postgresql/ez_sql_postgresql.php @@ -1,291 +1,341 @@ 'Require $dbuser and $dbpassword to connect to a database server', - 2 => 'Error establishing PostgreSQL database connection. Correct user/password? Correct hostname? Database server running?', - 3 => 'Require $dbname to select a database', - 4 => 'mySQL database connection is not active', - 5 => 'Unexpected error while trying to select database' - ); - - /********************************************************************** - * ezSQL Database specific class - PostgreSQL - */ - - if ( ! function_exists ('pg_connect') ) die('Fatal Error: ezSQL_postgresql requires PostgreSQL Lib to be compiled and or linked in to the PHP engine'); - if ( ! class_exists ('ezSQLcore') ) die('Fatal Error: ezSQL_postgresql requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); - - class ezSQL_postgresql extends ezSQLcore - { - - var $dbuser = false; - var $dbpassword = false; - var $dbname = false; - var $dbhost = false; - var $port = '5432'; - - /********************************************************************** - * Constructor - allow the user to perform a qucik connect at the - * same time as initialising the ezSQL_postgresql class - */ - - function ezSQL_postgresql($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') - { - $this->dbuser = $dbuser; - $this->dbpassword = $dbpassword; - $this->dbname = $dbname; - $this->dbhost = $dbhost; - $this->port = $port; - } - - /********************************************************************** - * In the case of PostgreSQL quick_connect is not really needed - * because std. connect already does what quick connect does - - * but for the sake of consistency it has been included - */ - - function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') - { - $return_val = false; - if ( ! $this->connect($dbuser, $dbpassword, $dbname, $dbhost, $port, true) ) ; - else if ( ! $this->select($dbname) ) ; - else $return_val = true; - return $return_val; - } - - /********************************************************************** - * Try to connect to mySQL database server - */ - - function connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') - { - global $ezsql_postgresql_str; $return_val = false; - - echo "

\$dbuser: $dbuser - \$dbpassword: $dbpassword - \$dbname: $dbname - \$dbhost: $dbhost - \$port: $port

\n"; - // Must have a user and a password - if ( ! $dbuser ) - { - $this->register_error($ezsql_postgresql_str[1].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_postgresql_str[1],E_USER_WARNING) : null; - } - // Try to establish the server database handle - else if ( ! $this->dbh = pg_connect("host=$dbhost port=$port dbname=$dbname user=$dbuser password=$dbpassword", true) ) - { - $this->register_error($ezsql_postgresql_str[2].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_postgresql_str[2],E_USER_WARNING) : null; - } - else - { - $this->dbuser = $dbuser; - $this->dbpassword = $dbpassword; - $this->dbhost = $dbhost; - $this->dbname = $dbname; - $this->port = $port; - $return_val = true; - } - - return $return_val; - } - - /********************************************************************** - * No real equivalent of mySQL select in PostgreSQL - * once again, function included for the sake of consistency - */ - - function select($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') - { - $return_val = false; - if ( ! $this->connect($dbuser, $dbpassword, $dbname, $dbhost, $port, true) ) ; - else if ( ! $this->select($dbname) ) ; - else $return_val = true; - return $return_val; - } - - /********************************************************************** - * Format a mySQL string correctly for safe mySQL insert - * (no mater if magic quotes are on or not) - */ - - function escape($str) - { - return pg_escape_string(stripslashes($str)); - } - - /********************************************************************** - * Return PostgreSQL specific system date syntax - * i.e. Oracle: SYSDATE Mysql: NOW() - */ - - function sysdate() - { - return 'NOW()'; - } - - /********************************************************************** - * Return PostgreSQL specific values - */ - - function showTables() - { - return "table_name FROM information_schema.tables WHERE table_schema = '$this->dbname' and table_type='BASE TABLE'"; - } - - function descTable($tbl_name) - { - return "ordinal_position, column_name, data_type, column_default, is_nullable, character_maximum_length, numeric_precision FROM information_schema.columns WHERE table_name = '$tbl_name' AND table_schema='$this->dbname' ORDER BY ordinal_position"; - } - - function showDatabases() - { - return "datname from pg_database WHERE datname NOT IN ('template0', 'template1') ORDER BY 1"; - } - - /********************************************************************** - * Perform PostgreSQL query and try to detirmin result value - */ - - function query($query) - { - - // Initialise return - $return_val = 0; - - // Flush cached values.. - $this->flush(); - - // For reg expressions - $query = trim($query); - - // Log how the function was called - $this->func_call = "\$db->query(\"$query\")"; - - // Keep track of the last query for debug.. - $this->last_query = $query; - - // Count how many queries there have been - $this->num_queries++; - - // Use core file cache function - if ( $cache = $this->get_cache($query) ) - { - return $cache; - } - - // If there is no existing database connection then try to connect - if ( ! isset($this->dbh) || ! $this->dbh ) - { - $this->connect($this->dbuser, $this->dbpassword, $this->dbname, $this->dbhost, $this->port); - } - - // Perform the query via std postgresql_query function.. - $this->result = @pg_query($this->dbh, $query); - - - // If there is an error then take note of it.. - if ( $str = @pg_last_error($this->dbh) ) - { - $is_insert = true; - $this->register_error($str); - $this->show_errors ? trigger_error($str,E_USER_WARNING) : null; - return false; - } - // Query was an insert, delete, update, replace - $is_insert = false; - if ( preg_match("/^(insert|delete|update|replace)\s+/i",$query) ) - { - $this->rows_affected = @pg_affected_rows($this->result); - - // Take note of the insert_id - if ( preg_match("/^(insert|replace)\s+/i",$query) ) - { - //$this->insert_id = @postgresql_insert_id($this->dbh); - //$this->insert_id = pg_last_oid($this->result); - - // Thx. Rafael Bernal - $insert_query = pg_query("SELECT lastval();"); - $insert_row = pg_fetch_row($insert_query); - $this->insert_id = $insert_row[0]; - } - - // Return number fo rows affected - $return_val = $this->rows_affected; - } - // Query was a select - else - { $num_rows=0; - //if ( $this->result ) //may be needed but my tests did not - //{ - - // ======================================================= - // Take note of column info - - $i=0; - while ($i < @pg_num_fields($this->result)) - { - $this->col_info[$i]->name = pg_field_name($this->result,$i); - $this->col_info[$i]->type = pg_field_type($this->result,$i); - $this->col_info[$i]->size = pg_field_size($this->result,$i); - $i++; - } - - // ======================================================= - // Store Query Results - - //while ( $row = @pg_fetch_object($this->result, $i, PGSQL_ASSOC) ) doesn't work? donno - //while ( $row = @pg_fetch_object($this->result,$num_rows) ) does work - while ( $row = @pg_fetch_object($this->result) ) - { - // Store results as an objects within main array - $this->last_result[$num_rows] = $row ; - $num_rows++; - } - - @pg_free_result($this->result); - //} - // Log number of rows the query returned - $this->num_rows = $num_rows; - - // Return number of rows selected - $return_val = $this->num_rows; - - } - - // disk caching of queries - $this->store_cache($query,$is_insert); - - // If debug ALL queries - $this->trace || $this->debug_all ? $this->debug() : null ; - - return $return_val; - - } - - /** - * Close the database connection - */ - function disconnect() - { - if ( $this->dbh ) - { - pg_close($this->dbh); - } - } - - } - -?> - +/** + * ezSQL Database specific class - PostgreSQL + * Desc..: PostgreSQL component (part of ezSQL databse abstraction library) + * + * @author Justin Vincent (jv@jvmultimedia.com) + * @author Stefanie Janine Stoelting (mail@stefanie-stoelting.de) + * @link http://twitter.com/justinvincent + * @name ezSQL_postgresql + * @package ezSQL + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + * + */ +class ezSQL_postgresql extends ezSQLcore { + /* + * ezSQL error strings - mySQL + * @var array + */ + private $ezsql_postgresql_str = array + ( + 1 => 'Require $dbuser and $dbpassword to connect to a database server', + 2 => 'Error establishing PostgreSQL database connection. Correct user/password? Correct hostname? Database server running?', + 3 => 'Require $dbname to select a database', + 4 => 'mySQL database connection is not active', + 5 => 'Unexpected error while trying to select database' + ); + + /** + * Database user name + * @var string + */ + private $dbuser; + + /** + * Database password for the given user + * @var string + */ + private $dbpassword; + + /** + * Database name + * @var string + */ + private $dbname; + + /** + * Host name or IP address + * @var string + */ + private $dbhost; + + /** + * TCP/IP port of PostgreSQL + * @var string Default is PostgreSQL default port 5432 + */ + private $port = '5432'; + + /** + * Constructor - allow the user to perform a qucik connect at the same time + * as initialising the ezSQL_postgresql class + * + * @param string $dbuser The database user name + * @param string $dbpassword The database users password + * @param string $dbname The name of the database + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @param string $port The database TCP/IP port + * Default is PostgreSQL default port 5432 + */ + public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') { + parent::__construct(); + + if ( ! function_exists ('pg_connect') ) { + throw new Exception('Fatal Error: ezSQL_postgresql requires PostgreSQL Lib to be compiled and or linked in to the PHP engine'); + } + if ( ! class_exists ('ezSQLcore') ) { + throw new Exception('Fatal Error: ezSQL_postgresql requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); + } + + $this->dbuser = $dbuser; + $this->dbpassword = $dbpassword; + $this->dbname = $dbname; + $this->dbhost = $dbhost; + $this->port = $port; + } // __construct + + /** + * In the case of PostgreSQL quick_connect is not really needed because std. + * connect already does what quick connect does - but for the sake of + * consistency it has been included + * + * @param string $dbuser The database user name + * @param string $dbpassword The database users password + * @param string $dbname The name of the database + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @param string $port The database TCP/IP port + * Default is PostgreSQL default port 5432 + * @return boolean + */ + function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') { + $return_val = false; + if ( ! $this->connect($dbuser, $dbpassword, $dbname, $dbhost, $port, true) ) ; + else if ( ! $this->select($dbname) ) ; + else $return_val = true; + return $return_val; + } // quick_connect + + /********************************************************************** + * Try to connect to mySQL database server + */ + + /** + * Try to connect to PostgreSQL database server + * + * @param string $dbuser The database user name + * @param string $dbpassword The database users password + * @param string $dbname The name of the database + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @param string $port The database TCP/IP port + * Default is PostgreSQL default port 5432 + * @return boolean + */ + public function connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') { + $return_val = false; + + if ( ! $dbuser ) { + // Must have a user and a password + $this->register_error($this->ezsql_postgresql_str[1] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_postgresql_str[1], E_USER_WARNING) : null; + } else if ( ! $this->dbh = pg_connect("host=$dbhost port=$port dbname=$dbname user=$dbuser password=$dbpassword", true) ) { + // Try to establish the server database handle + $this->register_error($this->ezsql_postgresql_str[2] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_postgresql_str[2], E_USER_WARNING) : null; + } else { + $this->dbuser = $dbuser; + $this->dbpassword = $dbpassword; + $this->dbhost = $dbhost; + $this->dbname = $dbname; + $this->port = $port; + + $return_val = true; + } + + return $return_val; + } // connect + + /** + * No real equivalent of mySQL select in PostgreSQL once again, function + * included for the sake of consistency + * + * @param string $dbuser The database user name + * @param string $dbpassword The database users password + * @param string $dbname The name of the database + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @param string $port The database TCP/IP port + * Default is PostgreSQL default port 5432 + * @return boolean + */ + public function select($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') { + $return_val = false; + if ( ! $this->connect($dbuser, $dbpassword, $dbname, $dbhost, $port, true) ) ; + else if ( ! $this->select($dbname) ) ; + else $return_val = true; + return $return_val; + } // select + + /** + * Format a mySQL string correctly for safe mySQL insert + * (no matter if magic quotes are on or not) + * + * @param string $str + * @return string + */ + public function escape($str) { + return pg_escape_string(stripslashes($str)); + } // escape + + /** + * Return PostgreSQL specific system date syntax + * i.e. Oracle: SYSDATE Mysql: NOW() + * + * @return string + */ + public function sysdate() { + return 'NOW()'; + } // sysdate + + /** + * Return PostgreSQL specific values: Return all tables of the current + * schema + * + * @return string + */ + public function showTables() { + return "table_name FROM information_schema.tables WHERE table_schema = '$this->dbname' and table_type='BASE TABLE'"; + } // showTables + + /** + * Return the description of the given table + * + * @param string $tbl_name The table name + * @return string + */ + public function descTable($tbl_name) { + return "ordinal_position, column_name, data_type, column_default, is_nullable, character_maximum_length, numeric_precision FROM information_schema.columns WHERE table_name = '$tbl_name' AND table_schema='$this->dbname' ORDER BY ordinal_position"; + } // descTable + + /** + * Return all databases of the current server + * + * @return string + */ + public function showDatabases() { + return "datname from pg_database WHERE datname NOT IN ('template0', 'template1') ORDER BY 1"; + } // showDatabases + + /** + * Perform PostgreSQL query and try to detirmin result value + * + * @param string $query + * @return boolean + */ + public function query($query) { + // Initialise return + $return_val = 0; + + // Flush cached values.. + $this->flush(); + + // For reg expressions + $query = trim($query); + + // Log how the function was called + $this->func_call = "\$db->query(\"$query\")"; + + // Keep track of the last query for debug.. + $this->last_query = $query; + + // Count how many queries there have been + $this->num_queries++; + + // Use core file cache function + if ( $cache = $this->get_cache($query) ) { + return $cache; + } + + // If there is no existing database connection then try to connect + if ( ! isset($this->dbh) || ! $this->dbh ) { + $this->connect($this->dbuser, $this->dbpassword, $this->dbname, $this->dbhost, $this->port); + } + + // Perform the query via std postgresql_query function.. + $this->result = @pg_query($this->dbh, $query); + + + // If there is an error then take note of it.. + if ( $str = @pg_last_error($this->dbh) ) { + $is_insert = true; + $this->register_error($str); + $this->show_errors ? trigger_error($str,E_USER_WARNING) : null; + return false; + } + + // Query was an insert, delete, update, replace + $is_insert = false; + if ( preg_match("/^(insert|delete|update|replace)\s+/i", $query) ) { + $this->rows_affected = @pg_affected_rows($this->result); + + // Take note of the insert_id + if ( preg_match("/^(insert|replace)\s+/i", $query) ) { + //$this->insert_id = @postgresql_insert_id($this->dbh); + //$this->insert_id = pg_last_oid($this->result); + + // Thx. Rafael Bernal + $insert_query = pg_query("SELECT lastval();"); + $insert_row = pg_fetch_row($insert_query); + $this->insert_id = $insert_row[0]; + } + + // Return number fo rows affected + $return_val = $this->rows_affected; + } else { + // Query was a select + $num_rows=0; + //if ( $this->result ) //may be needed but my tests did not + //{ + + // ======================================================= + // Take note of column info + + $i=0; + while ($i < @pg_num_fields($this->result)) { + $this->col_info[$i]->name = pg_field_name($this->result,$i); + $this->col_info[$i]->type = pg_field_type($this->result,$i); + $this->col_info[$i]->size = pg_field_size($this->result,$i); + $i++; + } + + // ======================================================= + // Store Query Results + + //while ( $row = @pg_fetch_object($this->result, $i, PGSQL_ASSOC) ) doesn't work? donno + //while ( $row = @pg_fetch_object($this->result,$num_rows) ) does work + while ( $row = @pg_fetch_object($this->result) ) { + // Store results as an objects within main array + $this->last_result[$num_rows] = $row ; + $num_rows++; + } + + @pg_free_result($this->result); + //} + // Log number of rows the query returned + $this->num_rows = $num_rows; + + // Return number of rows selected + $return_val = $this->num_rows; + + } + + // Disk caching of queries + $this->store_cache($query,$is_insert); + + // If debug ALL queries + $this->trace || $this->debug_all ? $this->debug() : null ; + + return $return_val; + } // query + + /** + * Close the database connection + */ + public function disconnect() { + if ( $this->dbh ) { + pg_close($this->dbh); + } + } // disconnect + +} // ezSQL_postgresql \ No newline at end of file From b29993dd07e4e4b0d045473b0aa6e5cc6ccf8760 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 19:23:36 +0200 Subject: [PATCH 025/126] Added two methods, to give access to the current host and port on PostgreSQL --- postgresql/ez_sql_postgresql.php | 72 ++++++++++++++++++++------------ 1 file changed, 45 insertions(+), 27 deletions(-) diff --git a/postgresql/ez_sql_postgresql.php b/postgresql/ez_sql_postgresql.php index c666c95e..87c171b3 100755 --- a/postgresql/ez_sql_postgresql.php +++ b/postgresql/ez_sql_postgresql.php @@ -2,14 +2,14 @@ /** * ezSQL Database specific class - PostgreSQL * Desc..: PostgreSQL component (part of ezSQL databse abstraction library) - * + * * @author Justin Vincent (jv@jvmultimedia.com) * @author Stefanie Janine Stoelting (mail@stefanie-stoelting.de) * @link http://twitter.com/justinvincent * @name ezSQL_postgresql * @package ezSQL * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) - * + * */ class ezSQL_postgresql extends ezSQLcore { /* @@ -24,7 +24,7 @@ class ezSQL_postgresql extends ezSQLcore { 4 => 'mySQL database connection is not active', 5 => 'Unexpected error while trying to select database' ); - + /** * Database user name * @var string @@ -48,7 +48,7 @@ class ezSQL_postgresql extends ezSQLcore { * @var string */ private $dbhost; - + /** * TCP/IP port of PostgreSQL * @var string Default is PostgreSQL default port 5432 @@ -56,7 +56,7 @@ class ezSQL_postgresql extends ezSQLcore { private $port = '5432'; /** - * Constructor - allow the user to perform a qucik connect at the same time + * Constructor - allow the user to perform a qucik connect at the same time * as initialising the ezSQL_postgresql class * * @param string $dbuser The database user name @@ -69,14 +69,14 @@ class ezSQL_postgresql extends ezSQLcore { */ public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') { parent::__construct(); - + if ( ! function_exists ('pg_connect') ) { throw new Exception('Fatal Error: ezSQL_postgresql requires PostgreSQL Lib to be compiled and or linked in to the PHP engine'); } if ( ! class_exists ('ezSQLcore') ) { throw new Exception('Fatal Error: ezSQL_postgresql requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); } - + $this->dbuser = $dbuser; $this->dbpassword = $dbpassword; $this->dbname = $dbname; @@ -85,8 +85,8 @@ public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='loc } // __construct /** - * In the case of PostgreSQL quick_connect is not really needed because std. - * connect already does what quick connect does - but for the sake of + * In the case of PostgreSQL quick_connect is not really needed because std. + * connect already does what quick connect does - but for the sake of * consistency it has been included * * @param string $dbuser The database user name @@ -96,7 +96,7 @@ public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='loc * Default is localhost * @param string $port The database TCP/IP port * Default is PostgreSQL default port 5432 - * @return boolean + * @return boolean */ function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') { $return_val = false; @@ -120,7 +120,7 @@ function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhos * Default is localhost * @param string $port The database TCP/IP port * Default is PostgreSQL default port 5432 - * @return boolean + * @return boolean */ public function connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') { $return_val = false; @@ -129,7 +129,7 @@ public function connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localho // Must have a user and a password $this->register_error($this->ezsql_postgresql_str[1] . ' in ' . __FILE__ . ' on line ' . __LINE__); $this->show_errors ? trigger_error($this->ezsql_postgresql_str[1], E_USER_WARNING) : null; - } else if ( ! $this->dbh = pg_connect("host=$dbhost port=$port dbname=$dbname user=$dbuser password=$dbpassword", true) ) { + } else if ( ! $this->dbh = pg_connect("host=$dbhost port=$port dbname=$dbname user=$dbuser password=$dbpassword", true) ) { // Try to establish the server database handle $this->register_error($this->ezsql_postgresql_str[2] . ' in ' . __FILE__ . ' on line ' . __LINE__); $this->show_errors ? trigger_error($this->ezsql_postgresql_str[2], E_USER_WARNING) : null; @@ -139,7 +139,7 @@ public function connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localho $this->dbhost = $dbhost; $this->dbname = $dbname; $this->port = $port; - + $return_val = true; } @@ -147,7 +147,7 @@ public function connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localho } // connect /** - * No real equivalent of mySQL select in PostgreSQL once again, function + * No real equivalent of mySQL select in PostgreSQL once again, function * included for the sake of consistency * * @param string $dbuser The database user name @@ -157,9 +157,9 @@ public function connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localho * Default is localhost * @param string $port The database TCP/IP port * Default is PostgreSQL default port 5432 - * @return boolean + * @return boolean */ - public function select($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') { + public function select($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') { $return_val = false; if ( ! $this->connect($dbuser, $dbpassword, $dbname, $dbhost, $port, true) ) ; else if ( ! $this->select($dbname) ) ; @@ -172,7 +172,7 @@ public function select($dbuser='', $dbpassword='', $dbname='', $dbhost='localhos * (no matter if magic quotes are on or not) * * @param string $str - * @return string + * @return string */ public function escape($str) { return pg_escape_string(stripslashes($str)); @@ -181,15 +181,15 @@ public function escape($str) { /** * Return PostgreSQL specific system date syntax * i.e. Oracle: SYSDATE Mysql: NOW() - * - * @return string + * + * @return string */ public function sysdate() { return 'NOW()'; } // sysdate /** - * Return PostgreSQL specific values: Return all tables of the current + * Return PostgreSQL specific values: Return all tables of the current * schema * * @return string @@ -211,7 +211,7 @@ public function descTable($tbl_name) { /** * Return all databases of the current server * - * @return string + * @return string */ public function showDatabases() { return "datname from pg_database WHERE datname NOT IN ('template0', 'template1') ORDER BY 1"; @@ -219,9 +219,9 @@ public function showDatabases() { /** * Perform PostgreSQL query and try to detirmin result value - * + * * @param string $query - * @return boolean + * @return boolean */ public function query($query) { // Initialise return @@ -248,7 +248,7 @@ public function query($query) { } // If there is no existing database connection then try to connect - if ( ! isset($this->dbh) || ! $this->dbh ) { + if ( ! isset($this->dbh) || ! $this->dbh ) { $this->connect($this->dbuser, $this->dbpassword, $this->dbname, $this->dbhost, $this->port); } @@ -263,7 +263,7 @@ public function query($query) { $this->show_errors ? trigger_error($str,E_USER_WARNING) : null; return false; } - + // Query was an insert, delete, update, replace $is_insert = false; if ( preg_match("/^(insert|delete|update|replace)\s+/i", $query) ) { @@ -286,7 +286,7 @@ public function query($query) { // Query was a select $num_rows=0; //if ( $this->result ) //may be needed but my tests did not - //{ + //{ // ======================================================= // Take note of column info @@ -337,5 +337,23 @@ public function disconnect() { pg_close($this->dbh); } } // disconnect - + + /** + * Returns the current database server host + * + * @return string + */ + public function getDBHost() { + return $this->dbhost; + } // getDBHost + + /** + * Returns the current TCP/IP port + * + * @return string + */ + public function getPort() { + return $this->port; + } // getPort + } // ezSQL_postgresql \ No newline at end of file From aab819e2577f39954582d2667fa445e2c81db7ec Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 19:25:42 +0200 Subject: [PATCH 026/126] Added two methods, to give access to the current host and connection charset on MySQL --- mysql/ez_sql_mysql.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/mysql/ez_sql_mysql.php b/mysql/ez_sql_mysql.php index 8cdb0f66..a22f74ab 100755 --- a/mysql/ez_sql_mysql.php +++ b/mysql/ez_sql_mysql.php @@ -309,5 +309,23 @@ public function disconnect() { mysql_close($this->dbh); } } // function + + /** + * Returns the current database server host + * + * @return string + */ + public function getDBHost() { + return $this->dbhost; + } // getDBHost + + /** + * Returns the current connection charset + * + * @return string + */ + public function getCharset() { + return $this->charset; + } // getCharset } // ezSQL_mysql \ No newline at end of file From 75941ec6e4f0d826be2b7b30b332a1b18fb9ec1d Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 19:26:52 +0200 Subject: [PATCH 027/126] Added a method, to give access to the current on MS SQL Server --- mssql/ez_sql_mssql.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mssql/ez_sql_mssql.php b/mssql/ez_sql_mssql.php index 4511f083..0f7c55be 100755 --- a/mssql/ez_sql_mssql.php +++ b/mssql/ez_sql_mssql.php @@ -394,4 +394,13 @@ public function ConvertMySqlToMSSql($query) { return $query; } // ConvertMySqlToMSSql + /** + * Returns the current database server host + * + * @return string + */ + public function getDBHost() { + return $this->dbhost; + } // getDBHost + } // ezSQL_mssql \ No newline at end of file From 06d818a83ba1df5461ef6fa6ed8b9b35fe9b74f1 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 19:28:48 +0200 Subject: [PATCH 028/126] Added PHPDoc ignore tag to Ezsql_codeigniter --- codeigniter/Ezsql_codeigniter.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/codeigniter/Ezsql_codeigniter.php b/codeigniter/Ezsql_codeigniter.php index 360698e7..bc2863bb 100755 --- a/codeigniter/Ezsql_codeigniter.php +++ b/codeigniter/Ezsql_codeigniter.php @@ -1,4 +1,7 @@ Date: Sun, 1 Apr 2012 19:40:08 +0200 Subject: [PATCH 029/126] Corrected the order of checking for existing classes and the call of the parent constructor --- mssql/ez_sql_mssql.php | 4 ++-- mysql/ez_sql_mysql.php | 4 ++-- postgresql/ez_sql_postgresql.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mssql/ez_sql_mssql.php b/mssql/ez_sql_mssql.php index 0f7c55be..232e504c 100755 --- a/mssql/ez_sql_mssql.php +++ b/mssql/ez_sql_mssql.php @@ -69,8 +69,6 @@ class ezSQL_mssql extends ezSQLcore { * @throws Exception Requires ntwdblib.dll and ez_sql_core.php */ public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $convertMySqlToMSSqlQuery=true) { - parent::__construct(); - if ( ! function_exists ('mssql_connect') ) { throw new Exception('Fatal Error: ezSQL_mssql requires ntwdblib.dll to be present in your winowds\system32 folder. Also enable MS-SQL extenstion in PHP.ini file '); } @@ -78,6 +76,8 @@ public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='loc throw new Exception('Fatal Error: ezSQL_mssql requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); } + parent::__construct(); + $this->dbuser = $dbuser; $this->dbpassword = $dbpassword; $this->dbname = $dbname; diff --git a/mysql/ez_sql_mysql.php b/mysql/ez_sql_mysql.php index a22f74ab..3778bbad 100755 --- a/mysql/ez_sql_mysql.php +++ b/mysql/ez_sql_mysql.php @@ -69,8 +69,6 @@ class ezSQL_mysql extends ezSQLcore { * Default is empty string */ public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $charset='') { - parent::__construct(); - if ( ! function_exists ('mysql_connect') ) { throw new Exception('Fatal Error: ezSQL_mysql requires mySQL Lib to be compiled and or linked in to the PHP engine'); } @@ -78,6 +76,8 @@ public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='loc throw new Exception('Fatal Error: ezSQL_mysql requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); } + parent::__construct(); + $this->dbuser = $dbuser; $this->dbpassword = $dbpassword; $this->dbname = $dbname; diff --git a/postgresql/ez_sql_postgresql.php b/postgresql/ez_sql_postgresql.php index 87c171b3..cf263396 100755 --- a/postgresql/ez_sql_postgresql.php +++ b/postgresql/ez_sql_postgresql.php @@ -68,8 +68,6 @@ class ezSQL_postgresql extends ezSQLcore { * Default is PostgreSQL default port 5432 */ public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') { - parent::__construct(); - if ( ! function_exists ('pg_connect') ) { throw new Exception('Fatal Error: ezSQL_postgresql requires PostgreSQL Lib to be compiled and or linked in to the PHP engine'); } @@ -77,6 +75,8 @@ public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='loc throw new Exception('Fatal Error: ezSQL_postgresql requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); } + parent::__construct(); + $this->dbuser = $dbuser; $this->dbpassword = $dbpassword; $this->dbname = $dbname; From 962c5f48b6d12a541c38b9e832e1d347c00aa2b3 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 19:56:18 +0200 Subject: [PATCH 030/126] Corrected a typo --- mysql/ez_sql_mysql.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql/ez_sql_mysql.php b/mysql/ez_sql_mysql.php index 3778bbad..c325e18f 100755 --- a/mysql/ez_sql_mysql.php +++ b/mysql/ez_sql_mysql.php @@ -206,7 +206,7 @@ public function sysdate() { } // sysdate /** - * Perform mySQL query and try to detirmin result value + * Perform mySQL query and try to determine result value * * @param type $query * @return boolean From 348ea4f7c15ca6ef9dec50d59d8d3b64f9406c5b Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 20:23:51 +0200 Subject: [PATCH 031/126] - Changed the core class to PHP 5 syntax. - Cleared parameter formats from mixed commaspace / comma to comma space. - Added PHPDoc documentation tags and extended the documentation - Changed formatting to fit standards - Methods with public --- pdo/ez_sql_pdo.php | 624 ++++++++++++++++++++++++--------------------- 1 file changed, 327 insertions(+), 297 deletions(-) diff --git a/pdo/ez_sql_pdo.php b/pdo/ez_sql_pdo.php index de6ca44e..1f3bdf7d 100755 --- a/pdo/ez_sql_pdo.php +++ b/pdo/ez_sql_pdo.php @@ -1,299 +1,329 @@ 'Require $dsn and $user and $password to create a connection' + ); + + /** + * The connection parameter string + * @var string + */ + private $dsn; + + /** + * The database user name + * @var string + */ + private $user; + + /** + * The database password + * @var string + */ + private $password; + + /** + * Constructor - allow the user to perform a qucik connect at the same time + * as initialising the ezSQL_sqlite class + * + * @param string $dsn The connection parameter string + * Default is empty string + * @param string $user The database user name + * Default is empty string + * @param string $password The database password + * Default is empty string + */ + public function __construct($dsn='', $user='', $password='') { + if ( ! class_exists ('PDO') ) { + throw new Exception('Fatal Error: ezSQL_sqlite requires PDO Lib to be compiled and or linked in to the PHP engine'); + } + if ( ! class_exists ('ezSQLcore') ) { + throw new Exception('Fatal Error: ezSQL_sqlite requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); + } + + parent::__construct(); + + // Turn on track errors + ini_set('track_errors', 1); + + if ( $dsn && $user && $password ) { + $this->connect($dsn, $user, $password); + } + } // __construct + + /** + * Try to connect to the database server in the DSN parameters + * + * @param string $dsn The connection parameter string + * Default is empty string + * @param string $user The database user name + * Default is empty string + * @param string $password The database password + * Default is empty string + * @return boolean + */ + public function connect($dsn='', $user='', $password='') { + $return_val = false; + + // Must have a user and a password + if ( ! $dsn || ! $user || ! $password ) { + $this->register_error($this->ezsql_pdo_str[1] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_pdo_str[1], E_USER_WARNING) : null; + } + + // Establish PDO connection + try { + $this->dbh = new PDO($dsn, $user, $password); + $return_val = true; + } + catch (PDOException $e) { + $this->register_error($e->getMessage()); + $this->show_errors ? trigger_error($e->getMessage(), E_USER_WARNING) : null; + } + + if ( $return_val ) { + // Set information about an established database connection + $this->isConnected = true; + } + return $return_val; + } // connect + + /** + * With PDO it is only an alias for the connect method + * + * @param string $dsn The connection parameter string + * Default is empty string + * @param string $user The database user name + * Default is empty string + * @param string $password The database password + * Default is empty string + * @return boolean + */ + public function quick_connect($dsn='', $user='', $password='') { + return $this->connect($dsn, $user, $password); + } // quick_connect + + /********************************************************************** + * No real equivalent of mySQL select in SQLite + * once again, function included for the sake of consistency + */ + + /** + * With PDO it is only an alias for the connect method + * + * @param string $dsn The connection parameter string + * Default is empty string + * @param string $user The database user name + * Default is empty string + * @param string $password The database password + * Default is empty string + * @return boolean + */ + public function select($dsn='', $user='', $password='') { + return $this->connect($dsn, $user, $password); + } // select + + /********************************************************************** + * Format a SQLite string correctly for safe SQLite insert + * (no mater if magic quotes are on or not) + */ + + /** + * Escape a string with the PDO method + * + * @param string $str + * @return string + */ + public function escape($str) { + // If there is no existing database connection then try to connect + if ( ! isset($this->dbh) || ! $this->dbh ) + { + $this->connect($this->dsn, $this->user, $this->password); + } + + $return_val = $this->dbh->quote($str); + + return $return_val; + } // escape + + /** + * Return SQLite specific system date syntax + * i.e. Oracle: SYSDATE Mysql: NOW() + * + * @return string + */ + public function sysdate() { + return "datetime('now')"; + } // sysdate + + /** + * Hooks into PDO error system and reports it to user + * + * @return string + */ + public function catch_error(){ + $error_str = 'No error info'; + + $err_array = $this->dbh->errorInfo(); + + // Note: Ignoring error - bind or column index out of range + if ( isset($err_array[1]) && $err_array[1] != 25) { + + $error_str = ''; + foreach ( $err_array as $entry ) { + $error_str .= $entry . ', '; + } + + $error_str = substr($error_str, 0, -2); + + $this->register_error($error_str); + $this->show_errors ? trigger_error($error_str . ' ' . $this->last_query, E_USER_WARNING) : null; + + return true; + } + + } // catch_error + + /** + * Basic Query - see docs for more detail + * + * @param type $query + * @return object + */ + public function query($query) { + // For reg expressions + $query = str_replace("/[\n\r]/", '', trim($query)); + + // Initialise return + $return_val = 0; + + // Flush cached values.. + $this->flush(); + + // Log how the function was called + $this->func_call = "\$db->query(\"$query\")"; + + // Keep track of the last query for debug.. + $this->last_query = $query; + + $this->num_queries++; + + // Start timer + $this->timer_start($this->num_queries); + + // Use core file cache function + if ( $cache = $this->get_cache($query) ) { + // Keep tack of how long all queries have taken + $this->timer_update_global($this->num_queries); + + // Trace all queries + if ( $this->use_trace_log ) { + $this->trace_log[] = $this->debug(false); + } - /********************************************************************** - * Author: Justin Vincent (jv@jvmultimedia.com) - * Web...: http://twitter.com/justinvincent - * Name..: ezSQL_pdo - * Desc..: SQLite component (part of ezSQL databse abstraction library) - * - */ - - /********************************************************************** - * ezSQL error strings - SQLite - */ - - $ezsql_pdo_str = array - ( - 1 => 'Require $dsn and $user and $password to create a connection' - ); - - /********************************************************************** - * ezSQL Database specific class - SQLite - */ - - if ( ! class_exists ('PDO') ) die('Fatal Error: ezSQL_sqlite requires PDO Lib to be compiled and or linked in to the PHP engine'); - if ( ! class_exists ('ezSQLcore') ) die('Fatal Error: ezSQL_sqlite requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); - - class ezSQL_pdo extends ezSQLcore - { - - var $dsn; - var $user; - var $password; - - /********************************************************************** - * Constructor - allow the user to perform a qucik connect at the - * same time as initialising the ezSQL_sqlite class - */ - - function ezSQL_pdo($dsn='', $user='', $password='') - { - // Turn on track errors - ini_set('track_errors',1); - - if ( $dsn && $user && $password ) - { - $this->connect($dsn, $user, $password); - } - } - - /********************************************************************** - * Try to connect to SQLite database server - */ - - function connect($dsn='', $user='', $password='') - { - global $ezsql_pdo_str; $return_val = false; - - // Must have a user and a password - if ( ! $dsn || ! $user || ! $password ) - { - $this->register_error($ezsql_pdo_str[1].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_pdo_str[1],E_USER_WARNING) : null; - } - - // Establish PDO connection - try - { - $this->dbh = new PDO($dsn, $user, $password); - $return_val = true; - } - catch (PDOException $e) - { - $this->register_error($e->getMessage()); - $this->show_errors ? trigger_error($e->getMessage(),E_USER_WARNING) : null; - } - - return $return_val; - } - - /********************************************************************** - * In the case of SQLite quick_connect is not really needed - * because std. connect already does what quick connect does - - * but for the sake of consistency it has been included - */ - - function quick_connect($dsn='', $user='', $password='') - { - return $this->connect($dsn, $user, $password); - } - - /********************************************************************** - * No real equivalent of mySQL select in SQLite - * once again, function included for the sake of consistency - */ - - function select($dsn='', $user='', $password='') - { - return $this->connect($dsn, $user, $password); - } - - /********************************************************************** - * Format a SQLite string correctly for safe SQLite insert - * (no mater if magic quotes are on or not) - */ - - function escape($str) - { - switch (gettype($str)) - { - case 'string' : $str = addslashes(stripslashes($str)); - break; - case 'boolean' : $str = ($str === FALSE) ? 0 : 1; - break; - default : $str = ($str === NULL) ? 'NULL' : $str; - break; - } - - return $str; - } - - /********************************************************************** - * Return SQLite specific system date syntax - * i.e. Oracle: SYSDATE Mysql: NOW() - */ - - function sysdate() - { - return "datetime('now')"; - } - - /********************************************************************** - * Hooks into PDO error system and reports it to user - */ - - function catch_error() - { - $error_str = 'No error info'; - - $err_array = $this->dbh->errorInfo(); - - // Note: Ignoring error - bind or column index out of range - if ( isset($err_array[1]) && $err_array[1] != 25) - { - - $error_str = ''; - foreach ( $err_array as $entry ) - { - $error_str .= $entry . ', '; - } - - $error_str = substr($error_str,0,-2); - - $this->register_error($error_str); - $this->show_errors ? trigger_error($error_str.' '.$this->last_query,E_USER_WARNING) : null; - - return true; - } - - } - - // ================================================================== - // Basic Query - see docs for more detail - - function query($query) - { - - // For reg expressions - $query = str_replace("/[\n\r]/",'',trim($query)); - - // initialise return - $return_val = 0; - - // Flush cached values.. - $this->flush(); - - // Log how the function was called - $this->func_call = "\$db->query(\"$query\")"; - - // Keep track of the last query for debug.. - $this->last_query = $query; - - $this->num_queries++; - - // Start timer - $this->timer_start($this->num_queries); - - // Use core file cache function - if ( $cache = $this->get_cache($query) ) - { - - // Keep tack of how long all queries have taken - $this->timer_update_global($this->num_queries); - - // Trace all queries - if ( $this->use_trace_log ) - { - $this->trace_log[] = $this->debug(false); - } - - return $cache; - } - - // If there is no existing database connection then try to connect - if ( ! isset($this->dbh) || ! $this->dbh ) - { - $this->connect($this->dsn, $this->user, $this->password); - } - - // Query was an insert, delete, update, replace - if ( preg_match("/^(insert|delete|update|replace|drop|create)\s+/i",$query) ) - { - - // Perform the query and log number of affected rows - $this->rows_affected = $this->dbh->exec($query); - - // If there is an error then take note of it.. - if ( $this->catch_error() ) return false; - - $is_insert = true; - - // Take note of the insert_id - if ( preg_match("/^(insert|replace)\s+/i",$query) ) - { - $this->insert_id = @$this->dbh->lastInsertId(); - } - - // Return number fo rows affected - $return_val = $this->rows_affected; - - } - // Query was an select - else - { - - // Perform the query and log number of affected rows - $sth = $this->dbh->query($query); - - // If there is an error then take note of it.. - if ( $this->catch_error() ) return false; - - $is_insert = false; - - $col_count = $sth->columnCount(); - - for ( $i=0 ; $i < $col_count ; $i++ ) - { - if ( $meta = $sth->getColumnMeta($i) ) - { - $this->col_info[$i]->name = $meta['name']; - $this->col_info[$i]->type = $meta['native_type']; - $this->col_info[$i]->max_length = ''; - } - else - { - $this->col_info[$i]->name = 'undefined'; - $this->col_info[$i]->type = 'undefined'; - $this->col_info[$i]->max_length = ''; - } - } - - // Store Query Results - $num_rows=0; - while ( $row = @$sth->fetch(PDO::FETCH_ASSOC) ) - { - // Store relults as an objects within main array - $this->last_result[$num_rows] = (object) $row; - $num_rows++; - } - - // Log number of rows the query returned - $this->num_rows = $num_rows; - - // Return number of rows selected - $return_val = $this->num_rows; - - } - - // disk caching of queries - $this->store_cache($query,$is_insert); - - // If debug ALL queries - $this->trace || $this->debug_all ? $this->debug() : null ; - - // Keep tack of how long all queries have taken - $this->timer_update_global($this->num_queries); - - // Trace all queries - if ( $this->use_trace_log ) - { - $this->trace_log[] = $this->debug(false); - } - - return $return_val; - - } - - } - -?> \ No newline at end of file + return $cache; + } + + // If there is no existing database connection then try to connect + if ( ! isset($this->dbh) || ! $this->dbh ) { + $this->connect($this->dsn, $this->user, $this->password); + } + + // Query was an insert, delete, update, replace + if ( preg_match("/^(insert|delete|update|replace|drop|create)\s+/i", $query) ) { + + // Perform the query and log number of affected rows + $this->rows_affected = $this->dbh->exec($query); + + // If there is an error then take note of it.. + if ( $this->catch_error() ) { + return false; + } + + $is_insert = true; + + // Take note of the insert_id + if ( preg_match("/^(insert|replace)\s+/i", $query) ) { + $this->insert_id = @$this->dbh->lastInsertId(); + } + + // Return number fo rows affected + $return_val = $this->rows_affected; + + } else { + // Query was an select + + // Perform the query and log number of affected rows + $sth = $this->dbh->query($query); + + // If there is an error then take note of it.. + if ( $this->catch_error() ) return false; + + $is_insert = false; + + $col_count = $sth->columnCount(); + + for ( $i=0 ; $i < $col_count ; $i++ ) { + if ( $meta = $sth->getColumnMeta($i) ) { + $this->col_info[$i]->name = $meta['name']; + $this->col_info[$i]->type = $meta['native_type']; + $this->col_info[$i]->max_length = ''; + } else { + $this->col_info[$i]->name = 'undefined'; + $this->col_info[$i]->type = 'undefined'; + $this->col_info[$i]->max_length = ''; + } + } + + // Store Query Results + $num_rows=0; + while ( $row = @$sth->fetch(PDO::FETCH_ASSOC) ) { + // Store relults as an objects within main array + $this->last_result[$num_rows] = (object) $row; + $num_rows++; + } + + // Log number of rows the query returned + $this->num_rows = $num_rows; + + // Return number of rows selected + $return_val = $this->num_rows; + + } + + // disk caching of queries + $this->store_cache($query, $is_insert); + + // If debug ALL queries + $this->trace || $this->debug_all ? $this->debug() : null ; + + // Keep tack of how long all queries have taken + $this->timer_update_global($this->num_queries); + + // Trace all queries + if ( $this->use_trace_log ) { + $this->trace_log[] = $this->debug(false); + } + + return $return_val; + + } // query + +} // ezSQL_pdo \ No newline at end of file From a1608cb6745b959dfcba7ff2a1ebc49c729db17b Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 20:27:01 +0200 Subject: [PATCH 032/126] Added disconnect method to the PDO class --- pdo/ez_sql_pdo.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pdo/ez_sql_pdo.php b/pdo/ez_sql_pdo.php index 1f3bdf7d..fb32027e 100755 --- a/pdo/ez_sql_pdo.php +++ b/pdo/ez_sql_pdo.php @@ -326,4 +326,11 @@ public function query($query) { } // query + /** + * Close the database connection + */ + public function disconnect(){ + $dbh = null; + } // disconnect + } // ezSQL_pdo \ No newline at end of file From 447edbf51c6186b1cd01e619af7b82bd1f7fae21 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 20:29:22 +0200 Subject: [PATCH 033/126] Revert "Added disconnect method to the PDO class" This reverts commit a1608cb6745b959dfcba7ff2a1ebc49c729db17b. --- pdo/ez_sql_pdo.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pdo/ez_sql_pdo.php b/pdo/ez_sql_pdo.php index fb32027e..1f3bdf7d 100755 --- a/pdo/ez_sql_pdo.php +++ b/pdo/ez_sql_pdo.php @@ -326,11 +326,4 @@ public function query($query) { } // query - /** - * Close the database connection - */ - public function disconnect(){ - $dbh = null; - } // disconnect - } // ezSQL_pdo \ No newline at end of file From bb6cbad27b47d2ae706983279fb0804da88c0eb8 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 20:32:30 +0200 Subject: [PATCH 034/126] Added disconnect method to the PDO class --- pdo/ez_sql_pdo.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pdo/ez_sql_pdo.php b/pdo/ez_sql_pdo.php index 1f3bdf7d..8e1c44e2 100755 --- a/pdo/ez_sql_pdo.php +++ b/pdo/ez_sql_pdo.php @@ -326,4 +326,11 @@ public function query($query) { } // query -} // ezSQL_pdo \ No newline at end of file + /** + * Close the database connection + */ + public function disconnect(){ + $this->dbh = null; + } // disconnect + +} // ezSQL_pdo From 897db8c8c799632f819d299a38d841281e979e05 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 21:28:19 +0200 Subject: [PATCH 035/126] - Changed the core class to PHP 5 syntax. - Cleared parameter formats from mixed commaspace / comma to comma space. - Added PHPDoc documentation tags and extended the documentation - Changed formatting to fit standards - Methods with public --- sqlite/ez_sql_sqlite.php | 416 ++++++++++++++++++++------------------- 1 file changed, 210 insertions(+), 206 deletions(-) diff --git a/sqlite/ez_sql_sqlite.php b/sqlite/ez_sql_sqlite.php index 09a5e188..fbdbf848 100755 --- a/sqlite/ez_sql_sqlite.php +++ b/sqlite/ez_sql_sqlite.php @@ -1,207 +1,211 @@ 'Require $dbpath and $dbname to open an SQLite database' - ); - - /********************************************************************** - * ezSQL Database specific class - SQLite - */ - - if ( ! function_exists ('sqlite_open') ) die('Fatal Error: ezSQL_sqlite requires SQLite Lib to be compiled and or linked in to the PHP engine'); - if ( ! class_exists ('ezSQLcore') ) die('Fatal Error: ezSQL_sqlite requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); - - class ezSQL_sqlite extends ezSQLcore - { - - /********************************************************************** - * Constructor - allow the user to perform a qucik connect at the - * same time as initialising the ezSQL_sqlite class - */ - - function ezSQL_sqlite($dbpath='', $dbname='') - { - // Turn on track errors - ini_set('track_errors',1); - - if ( $dbpath && $dbname ) - { - $this->connect($dbpath, $dbname); - } - } - - /********************************************************************** - * Try to connect to SQLite database server - */ - - function connect($dbpath='', $dbname='') - { - global $ezsql_sqlite_str; $return_val = false; - - // Must have a user and a password - if ( ! $dbpath || ! $dbname ) - { - $this->register_error($ezsql_sqlite_str[1].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_sqlite_str[1],E_USER_WARNING) : null; - } - // Try to establish the server database handle - else if ( ! $this->dbh = @sqlite_open($dbpath.$dbname) ) - { - $this->register_error($php_errormsg); - $this->show_errors ? trigger_error($php_errormsg,E_USER_WARNING) : null; - } - else - $return_val = true; - - return $return_val; - } - - /********************************************************************** - * In the case of SQLite quick_connect is not really needed - * because std. connect already does what quick connect does - - * but for the sake of consistency it has been included - */ - - function quick_connect($dbpath='', $dbname='') - { - return $this->connect($dbpath, $dbname); - } - - /********************************************************************** - * No real equivalent of mySQL select in SQLite - * once again, function included for the sake of consistency - */ - - function select($dbpath='', $dbname='') - { - return $this->connect($dbpath, $dbname); - } - - /********************************************************************** - * Format a SQLite string correctly for safe SQLite insert - * (no mater if magic quotes are on or not) - */ - - function escape($str) - { - return sqlite_escape_string(stripslashes(preg_replace("/[\r\n]/",'',$str))); - } - - /********************************************************************** - * Return SQLite specific system date syntax - * i.e. Oracle: SYSDATE Mysql: NOW() - */ - - function sysdate() - { - return 'now'; - } - - /********************************************************************** - * Perform SQLite query and try to detirmin result value - */ - - // ================================================================== - // Basic Query - see docs for more detail - - function query($query) - { - - // For reg expressions - $query = str_replace("/[\n\r]/",'',trim($query)); - - // initialise return - $return_val = 0; - - // Flush cached values.. - $this->flush(); - - // Log how the function was called - $this->func_call = "\$db->query(\"$query\")"; - - // Keep track of the last query for debug.. - $this->last_query = $query; - - // Perform the query via std mysql_query function.. - $this->result = @sqlite_query($this->dbh,$query); - $this->num_queries++; - - // If there is an error then take note of it.. - if (@sqlite_last_error($this->dbh)) - { - $err_str = sqlite_error_string (sqlite_last_error($this->dbh)); - $this->register_error($err_str); - $this->show_errors ? trigger_error($err_str,E_USER_WARNING) : null; - return false; - } - - // Query was an insert, delete, update, replace - if ( preg_match("/^(insert|delete|update|replace)\s+/i",$query) ) - { - $this->rows_affected = @sqlite_changes($this->dbh); - - // Take note of the insert_id - if ( preg_match("/^(insert|replace)\s+/i",$query) ) - { - $this->insert_id = @sqlite_last_insert_rowid($this->dbh); - } - - // Return number fo rows affected - $return_val = $this->rows_affected; - - } - // Query was an select - else - { - - // Take note of column info - $i=0; - while ($i < @sqlite_num_fields($this->result)) - { - $this->col_info[$i]->name = sqlite_field_name ( $this->result, $i); - $this->col_info[$i]->type = null; - $this->col_info[$i]->max_length = null; - $i++; - } - - // Store Query Results - $num_rows=0; - while ($row = @sqlite_fetch_array($this->result,SQLITE_ASSOC) ) - { - // Store relults as an objects within main array - $obj= (object) $row; //convert to object - $this->last_result[$num_rows] = $obj; - $num_rows++; - } - - // Log number of rows the query returned - $this->num_rows = $num_rows; - - // Return number of rows selected - $return_val = $this->num_rows; - - } - - // If debug ALL queries - $this->trace||$this->debug_all ? $this->debug() : null ; - - return $return_val; - - } - - } - -?> +/** + * ezSQL class - SQLite + * Desc..: SQLite component (part of ezSQL databse abstraction library) + * + * @author Justin Vincent (jv@jvmultimedia.com) + * @author Stefanie Janine Stoelting (mail@stefanie-stoelting.de) + * @link http://twitter.com/justinvincent + * @name ezSQL_sqlite + * @package ezSQL + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + * + */ +class ezSQL_sqlite extends ezSQLcore { + /** + * ezSQL error strings - SQLite + * @var array + */ + private $ezsql_sqlite_str = array + ( + 1 => 'Require $dbpath and $dbname to open an SQLite database' + ); + + /** + * Constructor - allow the user to perform a qucik connect at the same time + * as initialising the ezSQL_sqlite class + * + * @param string $dbpath Path to the SQLite file + * Default is empty string + * @param string $dbname Name of the database + * Default is empty string + */ + public function __construct($dbpath='', $dbname='') { + if ( ! function_exists ('sqlite_open') ) { + throw new Exception('Fatal Error: ezSQL_sqlite requires SQLite Lib to be compiled and or linked in to the PHP engine'); + } + if ( ! class_exists ('ezSQLcore') ) { + throw new Exception('Fatal Error: ezSQL_sqlite requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); + } + + parent::__construct(); + + // Turn on track errors + ini_set('track_errors',1); + + if ( $dbpath && $dbname ) { + $this->connect($dbpath, $dbname); + } + } // __construct + + /** + * Try to connect to SQLite database server + * + * @param string $dbpath Path to the SQLite file + * Default is empty string + * @param string $dbname Name of the database + * Default is empty string + * @return boolean + */ + public function connect($dbpath='', $dbname='') { + $return_val = false; + + // Must have a user and a password + if ( ! $dbpath || ! $dbname ) { + $this->register_error($this->ezsql_sqlite_str[1] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_sqlite_str[1], E_USER_WARNING) : null; + } else if ( ! $this->dbh = @sqlite_open($dbpath . $dbname) ) { + // Try to establish the server database handle + $this->register_error($php_errormsg); + $this->show_errors ? trigger_error($php_errormsg, E_USER_WARNING) : null; + } + else + $return_val = true; + + return $return_val; + } // connect + + /** + * In the case of SQLite quick_connect is not really needed because std. + * connect already does what quick connect does - but for the sake of + * consistency it has been included + * + * @param string $dbpath Path to the SQLite file + * Default is empty string + * @param string $dbname Name of the database + * Default is empty string + * @return boolean + */ + public function quick_connect($dbpath='', $dbname='') { + return $this->connect($dbpath, $dbname); + } // quick_connect + + /** + * No real equivalent of mySQL select in SQLite once again, function + * included for the sake of consistency + * + * @param string $dbpath Path to the SQLite file + * Default is empty string + * @param string $dbname Name of the database + * Default is empty string + * @return boolean + */ + public function select($dbpath='', $dbname='') { + return $this->connect($dbpath, $dbname); + } // select + + /** + * Format a SQLite string correctly for safe SQLite insert + * (no matter if magic quotes are on or not) + * + * @param string $str + * @return string + */ + public function escape($str) { + return sqlite_escape_string(stripslashes(preg_replace("/[\r\n]/",'',$str))); + } // escape + + /** + * Return SQLite specific system date syntax + * i.e. Oracle: SYSDATE Mysql: NOW() + * + * @return string + */ + public function sysdate() { + return 'now'; + } // sysdate + + /** + * Perform SQLite query and try to detirmin result value + * Basic Query - see docs for more detail + * + * @param string $query + * @return object + */ + public function query($query) { + + // For reg expressions + $query = str_replace("/[\n\r]/", '', trim($query)); + + // Initialise return + $return_val = 0; + + // Flush cached values.. + $this->flush(); + + // Log how the function was called + $this->func_call = "\$db->query(\"$query\")"; + + // Keep track of the last query for debug.. + $this->last_query = $query; + + // Perform the query via std mysql_query function.. + $this->result = @sqlite_query($this->dbh, $query); + $this->num_queries++; + + // If there is an error then take note of it.. + if (@sqlite_last_error($this->dbh)){ + $err_str = sqlite_error_string (sqlite_last_error($this->dbh)); + $this->register_error($err_str); + $this->show_errors ? trigger_error($err_str, E_USER_WARNING) : null; + return false; + } + + // Query was an insert, delete, update, replace + if ( preg_match("/^(insert|delete|update|replace)\s+/i", $query) ) { + $this->rows_affected = @sqlite_changes($this->dbh); + + // Take note of the insert_id + if ( preg_match("/^(insert|replace)\s+/i", $query) ) { + $this->insert_id = @sqlite_last_insert_rowid($this->dbh); + } + + // Return number fo rows affected + $return_val = $this->rows_affected; + + } else { + // Query was an select + + // Take note of column info + $i=0; + while ($i < @sqlite_num_fields($this->result)) { + $this->col_info[$i]->name = sqlite_field_name ($this->result, $i); + $this->col_info[$i]->type = null; + $this->col_info[$i]->max_length = null; + $i++; + } + + // Store Query Results + $num_rows=0; + while ($row = @sqlite_fetch_array($this->result, SQLITE_ASSOC)) { + // Store relults as an objects within main array + $obj= (object) $row; //convert to object + $this->last_result[$num_rows] = $obj; + $num_rows++; + } + + // Log number of rows the query returned + $this->num_rows = $num_rows; + + // Return number of rows selected + $return_val = $this->num_rows; + } + + // If debug ALL queries + $this->trace||$this->debug_all ? $this->debug() : null ; + + return $return_val; + + } // query + +} // ezSQL_sqlite \ No newline at end of file From 674629525e041a56af6e9653fb99e95164bb95d0 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 21:29:07 +0200 Subject: [PATCH 036/126] Added disconnect method to the SQLite class --- sqlite/ez_sql_sqlite.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sqlite/ez_sql_sqlite.php b/sqlite/ez_sql_sqlite.php index fbdbf848..8ab7183e 100755 --- a/sqlite/ez_sql_sqlite.php +++ b/sqlite/ez_sql_sqlite.php @@ -208,4 +208,11 @@ public function query($query) { } // query + /** + * Close the database connection + */ + public function disconnect(){ + $this->dbh = null; + } // disconnect + } // ezSQL_sqlite \ No newline at end of file From ec3593e3a9d04e4c0e3809437256a613cc1c74d3 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 22:19:51 +0200 Subject: [PATCH 037/126] - Changed the core class to PHP 5 syntax. - Cleared parameter formats from mixed commaspace / comma to comma space. - Added PHPDoc documentation tags and extended the documentation - Changed formatting to fit standards - Methods with public --- sybase/ez_sql_sybase.php | 800 ++++++++++++++++++++------------------- 1 file changed, 412 insertions(+), 388 deletions(-) diff --git a/sybase/ez_sql_sybase.php b/sybase/ez_sql_sybase.php index 8e999286..6d1ed35b 100644 --- a/sybase/ez_sql_sybase.php +++ b/sybase/ez_sql_sybase.php @@ -1,389 +1,413 @@ 'Require $dbuser and $dbpassword to connect to a database server', - 2 => 'Error establishing sybase database connection. Correct user/password? Correct hostname? Database server running?', - 3 => 'Require $dbname to select a database', - 4 => 'SQL Server database connection is not active', - 5 => 'Unexpected error while trying to select database' - ); - - /********************************************************************** - * ezSQL Database specific class - sybase - */ - - if ( ! function_exists ('sybase_connect') ) die('Fatal Error: ezSQL_sybase requires ntwdblib.dll to be present in your winowds\system32 folder. Also enable sybase extenstion in PHP.ini file '); - if ( ! class_exists ('ezSQLcore') ) die('Fatal Error: ezSQL_sybase requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); - - class ezSQL_sybase extends ezSQLcore - { - - var $dbuser = false; - var $dbpassword = false; - var $dbname = false; - var $dbhost = false; - //if we want to convert Queries in MySql syntax to Sybase syntax. Yes, there - //are some differences in query syntax. - var $convertMySqlTosybaseQuery = TRUE; - - /********************************************************************** - * Constructor - allow the user to perform a qucik connect at the - * same time as initialising the ezSQL_sybase class - */ - - function ezSQL_sybase($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $convertMySqlTosybaseQuery=true) - { - $this->dbuser = $dbuser; - $this->dbpassword = $dbpassword; - $this->dbname = $dbname; - $this->dbhost = $dbhost; - $this->convertMySqlTosybaseQuery = $convertMySqlTosybaseQuery; - } - - /********************************************************************** - * Short hand way to connect to sybase database server - * and select a sybase database at the same time - */ - - function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') - { - $return_val = false; - if ( ! $this->connect($dbuser, $dbpassword, $dbhost,true) ) ; - else if ( ! $this->select($dbname) ) ; - else $return_val = true; - return $return_val; - } - - /********************************************************************** - * Try to connect to sybase database server - */ - - function connect($dbuser='', $dbpassword='', $dbhost='localhost') - { - global $ezsql_sybase_str; $return_val = false; - - // Must have a user and a password - if ( ! $dbuser ) - { - $this->register_error($ezsql_sybase_str[1].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_sybase_str[1],E_USER_WARNING) : null; - } - // Try to establish the server database handle - - else if ( ! $this->dbh = @sybase_connect($dbhost,$dbuser,$dbpassword) ) - { - $this->register_error($ezsql_sybase_str[2].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_sybase_str[2],E_USER_WARNING) : null; - } - else - { - $this->dbuser = $dbuser; - $this->dbpassword = $dbpassword; - $this->dbhost = $dbhost; - $return_val = true; - } - - return $return_val; - } - - /********************************************************************** - * Try to select a sybase database - */ - - function select($dbname='') - { - global $ezsql_sybase_str; $return_val = false; - - // Must have a database name - if ( ! $dbname ) - { - $this->register_error($ezsql_sybase_str[3].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_sybase_str[3],E_USER_WARNING) : null; - } - - // Must have an active database connection - else if ( ! $this->dbh ) - { - $this->register_error($ezsql_sybase_str[4].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_sybase_str[4],E_USER_WARNING) : null; - } - - // Try to connect to the database - - else if ( !@sybase_select_db($dbname,$this->dbh) ) - { - $str = $ezsql_sybase_str[5]; - - $this->register_error($str.' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($str,E_USER_WARNING) : null; - } - else - { - $this->dbname = $dbname; - $return_val = true; - } - - return $return_val; - } - - /********************************************************************** - * Format a sybase string correctly for safe sybase insert - * (no mater if magic quotes are on or not) - */ - - function escape($str) - { - //not sure about this. - //applying following logic - //1. add 1 more ' to ' character - - return str_ireplace("'", "''", $str); - - } - - /********************************************************************** - * Return sybase specific system date syntax - * i.e. Oracle: SYSDATE sybase: getDate() - */ - - function sysdate() - { - return 'getDate()'; - } - - /********************************************************************** - * Perform sybase query and try to detirmin result value - */ - - function query($query) - { - - //if flag to convert query from MySql syntax to Sybase syntax is true - //convert the query - if($this->convertMySqlTosybaseQuery == true) - $query = $this->ConvertMySqlTosybase($query); - - - - // Initialise return - $return_val = 0; - - - // Flush cached values.. - $this->flush(); - - // For reg expressions - $query = trim($query); - - // Log how the function was called - $this->func_call = "\$db->query(\"$query\")"; - - // Keep track of the last query for debug.. - $this->last_query = $query; - - // Count how many queries there have been - $this->num_queries++; - - // Use core file cache function - if ( $cache = $this->get_cache($query) ) - { - return $cache; - } - - - // If there is no existing database connection then try to connect - if ( ! isset($this->dbh) || ! $this->dbh ) - { - $this->connect($this->dbuser, $this->dbpassword, $this->dbhost); - $this->select($this->dbname); - } - - - - - // Perform the query via std sybase_query function.. - - $this->result = @sybase_query($query); - - - - // If there is an error then take note of it.. - if ($this->result == false ) - { - - $get_errorcodeSql = "SELECT @@ERROR as errorcode"; - $error_res = @sybase_query($get_errorcodeSql, $this->dbh); - $errorCode = @sybase_result($error_res, 0, "errorcode"); - - $get_errorMessageSql = "SELECT severity as errorSeverity, text as errorText FROM sys.messages WHERE message_id = ".$errorCode ; - $errormessage_res = @sybase_query($get_errorMessageSql, $this->dbh); - if($errormessage_res) - { - $errorMessage_Row = @sybase_fetch_row($errormessage_res); - $errorSeverity = $errorMessage_Row[0]; - $errorMessage = $errorMessage_Row[1]; - } - - $sqlError = "ErrorCode: ".$errorCode." ### Error Severity: ".$errorSeverity." ### Error Message: ".$errorMessage." ### Query: ".$query; - - $is_insert = true; - $this->register_error($sqlError); - $this->show_errors ? trigger_error($sqlError ,E_USER_WARNING) : null; - return false; - } - - - - - // Query was an insert, delete, update, replace - $is_insert = false; - if ( preg_match("/^(insert|delete|update|replace)\s+/i",$query) ) - { - $this->rows_affected = @sybase_rows_affected($this->dbh); - - // Take note of the insert_id - if ( preg_match("/^(insert|replace)\s+/i",$query) ) - { - - $identityresultset = @sybase_query("select SCOPE_IDENTITY()"); - - if ($identityresultset != false ) - { - $identityrow = @sybase_fetch_row($identityresultset); - $this->insert_id = $identityrow[0]; - } - - } - - // Return number of rows affected - $return_val = $this->rows_affected; - } - // Query was a select - else - { - - // Take note of column info - $i=0; - while ($i < @sybase_num_fields($this->result)) - { - $this->col_info[$i] = @sybase_fetch_field($this->result); - $i++; - - } - - // Store Query Results - $num_rows=0; - - while ( $row = @sybase_fetch_object($this->result) ) - { - - // Store relults as an objects within main array - $this->last_result[$num_rows] = $row; - $num_rows++; - } - - @sybase_free_result($this->result); - - // Log number of rows the query returned - $this->num_rows = $num_rows; - - // Return number of rows selected - $return_val = $this->num_rows; - } - - // disk caching of queries - $this->store_cache($query,$is_insert); - - // If debug ALL queries - $this->trace || $this->debug_all ? $this->debug() : null ; - - return $return_val; - - } - - - - /********************************************************************** - * Convert a Query From MySql Syntax to Sybase syntax - Following conversions are made:- - 1. The '`' character used for MySql queries is not supported - the character is removed. - 2. FROM_UNIXTIME method is not supported. The Function is removed.It is replaced with - getDate(). Warning: This logic may not be right. - 3. unix_timestamp function is removed. - 4. LIMIT keyowrd is replaced with TOP keyword. Warning: Logic not fully tested. - - Note: This method is only a small attempt to convert the syntax. There are many aspects which are not covered here. - This method doesn't at all guarantee complete conversion. Certain queries will still - not work. - */ - - function ConvertMySqlTosybase($query) - { - - - //replace the '`' character used for MySql queries, but not - //supported in Sybase - - $query = str_replace("`", "", $query); - - //replace From UnixTime command in Sybase, doesn't work - - $pattern = "/FROM_UNIXTIME\(([^\/]{0,})\)/i"; - $replacement = "getdate()"; - //ereg($pattern, $query, $regs); - //we can get the Unix Time function parameter value from this string - //$valueInsideFromUnixTime = $regs[1]; - - $query = preg_replace($pattern, $replacement, $query); - - - //replace LIMIT keyword. Works only on MySql not on Sybase - //replace it with TOP keyword - - $pattern = "/LIMIT[^\w]{1,}([0-9]{1,})([\,]{0,})([0-9]{0,})/i"; - $replacement = ""; - preg_match($pattern, $query, $regs); - - $query = preg_replace($pattern, $replacement, $query); - - if(count($regs) > 0): - if($regs[2]) - $query = str_ireplace("SELECT ", "SELECT TOP ".$regs[3]." ", $query); - else - { - if($regs[1]) - $query = str_ireplace("SELECT ", "SELECT TOP ".$regs[1]." ", $query); - } - endif; - - //replace unix_timestamp function. Doesn't work in Sybase - $pattern = "/unix_timestamp\(([^\/]{0,})\)/i"; - $replacement = "\\1"; - $query = preg_replace($pattern, $replacement, $query); - - return $query; - - } - - - - - } - - -?> +/** + * ezSQL class - Sybase ASE + * Desc..: Sybase ASE component (part of ezSQL database abstraction library) - + * based on ezSql_mssql library class. + * + * @author Muhammad Iyas (iyasilias@gmail.com) + * @author Stefanie Janine Stoelting (mail@stefanie-stoelting.de) + * @link + * @name ezSQL_sybase + * @package ezSQL + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + * + */ +class ezSQL_sybase extends ezSQLcore +{ + /** + * ezSQL error strings - Sybase ASE + * @var array + */ + private $ezsql_sybase_str = array + ( + 1 => 'Require $dbuser and $dbpassword to connect to a database server', + 2 => 'Error establishing sybase database connection. Correct user/password? Correct hostname? Database server running?', + 3 => 'Require $dbname to select a database', + 4 => 'SQL Server database connection is not active', + 5 => 'Unexpected error while trying to select database' + ); + + /** + * Database user name + * @var string + */ + private $dbuser; + + /** + * Database password for the given user + * @var string + */ + private $dbpassword; + + /** + * Database name + * @var string + */ + private $dbname; + + /** + * Host name or IP address + * @var string + */ + private $dbhost; + + /** + * if we want to convert Queries in MySql syntax to Sybase syntax. Yes, + * there are some differences in query syntax. + * @var boolean Default is true + */ + private $convertMySqlToSybaseQuery = true; + + /********************************************************************** + * Constructor - allow the user to perform a qucik connect at the + * same time as initialising the ezSQL_sybase class + */ + + /** + * + * @param string $dbuser The database user name + * Default is empty string + * @param string $dbpassword The database users password + * Default is empty string + * @param string $dbname The name of the database + * Default is empty string + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @param boolean $convertMySqlToSybaseQuery Default is true + * @throws Exception Requires ntwdblib.dll and ez_sql_core.php + */ + public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $convertMySqlToSybaseQuery=true) { + if ( ! function_exists ('sybase_connect') ) { + throw new Exception('Fatal Error: ezSQL_sybase requires ntwdblib.dll to be present in your winowds\system32 folder. Also enable sybase extenstion in PHP.ini file '); + } + if ( ! class_exists ('ezSQLcore') ) { + throw new Exception('Fatal Error: ezSQL_sybase requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); + } + + sybase_min_server_severity(20); + parent::__construct(); + + $this->dbuser = $dbuser; + $this->dbpassword = $dbpassword; + $this->dbname = $dbname; + $this->dbhost = $dbhost; + $this->convertMySqlToSybaseQuery = $convertMySqlToSybaseQuery; + } // __construct + + /** + * Short hand way to connect to sybase database server and select a sybase + * database at the same time + * + * @param string $dbuser The database user name + * Default is empty string + * @param string $dbpassword The database users password + * Default is empty string + * @param string $dbname The name of the database + * Default is empty string + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @return boolean + */ + public function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') { + $return_val = false; + if ( ! $this->connect($dbuser, $dbpassword, $dbhost,true) ) ; + else if ( ! $this->select($dbname) ) ; + else $return_val = true; + return $return_val; + } // quick_connect + + /** + * Try to connect to sybase database server + * + * @param string $dbuser The database user name + * Default is empty string + * @param string $dbpassword The database users password + * Default is empty string + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @return boolean + */ + public function connect($dbuser='', $dbpassword='', $dbhost='localhost') { + $return_val = false; + + // Must have a user and a password + if ( ! $dbuser ) { + $this->register_error($this->ezsql_sybase_str[1] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_sybase_str[1], E_USER_WARNING) : null; + } else if ( ! $this->dbh = @sybase_connect($dbhost, $dbuser, $dbpassword) ) { + // Try to establish the server database handle + $this->register_error($this->ezsql_sybase_str[2] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_sybase_str[2], E_USER_WARNING) : null; + } else { + $this->dbuser = $dbuser; + $this->dbpassword = $dbpassword; + $this->dbhost = $dbhost; + $return_val = true; + } + + return $return_val; + } // connect + + /********************************************************************** + * + */ + + /** + * Try to select a sybase database + * + * @param string $dbname + * @return boolean + */ + public function select($dbname='') { + $return_val = false; + + // Must have a database name + if ( ! $dbname ) { + $this->register_error($this->ezsql_sybase_str[3] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_sybase_str[3], E_USER_WARNING) : null; + } else if ( ! $this->dbh ) { + // Must have an active database connection + $this->register_error($this->ezsql_sybase_str[4] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_sybase_str[4], E_USER_WARNING) : null; + } else if ( !@sybase_select_db($dbname,$this->dbh) ) { + // Try to connect to the database + $str = $ezsql_sybase_str[5]; + + $this->register_error($str . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($str, E_USER_WARNING) : null; + } else { + $this->dbname = $dbname; + $return_val = true; + } + + return $return_val; + } // select + + /** + * Format a sybase string correctly for safe sybase insert + * + * @param string $str + * @return string + */ + public function escape($str) { + $return_val = ''; + + if ( !isset($str) or empty($str) ) { + $return_val = ''; + } else if ( is_numeric($str) ) { + $return_val = $str; + } else { + $non_displayables = array( + '/%0[0-8bcef]/', // url encoded 00-08, 11, 12, 14, 15 + '/%1[0-9a-f]/', // url encoded 16-31 + '/[\x00-\x08]/', // 00-08 + '/\x0b/', // 11 + '/\x0c/', // 12 + '/[\x0e-\x1f]/' // 14-31 + ); + + foreach ( $non_displayables as $regex ) { + $str = preg_replace( $regex, '', $str ); + } + + $return_val = str_replace("'", "''", $str ); + } + + return $return_val; + } // escape + + /** + * Return sybase specific system date syntax + * i.e. Oracle: SYSDATE sybase: getDate() + * + * @return string + */ + public function sysdate() { + return 'getDate()'; + } // sysdate + + /** + * Perform sybase query and try to detirmin result value + * + * @param string $query + * @return object + */ + public function query($query) { + // If flag to convert query from MySql syntax to Sybase syntax is true + // Convert the query + if($this->convertMySqlTosybaseQuery == true) { + $query = $this->ConvertMySqlTosybase($query); + } + + // Initialise return + $return_val = 0; + + // Flush cached values.. + $this->flush(); + + // For reg expressions + $query = trim($query); + + // Log how the function was called + $this->func_call = "\$db->query(\"$query\")"; + + // Keep track of the last query for debug.. + $this->last_query = $query; + + // Count how many queries there have been + $this->num_queries++; + + // Use core file cache function + if ( $cache = $this->get_cache($query) ) { + return $cache; + } + + // If there is no existing database connection then try to connect + if ( ! isset($this->dbh) || ! $this->dbh ) { + $this->connect($this->dbuser, $this->dbpassword, $this->dbhost); + $this->select($this->dbname); + } + + + // Perform the query via std sybase_query function.. + $this->result = @sybase_query($query); + + // If there is an error then take note of it.. + if ($this->result == false ) { + + $get_errorcodeSql = "SELECT @@ERROR as errorcode"; + $error_res = @sybase_query($get_errorcodeSql, $this->dbh); + $errorCode = @sybase_result($error_res, 0, 'errorcode'); + + $get_errorMessageSql = 'SELECT severity as errorSeverity, text as errorText FROM sys.messages WHERE message_id = ' . $errorCode; + $errormessage_res = @sybase_query($get_errorMessageSql, $this->dbh); + if($errormessage_res) { + $errorMessage_Row = @sybase_fetch_row($errormessage_res); + $errorSeverity = $errorMessage_Row[0]; + $errorMessage = $errorMessage_Row[1]; + } + + $sqlError = 'ErrorCode: ' . $errorCode. ' ### Error Severity: ' . $errorSeverity . ' ### Error Message: ' . $errorMessage.' ### Query: ' . $query; + + $is_insert = true; + $this->register_error($sqlError); + $this->show_errors ? trigger_error($sqlError, E_USER_WARNING) : null; + return false; + } + + // Query was an insert, delete, update, replace + $is_insert = false; + if ( preg_match("/^(insert|delete|update|replace)\s+/i", $query) ) { + $this->rows_affected = @sybase_rows_affected($this->dbh); + + // Take note of the insert_id + if ( preg_match("/^(insert|replace)\s+/i",$query) ) { + + $identityresultset = @sybase_query('select SCOPE_IDENTITY()'); + + if ($identityresultset != false ) { + $identityrow = @sybase_fetch_row($identityresultset); + $this->insert_id = $identityrow[0]; + } + } + + // Return number of rows affected + $return_val = $this->rows_affected; + } else { + // Query was a select + // Take note of column info + $i=0; + while ($i < @sybase_num_fields($this->result)) { + $this->col_info[$i] = @sybase_fetch_field($this->result); + $i++; + } + + // Store Query Results + $num_rows=0; + + while ( $row = @sybase_fetch_object($this->result) ) { + // Store relults as an objects within main array + $this->last_result[$num_rows] = $row; + $num_rows++; + } + + @sybase_free_result($this->result); + + // Log number of rows the query returned + $this->num_rows = $num_rows; + + // Return number of rows selected + $return_val = $this->num_rows; + } + + // disk caching of queries + $this->store_cache($query, $is_insert); + + // If debug ALL queries + $this->trace || $this->debug_all ? $this->debug() : null ; + + return $return_val; + + } // query + + /** + * Convert a Query From MySql Syntax to Sybase syntax + * Following conversions are made: + * 1. The '`' character used for MySql queries is not supported - the + * character is removed. + * 2. FROM_UNIXTIME method is not supported. The Function is removed.It is + * replaced with getDate(). Warning: This logic may not be right. + * 3. unix_timestamp function is removed. + * 4. LIMIT keyowrd is replaced with TOP keyword. Warning: Logic not fully + * tested. + * + * Note: This method is only a small attempt to convert the syntax. There + * are many aspects which are not covered here. This method doesn't at + * all guarantee complete conversion. Certain queries will still not + * work. + * + * @param string $query + * @return string + */ + public function ConvertMySqlTosybase($query) { + //replace the '`' character used for MySql queries, but not + //supported in Sybase + + $query = str_replace('`', '', $query); + + //replace From UnixTime command in Sybase, doesn't work + + $pattern = "/FROM_UNIXTIME\(([^\/]{0,})\)/i"; + $replacement = 'getdate()'; + //ereg($pattern, $query, $regs); + //we can get the Unix Time function parameter value from this string + //$valueInsideFromUnixTime = $regs[1]; + + $query = preg_replace($pattern, $replacement, $query); + + //replace LIMIT keyword. Works only on MySql not on Sybase + //replace it with TOP keyword + + $pattern = "/LIMIT[^\w]{1,}([0-9]{1,})([\,]{0,})([0-9]{0,})/i"; + $replacement = ''; + preg_match($pattern, $query, $regs); + + $query = preg_replace($pattern, $replacement, $query); + + if(count($regs) > 0) { + if($regs[2]) { + $query = str_ireplace('SELECT ', 'SELECT TOP ' . $regs[3] . ' ', $query); + } else if($regs[1]) { + $query = str_ireplace('SELECT ', 'SELECT TOP ' . $regs[1] . ' ', $query); + } + } + + //replace unix_timestamp function. Doesn't work in Sybase + $pattern = "/unix_timestamp\(([^\/]{0,})\)/i"; + $replacement = "\\1"; + $query = preg_replace($pattern, $replacement, $query); + + return $query; + } + +} // ezSQL_sybase \ No newline at end of file From 63be31992b8ad3f4c79200deb91a5b332cbfdf84 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 22:24:39 +0200 Subject: [PATCH 038/126] Added disconnect method to MS SQL Server class --- mssql/ez_sql_mssql.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/mssql/ez_sql_mssql.php b/mssql/ez_sql_mssql.php index 232e504c..12cf5dfb 100755 --- a/mssql/ez_sql_mssql.php +++ b/mssql/ez_sql_mssql.php @@ -11,7 +11,8 @@ * @package ezSQL * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) */ -class ezSQL_mssql extends ezSQLcore { +class ezSQL_mssql extends ezSQLcore +{ /** * ezSQL error strings - mssql * @var array Default 5 error messages @@ -376,7 +377,7 @@ public function ConvertMySqlToMSSql($query) { // replace LIMIT keyword. Works only on MySql not on MS-Sql // replace it with TOP keyword $pattern = "LIMIT[^\w]{1,}([0-9]{1,})([\,]{0,})([0-9]{0,})"; - $replacement = ""; + $replacement = ''; eregi($pattern, $query, $regs); $query = eregi_replace($pattern, $replacement, $query); @@ -394,6 +395,15 @@ public function ConvertMySqlToMSSql($query) { return $query; } // ConvertMySqlToMSSql + /** + * Close the database connection + */ + public function disconnect() { + if ( $this->dbh ) { + $this->dbh = null; + } + } // disconnect + /** * Returns the current database server host * From fa75bea0ad5c98aa464d8992d3d3904dcc740f77 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 22:25:38 +0200 Subject: [PATCH 039/126] Added disconnect and getHost methods to Sybase ASE class --- sybase/ez_sql_sybase.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sybase/ez_sql_sybase.php b/sybase/ez_sql_sybase.php index 6d1ed35b..8d93d08c 100644 --- a/sybase/ez_sql_sybase.php +++ b/sybase/ez_sql_sybase.php @@ -410,4 +410,22 @@ public function ConvertMySqlTosybase($query) { return $query; } + /** + * Close the database connection + */ + public function disconnect() { + if ( $this->dbh ) { + $this->dbh = null; + } + } // disconnect + + /** + * Returns the current database server host + * + * @return string + */ + public function getDBHost() { + return $this->dbhost; + } // getDBHost + } // ezSQL_sybase \ No newline at end of file From 0dfcc6098a4eca455e8fe1ef5026b5c355da8c47 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 22:27:43 +0200 Subject: [PATCH 040/126] Done some code formatting changes to meet the standard --- mysql/ez_sql_mysql.php | 3 ++- pdo/ez_sql_pdo.php | 3 ++- postgresql/ez_sql_postgresql.php | 3 ++- shared/ez_sql_core.php | 3 ++- sqlite/ez_sql_sqlite.php | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/mysql/ez_sql_mysql.php b/mysql/ez_sql_mysql.php index c325e18f..f682d7f4 100755 --- a/mysql/ez_sql_mysql.php +++ b/mysql/ez_sql_mysql.php @@ -11,7 +11,8 @@ * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) * */ -class ezSQL_mysql extends ezSQLcore { +class ezSQL_mysql extends ezSQLcore +{ /* * ezSQL error strings - mySQL * @var array diff --git a/pdo/ez_sql_pdo.php b/pdo/ez_sql_pdo.php index 8e1c44e2..6c2405a3 100755 --- a/pdo/ez_sql_pdo.php +++ b/pdo/ez_sql_pdo.php @@ -11,7 +11,8 @@ * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) * */ -class ezSQL_pdo extends ezSQLcore { +class ezSQL_pdo extends ezSQLcore +{ /** * ezSQL error strings - PDO * @var array diff --git a/postgresql/ez_sql_postgresql.php b/postgresql/ez_sql_postgresql.php index cf263396..1190a8a8 100755 --- a/postgresql/ez_sql_postgresql.php +++ b/postgresql/ez_sql_postgresql.php @@ -11,7 +11,8 @@ * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) * */ -class ezSQL_postgresql extends ezSQLcore { +class ezSQL_postgresql extends ezSQLcore +{ /* * ezSQL error strings - mySQL * @var array diff --git a/shared/ez_sql_core.php b/shared/ez_sql_core.php index d0a0ab3b..513db36b 100755 --- a/shared/ez_sql_core.php +++ b/shared/ez_sql_core.php @@ -11,7 +11,8 @@ * @package ezSQL * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) */ -class ezSQLcore { +class ezSQLcore +{ /** * Constant string ezSQL version information */ diff --git a/sqlite/ez_sql_sqlite.php b/sqlite/ez_sql_sqlite.php index 8ab7183e..f8ae4f71 100755 --- a/sqlite/ez_sql_sqlite.php +++ b/sqlite/ez_sql_sqlite.php @@ -11,7 +11,8 @@ * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) * */ -class ezSQL_sqlite extends ezSQLcore { +class ezSQL_sqlite extends ezSQLcore +{ /** * ezSQL error strings - SQLite * @var array From 42005a263039be108cb50758cd10cdd0ad752031 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 22:36:22 +0200 Subject: [PATCH 041/126] Extended the documentation of the constructor with the default values of the parameter --- mssql/ez_sql_mssql.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mssql/ez_sql_mssql.php b/mssql/ez_sql_mssql.php index 12cf5dfb..2885a1b3 100755 --- a/mssql/ez_sql_mssql.php +++ b/mssql/ez_sql_mssql.php @@ -62,8 +62,11 @@ class ezSQL_mssql extends ezSQLcore * as initialising the ezSQL_mssql class * * @param string $dbuser The database user name + * Default is empty string * @param string $dbpassword The database users password + * Default is empty string * @param string $dbname The name of the database + * Default is empty string * @param string $dbhost The host name or IP address of the database server. * Default is localhost * @param boolean $convertMySqlToMSSqlQuery Default is true From 8bb7834abccd4c670a1c96639559f62ad2a76710 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 22:59:01 +0200 Subject: [PATCH 042/126] - Changed the core class to PHP 5 syntax. - Cleared parameter formats from mixed commaspace / comma to comma space. - Added PHPDoc documentation tags and extended the documentation - Changed formatting to fit standards - Methods with public --- oracle8_9/ez_sql_oracle8_9.php | 612 ++++++++++++++++++--------------- 1 file changed, 339 insertions(+), 273 deletions(-) diff --git a/oracle8_9/ez_sql_oracle8_9.php b/oracle8_9/ez_sql_oracle8_9.php index 75f6dc2e..985fd9fc 100755 --- a/oracle8_9/ez_sql_oracle8_9.php +++ b/oracle8_9/ez_sql_oracle8_9.php @@ -1,274 +1,340 @@ 'Require $dbuser, $dbpassword and $dbname to connect to a database server', - 2 => 'ezSQL auto created the following Oracle sequence' - ); - - /********************************************************************** - * ezSQL Database specific class - Oracle - */ - - if ( ! function_exists ('OCILogon') ) die('Fatal Error: ezSQL_oracle8_9 requires Oracle OCI Lib to be compiled and/or linked in to the PHP engine'); - if ( ! class_exists ('ezSQLcore') ) die('Fatal Error: ezSQL_oracle8_9 requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); - - class ezSQL_oracle8_9 extends ezSQLcore - { - - var $dbuser = false; - var $dbpassword = false; - var $dbname = false; - - /********************************************************************** - * Constructor - allow the user to perform a qucik connect at the - * same time as initialising the ezSQL_oracle8_9 class - */ - - function ezSQL_oracle8_9($dbuser='', $dbpassword='', $dbname='') - { - - // Turn on track errors - ini_set('track_errors',1); - - $this->dbuser = $dbuser; - $this->dbpassword = $dbpassword; - $this->dbname = $dbname; - - } - - /********************************************************************** - * Try to connect to Oracle database server - */ - - function connect($dbuser='', $dbpassword='', $dbname='') - { - global $ezsql_oracle8_9_str; $return_val = false; - - // Must have a user and a password - if ( ! $dbuser || ! $dbpassword || ! $dbname ) - { - $this->register_error($ezsql_oracle8_9_str[1].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_oracle8_9_str[1],E_USER_WARNING) : null; - } - // Try to establish the server database handle - else if ( ! $this->dbh = OCILogon($dbuser, $dbpassword, $dbname) ) - { - $this->register_error($php_errormsg); - $this->show_errors ? trigger_error($php_errormsg,E_USER_WARNING) : null; - } - else - { - $this->dbuser = $dbuser; - $this->dbpassword = $dbpassword; - $this->dbname = $dbname; - $return_val = true; - } - - return $return_val; - } - - /********************************************************************** - * In the case of Oracle quick_connect is not really needed - * because std. connect already does what quick connect does - - * but for the sake of consistency it has been included - */ - - function quick_connect($dbuser='', $dbpassword='', $dbname='') - { - return $this->connect($dbuser='', $dbpassword='', $dbname=''); - } - - /********************************************************************** - * No real equivalent of mySQL select in Oracle - * once again, function included for the sake of consistency - */ - - function select($dbuser='', $dbpassword='', $dbname='') - { - return $this->connect($dbuser='', $dbpassword='', $dbname=''); - } - - /********************************************************************** - * Format a Oracle string correctly for safe Oracle insert - * (no mater if magic quotes are on or not) - */ - - function escape($str) - { - return str_replace("'","''",str_replace("''","'",stripslashes($str))); - } - - /********************************************************************** - * Return Oracle specific system date syntax - * i.e. Oracle: SYSDATE Mysql: NOW() - */ - - function sysdate() - { - return "SYSDATE"; - } - - /********************************************************************** - * These special Oracle functions make sure that even if your test - * pattern is '' it will still match records that are null if - * you don't use these funcs then oracle will return no results - * if $user = ''; even if there were records that = '' - * - * SELECT * FROM USERS WHERE USER = ".$db->is_equal_str($user)." - */ - - function is_equal_str($str='') - { - return ($str==''?'IS NULL':"= '".$this->escape($str)."'"); - } - - function is_equal_int($int) - { - return ($int==''?'IS NULL':'= '.$int); - } - - /********************************************************************** - * Another oracle specific function - if you have set up a sequence - * this function returns the next ID from that sequence - */ - - function insert_id($seq_name) - { - global $ezsql_oracle8_9_str; - - $return_val = $this->get_var("SELECT $seq_name.nextVal id FROM Dual"); - - // If no return value then try to create the sequence - if ( ! $return_val ) - { - $this->query("CREATE SEQUENCE $seq_name maxValue 9999999999 INCREMENT BY 1 START WITH 1 CACHE 20 CYCLE"); - $return_val = $this->get_var("SELECT $seq_name.nextVal id FROM Dual"); - $this->register_error($ezsql_oracle8_9_str[2].": $seq_name"); - $this->show_errors ? trigger_error($ezsql_oracle8_9_str[2].": $seq_name",E_USER_NOTICE) : null; - } - - return $return_val; - } - - /********************************************************************** - * Perform Oracle query and try to determine result value - */ - - function query($query) - { - - $return_value = 0; - - // Flush cached values.. - $this->flush(); - - // Log how the function was called - $this->func_call = "\$db->query(\"$query\")"; - - // Keep track of the last query for debug.. - $this->last_query = $query; - - $this->num_queries++; - - // Use core file cache function - if ( $cache = $this->get_cache($query) ) - { - return $cache; - } - - // If there is no existing database connection then try to connect - if ( ! isset($this->dbh) || ! $this->dbh ) - { - $this->connect($this->dbuser, $this->dbpassword, $this->dbname); - } - - // Parses the query and returns a statement.. - if ( ! $stmt = OCIParse($this->dbh, $query)) - { - $error = OCIError($this->dbh); - $this->register_error($error["message"]); - $this->show_errors ? trigger_error($error["message"],E_USER_WARNING) : null; - return false; - } - - // Execut the query.. - elseif ( ! $this->result = OCIExecute($stmt)) - { - $error = OCIError($stmt); - $this->register_error($error["message"]); - $this->show_errors ? trigger_error($error["message"],E_USER_WARNING) : null; - return false; - } - - // If query was an insert - $is_insert = false; - if ( preg_match('/^(insert|delete|update|create) /i', $query) ) - { - $is_insert = true; - - // num afected rows - $return_value = $this->rows_affected = @OCIRowCount($stmt); - } - // If query was a select - else - { - - // Get column information - if ( $num_cols = @OCINumCols($stmt) ) - { - // Fetch the column meta data - for ( $i = 1; $i <= $num_cols; $i++ ) - { - $this->col_info[($i-1)]->name = @OCIColumnName($stmt,$i); - $this->col_info[($i-1)]->type = @OCIColumnType($stmt,$i); - $this->col_info[($i-1)]->size = @OCIColumnSize($stmt,$i); - } - } - - // If there are any results then get them - if ($this->num_rows = @OCIFetchStatement($stmt,$results)) - { - // Convert results into object orientated results.. - // Due to Oracle strange return structure - loop through columns - foreach ( $results as $col_title => $col_contents ) - { - $row_num=0; - // then - loop through rows - foreach ( $col_contents as $col_content ) - { - $this->last_result[$row_num]->{$col_title} = $col_content; - $row_num++; - } - } - } - - // num result rows - $return_value = $this->num_rows; - } - - // disk caching of queries - $this->store_cache($query,$is_insert); - - // If debug ALL queries - $this->trace || $this->debug_all ? $this->debug() : null ; - - return $return_value; - - } - - } - -?> \ No newline at end of file +/** + * ezSQL Database specific class - Oracle 8 and 9 + * Desc..: Oracle 8i/9i component (part of ezSQL databse abstraction library) + * + * @author Justin Vincent (jv@jvmultimedia.com) + * @author Stefanie Janine Stoelting (mail@stefanie-stoelting.de) + * @link http://twitter.com/justinvincent + * @name ezSQL_oracle8_9 + * @package ezSQL + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + * + */ +class ezSQL_oracle8_9 extends ezSQLcore +{ + /** + * ezSQL error strings - Oracle 8 and 9 + * @var array + */ + private $ezsql_oracle8_9_str = array + ( + 1 => 'Require $dbuser, $dbpassword and $dbname to connect to a database server', + 2 => 'ezSQL auto created the following Oracle sequence' + ); + + /** + * Database user name + * @var string + */ + private $dbuser; + + /** + * Database password for the given user + * @var string + */ + private $dbpassword; + + /** + * Database name + * @var string + */ + private $dbname; + + /** + * Constructor - allow the user to perform a qucik connect at the same time + * as initialising the ezSQL_oracle8_9 class + * + * @param string $dbuser The database user name + * Default is empty string + * @param string $dbpassword The database users password + * Default is empty string + * @param string $dbname The name of the database + * Default is empty string + * @throws Exception Requires Orcle OCI Lib and ez_sql_core.php + */ + public function __construct($dbuser='', $dbpassword='', $dbname='') { + if ( ! function_exists ('OCILogon') ) { + throw new Exception('Fatal Error: ezSQL_oracle8_9 requires Oracle OCI Lib to be compiled and/or linked in to the PHP engine'); + } + if ( ! class_exists ('ezSQLcore') ) { + throw new Exception('Fatal Error: ezSQL_oracle8_9 requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); + } + + parent::__construct(); + + // Turn on track errors + ini_set('track_errors',1); + + $this->dbuser = $dbuser; + $this->dbpassword = $dbpassword; + $this->dbname = $dbname; + + } // __construct + + /** + * Try to connect to Oracle database server + * + * @param string $dbuser The database user name + * Default is empty string + * @param string $dbpassword The database users password + * Default is empty string + * @param string $dbname The name of the database + * Default is empty string + * @return boolean + */ + public function connect($dbuser='', $dbpassword='', $dbname='') { + $return_val = false; + + // Must have a user and a password + if ( ! $dbuser || ! $dbpassword || ! $dbname ) { + $this->register_error($this->ezsql_oracle8_9_str[1] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_oracle8_9_str[1], E_USER_WARNING) : null; + } + // Try to establish the server database handle + else if ( ! $this->dbh = OCILogon($dbuser, $dbpassword, $dbname) ) + { + $this->register_error($php_errormsg); + $this->show_errors ? trigger_error($php_errormsg,E_USER_WARNING) : null; + } + else + { + $this->dbuser = $dbuser; + $this->dbpassword = $dbpassword; + $this->dbname = $dbname; + $return_val = true; + } + + return $return_val; + } + + /** + * In the case of Oracle quick_connect is not really needed because std. + * connect already does what quick connect does - but for the sake of + * consistency it has been included + * + * @param string $dbuser The database user name + * Default is empty string + * @param string $dbpassword The database users password + * Default is empty string + * @param string $dbname The name of the database + * Default is empty string + * @return boolean + */ + public function quick_connect($dbuser='', $dbpassword='', $dbname='') { + return $this->connect($dbuser, $dbpassword, $dbname); + } // quick_connect + + /** + * No real equivalent of mySQL select in Oracle, once again, function + * included for the sake of consistency + * + * @param string $dbuser The database user name + * Default is empty string + * @param string $dbpassword The database users password + * Default is empty string + * @param string $dbname The name of the database + * Default is empty string + * @return boolean + */ + public function select($dbuser='', $dbpassword='', $dbname='') { + return $this->connect($dbuser, $dbpassword, $dbname); + } // select + + /** + * Format a Oracle string correctly for safe Oracle insert + * + * @param string $str + * @return string + */ + public function escape($str) { + $return_val = ''; + + if ( !isset($str) or empty($str) ) { + $return_val = ''; + } else if ( is_numeric($str) ) { + $return_val = $str; + } else { + $non_displayables = array( + '/%0[0-8bcef]/', // url encoded 00-08, 11, 12, 14, 15 + '/%1[0-9a-f]/', // url encoded 16-31 + '/[\x00-\x08]/', // 00-08 + '/\x0b/', // 11 + '/\x0c/', // 12 + '/[\x0e-\x1f]/' // 14-31 + ); + + foreach ( $non_displayables as $regex ) { + $str = preg_replace( $regex, '', $str ); + } + + $return_val = str_replace("'", "''", $str ); + } + + return $return_val; + } // escape + + /** + * Return Oracle specific system date syntax + * i.e. Oracle: SYSDATE Mysql: NOW() + * + * @return string + */ + public function sysdate() { + return 'SYSDATE'; + } // sysdate + + /********************************************************************** + * These special Oracle functions make sure that even if your test + * pattern is '' it will still match records that are null if + * you don't use these funcs then oracle will return no results + * if $user = ''; even if there were records that = '' + * + * SELECT * FROM USERS WHERE USER = ".$db->is_equal_str($user)." + */ + + /** + * Returns an escaped equal string + * + * @param string $str + * @return string + */ + public function is_equal_str($str='') { + return ($str=='' ? 'IS NULL' : "= '" . $this->escape($str) . "'"); + } // is_equal_str + + /** + * Returns an equal string for integer values + * + * @param string $int + * @return string + */ + public function is_equal_int($int) { + return ($int=='' ? 'IS NULL': '= ' . $int); + } // is_equal_int + + /** + * Another oracle specific function - if you have set up a sequence this + * function returns the next ID from that sequence + * If the sequence is not defined, the sequence is created by this method. + * Though be shure, that you use the correct sequence name not to end in + * more than one sequence for a primary key of a table. + * + * @param string $seq_name Name of the sequenze + * @return string + */ + public function insert_id($seq_name) { + $return_val = $this->get_var("SELECT $seq_name.nextVal id FROM Dual"); + + // If no return value then try to create the sequence + if ( ! $return_val ) { + $this->query("CREATE SEQUENCE $seq_name maxValue 9999999999 INCREMENT BY 1 START WITH 1 CACHE 20 CYCLE"); + $return_val = $this->get_var("SELECT $seq_name.nextVal id FROM Dual"); + $this->register_error($this->ezsql_oracle8_9_str[2] . ": $seq_name"); + $this->show_errors ? trigger_error($this->ezsql_oracle8_9_str[2] . ": $seq_name", E_USER_NOTICE) : null; + } + + return $return_val; + } // insert_id + + /** + * An alias for insert_id using the original Oracle function name. + * + * @param string $seq_name Name of the sequenze + * @return string + */ + public function nextVal($seq_name) { + return $this->insert_id($seq_name); + } // nextVal + + /** + * Perform Oracle query and try to determine result value + * + * @param string $query + * @return object + */ + public function query($query) { + $return_value = 0; + + // Flush cached values.. + $this->flush(); + + // Log how the function was called + $this->func_call = "\$db->query(\"$query\")"; + + // Keep track of the last query for debug.. + $this->last_query = $query; + + $this->num_queries++; + + // Use core file cache function + if ( $cache = $this->get_cache($query) ) { + return $cache; + } + + // If there is no existing database connection then try to connect + if ( ! isset($this->dbh) || ! $this->dbh ) { + $this->connect($this->dbuser, $this->dbpassword, $this->dbname); + } + + // Parses the query and returns a statement.. + if ( ! $stmt = OCIParse($this->dbh, $query)) { + $error = OCIError($this->dbh); + $this->register_error($error['message']); + $this->show_errors ? trigger_error($error['message'], E_USER_WARNING) : null; + return false; + } elseif ( ! $this->result = OCIExecute($stmt)) { + // Execut the query.. + $error = OCIError($stmt); + $this->register_error($error['message']); + $this->show_errors ? trigger_error($error['message'], E_USER_WARNING) : null; + return false; + } + + // If query was an insert + $is_insert = false; + if ( preg_match('/^(insert|delete|update|create) /i', $query) ) { + $is_insert = true; + + // num afected rows + $return_value = $this->rows_affected = @OCIRowCount($stmt); + } else { + // If query was a select + // Get column information + if ( $num_cols = @OCINumCols($stmt) ) { + // Fetch the column meta data + for ( $i = 1; $i <= $num_cols; $i++ ) { + $this->col_info[($i-1)]->name = @OCIColumnName($stmt, $i); + $this->col_info[($i-1)]->type = @OCIColumnType($stmt, $i); + $this->col_info[($i-1)]->size = @OCIColumnSize($stmt, $i); + } + } + + // If there are any results then get them + if ($this->num_rows = @OCIFetchStatement($stmt, $results)) { + // Convert results into object orientated results.. + // Due to Oracle strange return structure - loop through columns + foreach ( $results as $col_title => $col_contents ) { + $row_num=0; + // Then - loop through rows + foreach ( $col_contents as $col_content ) { + $this->last_result[$row_num]->{$col_title} = $col_content; + $row_num++; + } + } + } + + // Num result rows + $return_value = $this->num_rows; + } + + // Disk caching of queries + $this->store_cache($query, $is_insert); + + // If debug ALL queries + $this->trace || $this->debug_all ? $this->debug() : null; + + return $return_value; + } // query + +} // ezSQL_oracle8_9 \ No newline at end of file From ac66159a10642c7c387aa6c20d19b01f6ce6c174 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 23:01:11 +0200 Subject: [PATCH 043/126] Added disconnect and getDBName methods to Oracle 8 and 9 class --- oracle8_9/ez_sql_oracle8_9.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/oracle8_9/ez_sql_oracle8_9.php b/oracle8_9/ez_sql_oracle8_9.php index 985fd9fc..93fcd6d7 100755 --- a/oracle8_9/ez_sql_oracle8_9.php +++ b/oracle8_9/ez_sql_oracle8_9.php @@ -337,4 +337,22 @@ public function query($query) { return $return_value; } // query + /** + * Close the database connection + */ + public function disconnect() { + if ( $this->dbh ) { + $this->dbh = null; + } + } // disconnect + + /** + * Returns the current database name + * + * @return string + */ + public function getDBName() { + return $this->dbname; + } // getDBName + } // ezSQL_oracle8_9 \ No newline at end of file From a312ce3f048dda5a07ed16ebd39bc0103a1dd0a2 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 23:08:14 +0200 Subject: [PATCH 044/126] Removed trailing spaces in the Oracle 8 and 9 class --- oracle8_9/ez_sql_oracle8_9.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/oracle8_9/ez_sql_oracle8_9.php b/oracle8_9/ez_sql_oracle8_9.php index 93fcd6d7..efb721d6 100755 --- a/oracle8_9/ez_sql_oracle8_9.php +++ b/oracle8_9/ez_sql_oracle8_9.php @@ -2,14 +2,14 @@ /** * ezSQL Database specific class - Oracle 8 and 9 * Desc..: Oracle 8i/9i component (part of ezSQL databse abstraction library) - * + * * @author Justin Vincent (jv@jvmultimedia.com) * @author Stefanie Janine Stoelting (mail@stefanie-stoelting.de) * @link http://twitter.com/justinvincent * @name ezSQL_oracle8_9 * @package ezSQL * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) - * + * */ class ezSQL_oracle8_9 extends ezSQLcore { @@ -42,7 +42,7 @@ class ezSQL_oracle8_9 extends ezSQLcore private $dbname; /** - * Constructor - allow the user to perform a qucik connect at the same time + * Constructor - allow the user to perform a qucik connect at the same time * as initialising the ezSQL_oracle8_9 class * * @param string $dbuser The database user name @@ -60,7 +60,7 @@ public function __construct($dbuser='', $dbpassword='', $dbname='') { if ( ! class_exists ('ezSQLcore') ) { throw new Exception('Fatal Error: ezSQL_oracle8_9 requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); } - + parent::__construct(); // Turn on track errors @@ -81,7 +81,7 @@ public function __construct($dbuser='', $dbpassword='', $dbname='') { * Default is empty string * @param string $dbname The name of the database * Default is empty string - * @return boolean + * @return boolean */ public function connect($dbuser='', $dbpassword='', $dbname='') { $return_val = false; @@ -109,8 +109,8 @@ public function connect($dbuser='', $dbpassword='', $dbname='') { } /** - * In the case of Oracle quick_connect is not really needed because std. - * connect already does what quick connect does - but for the sake of + * In the case of Oracle quick_connect is not really needed because std. + * connect already does what quick connect does - but for the sake of * consistency it has been included * * @param string $dbuser The database user name @@ -126,7 +126,7 @@ public function quick_connect($dbuser='', $dbpassword='', $dbname='') { } // quick_connect /** - * No real equivalent of mySQL select in Oracle, once again, function + * No real equivalent of mySQL select in Oracle, once again, function * included for the sake of consistency * * @param string $dbuser The database user name @@ -178,7 +178,7 @@ public function escape($str) { * Return Oracle specific system date syntax * i.e. Oracle: SYSDATE Mysql: NOW() * - * @return string + * @return string */ public function sysdate() { return 'SYSDATE'; @@ -195,7 +195,7 @@ public function sysdate() { /** * Returns an escaped equal string - * + * * @param string $str * @return string */ @@ -205,7 +205,7 @@ public function is_equal_str($str='') { /** * Returns an equal string for integer values - * + * * @param string $int * @return string */ @@ -214,11 +214,11 @@ public function is_equal_int($int) { } // is_equal_int /** - * Another oracle specific function - if you have set up a sequence this + * Another oracle specific function - if you have set up a sequence this * function returns the next ID from that sequence * If the sequence is not defined, the sequence is created by this method. * Though be shure, that you use the correct sequence name not to end in - * more than one sequence for a primary key of a table. + * more than one sequence for a primary key of a table. * * @param string $seq_name Name of the sequenze * @return string @@ -236,7 +236,7 @@ public function insert_id($seq_name) { return $return_val; } // insert_id - + /** * An alias for insert_id using the original Oracle function name. * @@ -338,7 +338,7 @@ public function query($query) { } // query /** - * Close the database connection + * Close the database connection */ public function disconnect() { if ( $this->dbh ) { From 2005e38df7d183e0201e5c2053a4adbb7ffd9c9b Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 23:21:06 +0200 Subject: [PATCH 045/126] - Changed the core class to PHP 5 syntax. - Cleared parameter formats from mixed commaspace / comma to comma space. - Added PHPDoc documentation tags and extended the documentation - Changed formatting to fit standards - Methods with public --- codeigniter/Ezsql_codeigniter.php | 316 +++++++++++++++--------------- 1 file changed, 157 insertions(+), 159 deletions(-) diff --git a/codeigniter/Ezsql_codeigniter.php b/codeigniter/Ezsql_codeigniter.php index bc2863bb..1df0704d 100755 --- a/codeigniter/Ezsql_codeigniter.php +++ b/codeigniter/Ezsql_codeigniter.php @@ -1,161 +1,159 @@ -Fatal Error: ezSQL requires ezSQLcore (application/helpers/ez_sql_core_helper.php) to be included/loaded before it can be used'); - - class ezSQL_codeigniter extends ezSQLcore - { - - var $debug = true; - - function __construct() - { - global $db; - $db = $this; - $this->CI =& get_instance(); - } - - function query($query) - { - // Initialise return - $return_val = 0; - - // Flush cached values.. - $this->flush(); - - // For reg expressions - $query = trim($query); - - // Log how the function was called - $this->func_call = "\$db->query(\"$query\")"; - - // Keep track of the last query for debug.. - $this->last_query = $query; - - // Count how many queries there have been - $this->num_queries++; - - // Start timer - $this->timer_start($this->num_queries); - - // Use core file cache function - if ( $cache = $this->get_cache($query) ) - { - - // Keep tack of how long all queries have taken - $this->timer_update_global($this->num_queries); - - // Trace all queries - if ( $this->use_trace_log ) - { - $this->trace_log[] = $this->debug(false); - } - - return $cache; - } - - // Perform the query via CI database system - $ci_query = $this->CI->db->query($query); - - // If there is an error then take note of it.. - if ( $str = $this->CI->db->_error_message() ) - { - $this->register_error($str); - $this->show_errors ? trigger_error($str,E_USER_WARNING) : null; - - // If debug ALL queries - $this->trace || $this->debug_all ? $this->debug() : null ; - - return false; - } - - // Query was write (insert/delete/update etc.) query? - $is_insert = false; - - if ( preg_match("/^(insert|delete|update|replace|truncate|drop|create|alter)\s+/i",$query) ) - { - $this->rows_affected = $this->CI->db->affected_rows(); - - // Take note of the insert_id - if ( preg_match("/^(insert|replace)\s+/i",$query) ) - { - $this->insert_id = $this->CI->db->insert_id(); - } - - // Return number fo rows affected - $return_val = $this->rows_affected; - } - // Query was a select - else - { - - // Store Query Results - $num_rows=0; - if ( $ci_query->num_rows() ) - { - foreach ($ci_query->result() as $row) - { - // Take note of column info - if ( $num_rows == 0 ) - { - $i=0; - foreach ( get_object_vars($row) as $k => $v ) - { - $this->col_info[$i]->name = $k; - $this->col_info[$i]->max_length = $k; - $this->col_info[$i]->type = ''; - $i++; - } - } - - // Store relults as an objects within main array - $this->last_result[$num_rows] = $row; - $num_rows++; - } - } - - // Log number of rows the query returned - $return_val = $this->num_rows = $num_rows; - - } - - // disk caching of queries - $this->store_cache($query,$is_insert); - - // If debug ALL queries - $this->trace || $this->debug_all ? $this->debug() : null ; - - // Keep tack of how long all queries have taken - $this->timer_update_global($this->num_queries); - - // Trace all queries - if ( $this->use_trace_log ) - { - $this->trace_log[] = $this->debug(false); - } - - return $return_val; - - } - - /********************************************************************** - * Format a sql string correctly for safe insert - */ - - function escape($str, $like = FALSE) - { - return $this->CI->db->escape_str(stripslashes($str), $like = FALSE); - } - - } +class ezSQL_codeigniter extends ezSQLcore +{ + + public $debug = true; + + /** + * + * @global object $db Self + * @throws Exception Requires ez_sql_core.php + */ + function __construct() { + if ( ! class_exists ('ezSQLcore') ) { + throw new Exception('Fatal Error: ezSQL requires ezSQLcore (application/helpers/ez_sql_core_helper.php) to be included/loaded before it can be used'); + } + + global $db; + $db = $this; + $this->CI =& get_instance(); + } // __construct + + /** + * Perform codignitor query and try to determine result value + * + * @param string $query + * @return boolean|int + */ + public function query($query) { + // Initialise return + $return_val = 0; + + // Flush cached values.. + $this->flush(); + + // For reg expressions + $query = trim($query); + + // Log how the function was called + $this->func_call = "\$db->query(\"$query\")"; + + // Keep track of the last query for debug.. + $this->last_query = $query; + + // Count how many queries there have been + $this->num_queries++; + + // Start timer + $this->timer_start($this->num_queries); + + // Use core file cache function + if ( $cache = $this->get_cache($query) ) { + // Keep tack of how long all queries have taken + $this->timer_update_global($this->num_queries); + + // Trace all queries + if ( $this->use_trace_log ) { + $this->trace_log[] = $this->debug(false); + } + + return $cache; + } + + // Perform the query via CI database system + $ci_query = $this->CI->db->query($query); + + // If there is an error then take note of it.. + if ( $str = $this->CI->db->_error_message() ) { + $this->register_error($str); + $this->show_errors ? trigger_error($str, E_USER_WARNING) : null; + + // If debug ALL queries + $this->trace || $this->debug_all ? $this->debug() : null ; + + return false; + } + + // Query was write (insert/delete/update etc.) query? + $is_insert = false; + + if ( preg_match("/^(insert|delete|update|replace|truncate|drop|create|alter)\s+/i", $query) ) { + $this->rows_affected = $this->CI->db->affected_rows(); + + // Take note of the insert_id + if ( preg_match("/^(insert|replace)\s+/i", $query) ) + { + $this->insert_id = $this->CI->db->insert_id(); + } + + // Return number fo rows affected + $return_val = $this->rows_affected; + } else { + // Query was a select + // Store Query Results + $num_rows=0; + if ( $ci_query->num_rows() ) { + foreach ($ci_query->result() as $row) { + // Take note of column info + if ( $num_rows == 0 ) { + $i = 0; + foreach ( get_object_vars($row) as $k => $v ) { + $this->col_info[$i]->name = $k; + $this->col_info[$i]->max_length = $k; + $this->col_info[$i]->type = ''; + $i++; + } + } + + // Store relults as an objects within main array + $this->last_result[$num_rows] = $row; + $num_rows++; + } + } + + // Log number of rows the query returned + $return_val = $this->num_rows = $num_rows; + + } + + // disk caching of queries + $this->store_cache($query, $is_insert); + + // If debug ALL queries + $this->trace || $this->debug_all ? $this->debug() : null ; + + // Keep tack of how long all queries have taken + $this->timer_update_global($this->num_queries); + + // Trace all queries + if ( $this->use_trace_log ) { + $this->trace_log[] = $this->debug(false); + } + + return $return_val; + } // query + + /** + * Format a sql string correctly for safe insert + * + * @param string $str + * @param boolean $like + * @return string + */ + public function escape($str, $like=false) { + return $this->CI->db->escape_str(stripslashes($str), $like = false); + } // escape + +} // ezSQL_codeigniter \ No newline at end of file From 208b1ba298d6883169aed568084bb4e54bcada0b Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 23:22:07 +0200 Subject: [PATCH 046/126] Deleted Date: Sun, 1 Apr 2012 23:32:31 +0200 Subject: [PATCH 047/126] Restored the check of BASEPATH --- codeigniter/Ezsql_codeigniter.php | 1 + 1 file changed, 1 insertion(+) diff --git a/codeigniter/Ezsql_codeigniter.php b/codeigniter/Ezsql_codeigniter.php index 17bb684e..a5400a8c 100755 --- a/codeigniter/Ezsql_codeigniter.php +++ b/codeigniter/Ezsql_codeigniter.php @@ -1,4 +1,5 @@ Date: Sun, 1 Apr 2012 23:34:00 +0200 Subject: [PATCH 048/126] Added PHPDoc ignore tags --- shared/ez_sql_core_2.1_debughack_0.2alpha.php | 3 +++ shared/ez_sql_core_202console.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/shared/ez_sql_core_2.1_debughack_0.2alpha.php b/shared/ez_sql_core_2.1_debughack_0.2alpha.php index 440c11de..9d75c9ca 100755 --- a/shared/ez_sql_core_2.1_debughack_0.2alpha.php +++ b/shared/ez_sql_core_2.1_debughack_0.2alpha.php @@ -1,4 +1,7 @@ vardump and $db->debug functions diff --git a/shared/ez_sql_core_202console.php b/shared/ez_sql_core_202console.php index c226c269..7daa22ec 100755 --- a/shared/ez_sql_core_202console.php +++ b/shared/ez_sql_core_202console.php @@ -1,4 +1,7 @@ vardump and $db->debug functions From 963177121d35915e1999eedd5a9b21600d4758ca Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 23:52:49 +0200 Subject: [PATCH 049/126] Removed a PHPDoc tag --- codeigniter/Ezsql_codeigniter.php | 1 - 1 file changed, 1 deletion(-) diff --git a/codeigniter/Ezsql_codeigniter.php b/codeigniter/Ezsql_codeigniter.php index a5400a8c..643bb5f4 100755 --- a/codeigniter/Ezsql_codeigniter.php +++ b/codeigniter/Ezsql_codeigniter.php @@ -19,7 +19,6 @@ class ezSQL_codeigniter extends ezSQLcore /** * - * @global object $db Self * @throws Exception Requires ez_sql_core.php */ function __construct() { From b8a3879b0be923d5f1e1fea3a0e191d6de79a4e1 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Sun, 1 Apr 2012 23:57:01 +0200 Subject: [PATCH 050/126] Added PHPDocumentation --- _Documentation/phpDocumentator/blank.html | 13 + .../phpDocumentator/classtrees_default.html | 28 + .../phpDocumentator/classtrees_ezSQL.html | 26 + .../_mysql---disk_cache_example.php.html | 60 + .../_oracle8_9---disk_cache_example.php.html | 60 + ...z_sql_core_2.1_debughack_0.2alpha.php.html | 60 + .../_shared---ez_sql_core_202console.php.html | 60 + .../phpDocumentator/default/ezSQLcore.html | 1105 +++++++++++ .../phpDocumentator/elementindex.html | 1479 +++++++++++++++ .../phpDocumentator/elementindex_default.html | 438 +++++ .../phpDocumentator/elementindex_ezSQL.html | 1206 ++++++++++++ _Documentation/phpDocumentator/errors.html | 49 + .../_codeigniter---Ezsql_codeigniter.php.html | 68 + .../ezSQL/_mssql---ez_sql_mssql.php.html | 68 + .../ezSQL/_mysql---ez_sql_mysql.php.html | 68 + .../_oracle8_9---ez_sql_oracle8_9.php.html | 68 + .../ezSQL/_pdo---ez_sql_pdo.php.html | 68 + .../_postgresql---ez_sql_postgresql.php.html | 68 + .../ezSQL/_shared---ez_sql_core.php.html | 68 + .../ezSQL/_sqlite---ez_sql_sqlite.php.html | 68 + .../ezSQL/_sybase---ez_sql_sybase.php.html | 68 + .../ezSQL/ezSQL_codeigniter.html | 393 ++++ .../phpDocumentator/ezSQL/ezSQL_mssql.html | 607 ++++++ .../phpDocumentator/ezSQL/ezSQL_mysql.html | 602 ++++++ .../ezSQL/ezSQL_oracle8_9.html | 706 +++++++ .../phpDocumentator/ezSQL/ezSQL_pdo.html | 567 ++++++ .../ezSQL/ezSQL_postgresql.html | 710 +++++++ .../phpDocumentator/ezSQL/ezSQL_sqlite.html | 527 +++++ .../phpDocumentator/ezSQL/ezSQL_sybase.html | 606 ++++++ .../phpDocumentator/ezSQL/ezSQLcore.html | 1688 +++++++++++++++++ _Documentation/phpDocumentator/index.html | 24 + .../phpDocumentator/li_default.html | 37 + _Documentation/phpDocumentator/li_ezSQL.html | 50 + .../phpDocumentator/media/banner.css | 32 + .../phpDocumentator/media/stylesheet.css | 144 ++ _Documentation/phpDocumentator/packages.html | 32 + 36 files changed, 11921 insertions(+) create mode 100644 _Documentation/phpDocumentator/blank.html create mode 100644 _Documentation/phpDocumentator/classtrees_default.html create mode 100644 _Documentation/phpDocumentator/classtrees_ezSQL.html create mode 100644 _Documentation/phpDocumentator/default/_mysql---disk_cache_example.php.html create mode 100644 _Documentation/phpDocumentator/default/_oracle8_9---disk_cache_example.php.html create mode 100644 _Documentation/phpDocumentator/default/_shared---ez_sql_core_2.1_debughack_0.2alpha.php.html create mode 100644 _Documentation/phpDocumentator/default/_shared---ez_sql_core_202console.php.html create mode 100644 _Documentation/phpDocumentator/default/ezSQLcore.html create mode 100644 _Documentation/phpDocumentator/elementindex.html create mode 100644 _Documentation/phpDocumentator/elementindex_default.html create mode 100644 _Documentation/phpDocumentator/elementindex_ezSQL.html create mode 100644 _Documentation/phpDocumentator/errors.html create mode 100644 _Documentation/phpDocumentator/ezSQL/_codeigniter---Ezsql_codeigniter.php.html create mode 100644 _Documentation/phpDocumentator/ezSQL/_mssql---ez_sql_mssql.php.html create mode 100644 _Documentation/phpDocumentator/ezSQL/_mysql---ez_sql_mysql.php.html create mode 100644 _Documentation/phpDocumentator/ezSQL/_oracle8_9---ez_sql_oracle8_9.php.html create mode 100644 _Documentation/phpDocumentator/ezSQL/_pdo---ez_sql_pdo.php.html create mode 100644 _Documentation/phpDocumentator/ezSQL/_postgresql---ez_sql_postgresql.php.html create mode 100644 _Documentation/phpDocumentator/ezSQL/_shared---ez_sql_core.php.html create mode 100644 _Documentation/phpDocumentator/ezSQL/_sqlite---ez_sql_sqlite.php.html create mode 100644 _Documentation/phpDocumentator/ezSQL/_sybase---ez_sql_sybase.php.html create mode 100644 _Documentation/phpDocumentator/ezSQL/ezSQL_codeigniter.html create mode 100644 _Documentation/phpDocumentator/ezSQL/ezSQL_mssql.html create mode 100644 _Documentation/phpDocumentator/ezSQL/ezSQL_mysql.html create mode 100644 _Documentation/phpDocumentator/ezSQL/ezSQL_oracle8_9.html create mode 100644 _Documentation/phpDocumentator/ezSQL/ezSQL_pdo.html create mode 100644 _Documentation/phpDocumentator/ezSQL/ezSQL_postgresql.html create mode 100644 _Documentation/phpDocumentator/ezSQL/ezSQL_sqlite.html create mode 100644 _Documentation/phpDocumentator/ezSQL/ezSQL_sybase.html create mode 100644 _Documentation/phpDocumentator/ezSQL/ezSQLcore.html create mode 100644 _Documentation/phpDocumentator/index.html create mode 100644 _Documentation/phpDocumentator/li_default.html create mode 100644 _Documentation/phpDocumentator/li_ezSQL.html create mode 100644 _Documentation/phpDocumentator/media/banner.css create mode 100644 _Documentation/phpDocumentator/media/stylesheet.css create mode 100644 _Documentation/phpDocumentator/packages.html diff --git a/_Documentation/phpDocumentator/blank.html b/_Documentation/phpDocumentator/blank.html new file mode 100644 index 00000000..185f86cb --- /dev/null +++ b/_Documentation/phpDocumentator/blank.html @@ -0,0 +1,13 @@ + + + Generated Documentation + + + + +

Generated Documentation

+Welcome to default!
+
+This documentation was generated by phpDocumentor v1.4.4
+ + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/classtrees_default.html b/_Documentation/phpDocumentator/classtrees_default.html new file mode 100644 index 00000000..019a0761 --- /dev/null +++ b/_Documentation/phpDocumentator/classtrees_default.html @@ -0,0 +1,28 @@ + + + + + + + + + + + + +

+ +

+

Root class ezSQLcore

+ + +

Root class ezSQLcore

+ + +

+ Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 +

+ + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/classtrees_ezSQL.html b/_Documentation/phpDocumentator/classtrees_ezSQL.html new file mode 100644 index 00000000..445398c5 --- /dev/null +++ b/_Documentation/phpDocumentator/classtrees_ezSQL.html @@ -0,0 +1,26 @@ + + + + + + + + + + + + +

+ +

+

Root class ezSQLcore

+ + +

+ Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 +

+ + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/_mysql---disk_cache_example.php.html b/_Documentation/phpDocumentator/default/_mysql---disk_cache_example.php.html new file mode 100644 index 00000000..d0908ae0 --- /dev/null +++ b/_Documentation/phpDocumentator/default/_mysql---disk_cache_example.php.html @@ -0,0 +1,60 @@ + + + + + + Docs for page disk_cache_example.php + + + + +
+

/mysql/disk_cache_example.php

+ + +
+
Description
+ +
+ + +
+
+ + + +
+
Includes
+ +
+ +
+ +
+ + include_once + ("ez_sql_mysql.php") + (line 8) + +
+ + + +
+
+
+ + + + +

+ Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/_oracle8_9---disk_cache_example.php.html b/_Documentation/phpDocumentator/default/_oracle8_9---disk_cache_example.php.html new file mode 100644 index 00000000..d37a3758 --- /dev/null +++ b/_Documentation/phpDocumentator/default/_oracle8_9---disk_cache_example.php.html @@ -0,0 +1,60 @@ + + + + + + Docs for page disk_cache_example.php + + + + +
+

/oracle8_9/disk_cache_example.php

+ + +
+
Description
+ +
+ + +
+
+ + + +
+
Includes
+ +
+ +
+ +
+ + include_once + ("ez_sql_oracle8_9.php") + (line 10) + +
+ + + +
+
+
+ + + + +

+ Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/_shared---ez_sql_core_2.1_debughack_0.2alpha.php.html b/_Documentation/phpDocumentator/default/_shared---ez_sql_core_2.1_debughack_0.2alpha.php.html new file mode 100644 index 00000000..11ef541b --- /dev/null +++ b/_Documentation/phpDocumentator/default/_shared---ez_sql_core_2.1_debughack_0.2alpha.php.html @@ -0,0 +1,60 @@ + + + + + + Docs for page ez_sql_core_2.1_debughack_0.2alpha.php + + + + +
+

/shared/ez_sql_core_2.1_debughack_0.2alpha.php

+ + +
+
Description
+ +
+ + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ + + ******************************************************************** +
+
+
+ + + + + +

+ Documentation generated on Sun, 01 Apr 2012 23:51:55 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/_shared---ez_sql_core_202console.php.html b/_Documentation/phpDocumentator/default/_shared---ez_sql_core_202console.php.html new file mode 100644 index 00000000..1e234fb6 --- /dev/null +++ b/_Documentation/phpDocumentator/default/_shared---ez_sql_core_202console.php.html @@ -0,0 +1,60 @@ + + + + + + Docs for page ez_sql_core_202console.php + + + + +
+

/shared/ez_sql_core_202console.php

+ + +
+
Description
+ +
+ + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQLcore + + ******************************************************************** +
+
+
+ + + + + +

+ Documentation generated on Sun, 01 Apr 2012 23:51:55 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/ezSQLcore.html b/_Documentation/phpDocumentator/default/ezSQLcore.html new file mode 100644 index 00000000..03451286 --- /dev/null +++ b/_Documentation/phpDocumentator/default/ezSQLcore.html @@ -0,0 +1,1105 @@ + + + + + + Docs For Class ezSQLcore + + + + +
+

Class ezSQLcore

+ + +
+
Description
+ +
+ +

********************************************************************

+

Core class containg common functions to manipulate query result sets once returned

+

+ Located in /shared/ez_sql_core_202console.php (line 45) +

+ + +

+	
+			
+
+ + + + +
+
Variable Summary
+ +
+
+
+ mixed + $cache_dir +
+
+ mixed + $cache_inserts +
+
+ mixed + $cache_queries +
+
+ mixed + $cache_timeout +
+
+ mixed + $captured_errors +
+
+ mixed + $col_info +
+
+ mixed + $debug_all +
+
+ mixed + $debug_called +
+
+ mixed + $debug_echo +
+
+ mixed + $last_error +
+
+ mixed + $last_query +
+
+ mixed + $num_queries +
+
+ mixed + $show_errors +
+
+ mixed + $trace +
+
+ mixed + $use_disk_cache +
+
+ mixed + $vardump_called +
+
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ ezSQLcore + ezSQLcore + () +
+
+ void + connect + () +
+
+ void + debug + ( $debug_echo) +
+
+ void + donation + () +
+
+ void + dumpvar + ( $mixed) +
+
+ void + escape + () +
+
+ void + flush + () +
+
+ void + get_cache + ( $query) +
+
+ void + get_col + ([ $query = null], [ $x = 0]) +
+
+ void + get_col_info + ([ $info_type = "name"], [ $col_offset = -1]) +
+
+ void + get_results + ([ $query = null], [ $output = OBJECT]) +
+
+ void + get_row + ([ $query = null], [ $output = OBJECT], [ $y = 0]) +
+
+ void + get_var + ([ $query = null], [ $x = 0], [ $y = 0]) +
+
+ void + hide_errors + () +
+
+ void + query + () +
+
+ void + register_error + ( $err_str) +
+
+ void + select + () +
+
+ void + show_errors + () +
+
+ void + store_cache + ( $query,  $is_insert) +
+
+ void + sysdate + () +
+
+ void + vardump + ([ $mixed = '']) +
+
+
+
+ + +
+
Variables
+ +
+ +
+ +
+ + mixed + $cache_dir + = false (line 60) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $cache_inserts + = false (line 62) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $cache_queries + = false (line 61) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $cache_timeout + = 24 (line 64) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $captured_errors + = array() (line 59) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $col_info + = null (line 58) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $debug_all + = false (line 49) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $debug_called + = false (line 52) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $debug_echo + = true (line 51) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $last_error + = null (line 57) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $last_query + = null (line 56) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $num_queries + = 0 (line 55) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $show_errors + = true (line 54) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $trace + = false (line 48) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $use_disk_cache + = false (line 63) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $vardump_called + = false (line 53) + +
+ + + + + + + +
+ +
+
+ + +
+
Methods
+ +
+ + + +
+ +
+ Constructor ezSQLcore (line 70) +
+ + +

********************************************************************

+

Constructor

+ +
+ ezSQLcore + + ezSQLcore + + () +
+ + + +
+ +
+ +
+ connect (line 78) +
+ + +

********************************************************************

+

Connect to DB - over-ridden by specific DB class

+ +
+ void + + connect + + () +
+ + + +
+ +
+ +
+ debug (line 460) +
+ + +

******************************************************************** Displays the last query string that was sent to the database & a table listing results (if there were any).

+

(abstracted into a seperate file to save server overhead).

+ +
+ void + + debug + + ( $debug_echo) +
+ +
    +
  • + + $debug_echo
  • +
+ + +
+ +
+ +
+ donation (line 556) +
+ + +

********************************************************************

+

Naughty little function to ask for some remuniration!

+ +
+ void + + donation + + () +
+ + + +
+ +
+ +
+ dumpvar (line 444) +
+ + +

********************************************************************

+

Alias for the above function

+ +
+ void + + dumpvar + + ( $mixed) +
+ +
    +
  • + + $mixed
  • +
+ + +
+ +
+ +
+ escape (line 106) +
+ + +

********************************************************************

+

Format a string correctly for safe insert - over-ridden by specific DB class

+ +
+ void + + escape + + () +
+ + + +
+ +
+ +
+ flush (line 156) +
+ + +

********************************************************************

+

Kill cached query results

+ +
+ void + + flush + + () +
+ + + +
+ +
+ +
+ get_cache (line 370) +
+ + +

********************************************************************

+

get_cache

+ +
+ void + + get_cache + + ( $query) +
+ +
    +
  • + + $query
  • +
+ + +
+ +
+ +
+ get_col (line 235) +
+ + +

********************************************************************

+

Function to get 1 column from the cached result set based in X index see docs for usage and info

+ +
+ void + + get_col + + ([ $query = null], [ $x = 0]) +
+ +
    +
  • + + $query
  • +
  • + + $x
  • +
+ + +
+ +
+ +
+ get_col_info (line 308) +
+ + +

********************************************************************

+

Function to get column meta data info pertaining to the last query see docs for more info and usage

+ +
+ void + + get_col_info + + ([ $info_type = "name"], [ $col_offset = -1]) +
+ +
    +
  • + + $info_type
  • +
  • + + $col_offset
  • +
+ + +
+ +
+ +
+ get_results (line 258) +
+ + +

********************************************************************

+

Return the the query as a result set - see docs for more details

+ +
+ void + + get_results + + ([ $query = null], [ $output = OBJECT]) +
+ +
    +
  • + + $query
  • +
  • + + $output
  • +
+ + +
+ +
+ +
+ get_row (line 195) +
+ + +

********************************************************************

+

Get one row from the DB - see docs for more detail

+ +
+ void + + get_row + + ([ $query = null], [ $output = OBJECT], [ $y = 0]) +
+ +
    +
  • + + $query
  • +
  • + + $output
  • +
  • + + $y
  • +
+ + +
+ +
+ +
+ get_var (line 169) +
+ + +

********************************************************************

+

Get one variable from the DB - see docs for more detail

+ +
+ void + + get_var + + ([ $query = null], [ $x = 0], [ $y = 0]) +
+ +
    +
  • + + $query
  • +
  • + + $x
  • +
  • + + $y
  • +
+ + +
+ +
+ +
+ hide_errors (line 147) +
+ + + +
+ void + + hide_errors + + () +
+ + + +
+ +
+ +
+ query (line 96) +
+ + +

********************************************************************

+

Basic Query - over-ridden by specific DB class

+ +
+ void + + query + + () +
+ + + +
+ +
+ +
+ register_error (line 125) +
+ + +

********************************************************************

+

Print SQL/DB error - over-ridden by specific DB class

+ +
+ void + + register_error + + ( $err_str) +
+ +
    +
  • + + $err_str
  • +
+ + +
+ +
+ +
+ select (line 87) +
+ + +

********************************************************************

+

Select DB - over-ridden by specific DB class

+ +
+ void + + select + + () +
+ + + +
+ +
+ +
+ show_errors (line 142) +
+ + +

******************************************************************** Turn error handling on or off..

+ +
+ void + + show_errors + + () +
+ + + +
+ +
+ +
+ store_cache (line 336) +
+ + +

********************************************************************

+

store_cache

+ +
+ void + + store_cache + + ( $query,  $is_insert) +
+ +
    +
  • + + $query
  • +
  • + + $is_insert
  • +
+ + +
+ +
+ +
+ sysdate (line 116) +
+ + +

********************************************************************

+

Return database specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()

+ +
+ void + + sysdate + + () +
+ + + +
+ +
+ +
+ vardump (line 413) +
+ + +

********************************************************************

+

Dumps the contents of any input variable to screen in a nicely formatted and easy to understand way - any type: Object, Var or Array

+ +
+ void + + vardump + + ([ $mixed = '']) +
+ +
    +
  • + + $mixed
  • +
+ + +
+ +
+
+ + +

+ Documentation generated on Sun, 01 Apr 2012 23:51:55 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/elementindex.html b/_Documentation/phpDocumentator/elementindex.html new file mode 100644 index 00000000..3d7ea822 --- /dev/null +++ b/_Documentation/phpDocumentator/elementindex.html @@ -0,0 +1,1479 @@ + + + + + + + + + + + +

Full index

+

Package indexes

+ +
+
+ a + c + d + e + f + g + h + i + l + n + o + p + q + r + s + t + u + v + _ +
+ + +
+
a
+ +
+
+
+
+ ARRAY_A +
+
+ +
Constant boolean
+
+
+ ARRAY_N +
+
+ +
Constant boolean
+
+
+ +
+
c
+ +
+
+
+
+ $cache_dir +
+
+ +
Using the cache directory
+
+
+ $cache_dir +
+
+
ezSQLcore::$cache_dir in ez_sql_core_202console.php
+
+
+ $cache_inserts +
+
+ +
Insert queries into the cache
+
+
+ $cache_inserts +
+
+
ezSQLcore::$cache_inserts in ez_sql_core_202console.php
+
+
+ $cache_queries +
+
+ +
Caching queries
+
+
+ $cache_queries +
+
+
ezSQLcore::$cache_queries in ez_sql_core_202console.php
+
+
+ $cache_timeout +
+
+
ezSQLcore::$cache_timeout in ez_sql_core_202console.php
+
+
+ $cache_timeout +
+
+ +
The cache timeout in hours
+
+
+ $captured_errors +
+
+ +
Captured errors
+
+
+ $captured_errors +
+
+
ezSQLcore::$captured_errors in ez_sql_core_202console.php
+
+
+ $col_info +
+
+
ezSQLcore::$col_info in ez_sql_core_202console.php
+
+
+ $col_info +
+
+ +
The last column info
+
+
+ catch_error +
+
+ +
Hooks into PDO error system and reports it to user
+
+
+ connect +
+
+
ezSQLcore::connect() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ connect +
+
+ +
Try to connect to the database server in the DSN parameters
+
+
+ connect +
+
+
ezSQL_mysql::connect() in ezSQL_mysql
+
Try to connect to mySQL database server
+
+
+ connect +
+
+
ezSQL_mssql::connect() in ezSQL_mssql
+
Try to connect to mssql database server
+
+
+ connect +
+
+
ezSQL_oracle8_9::connect() in ezSQL_oracle8_9
+
Try to connect to Oracle database server
+
+
+ connect +
+
+
ezSQL_postgresql::connect() in ezSQL_postgresql
+
Try to connect to PostgreSQL database server
+
+
+ connect +
+
+
ezSQL_sybase::connect() in ezSQL_sybase
+
Try to connect to sybase database server
+
+
+ connect +
+
+
ezSQL_sqlite::connect() in ezSQL_sqlite
+
Try to connect to SQLite database server
+
+
+ ConvertMySqlToMSSql +
+
+ +
Convert a Query From MySql Syntax to MS-Sql syntax Following conversions are made:
  1. The '`' character used for MySql queries is not supported - + the character is removed.
+
+
+ ConvertMySqlTosybase +
+
+ +
Convert a Query From MySql Syntax to Sybase syntax Following conversions are made:
  1. The '`' character used for MySql queries is not supported - the + character is removed.
+
+
+ +
+
d
+ +
+
+
+
+ $db_connect_time +
+
+ +
The time it took to establish a connection
+
+
+ $debug +
+
+
ezSQL_codeigniter::$debug in ezSQL_codeigniter
+
+
+ $debug_all +
+
+ +
same as $trace
+
+
+ $debug_all +
+
+
ezSQLcore::$debug_all in ez_sql_core_202console.php
+
+
+ $debug_called +
+
+ +
Debug is called
+
+
+ $debug_called +
+
+
ezSQLcore::$debug_called in ez_sql_core_202console.php
+
+
+ $debug_echo +
+
+
ezSQLcore::$debug_echo in ez_sql_core_202console.php
+
+
+ $debug_echo_is_on +
+
+ +
== TJH == default now needed for echo of debug function
+
+
+ $do_profile +
+
+ +
Using profiling
+
+
+ debug +
+
+ +
Displays the last query string that was sent to the database & a table listing results (if there were any).
+
+
+ debug +
+
+
ezSQLcore::debug() in ez_sql_core_202console.php
+
******************************************************************** Displays the last query string that was sent to the database & a table listing results (if there were any).
+
+
+ descTable +
+
+
ezSQL_postgresql::descTable() in ezSQL_postgresql
+
Return the description of the given table
+
+
+ disconnect +
+
+
ezSQL_postgresql::disconnect() in ezSQL_postgresql
+
Close the database connection
+
+
+ disconnect +
+
+ +
Close the database connection
+
+
+ disconnect +
+
+ +
Close the database connection
+
+
+ disconnect +
+
+ +
Close the database connection
+
+
+ disconnect +
+
+ +
Close the database connection
+
+
+ disconnect +
+
+ +
Close the database connection
+
+
+ disconnect +
+
+ +
Close the database connection
+
+
+ donation +
+
+
ezSQLcore::donation() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ donation +
+
+ +
Naughty little function to ask for some remuniration!
+
+
+ dumpvar +
+
+
ezSQLcore::dumpvar() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ dumpvar +
+
+ +
An alias for vardump method
+
+
+ disk_cache_example.php +
+
+
disk_cache_example.php in disk_cache_example.php
+
+
+ disk_cache_example.php +
+
+
disk_cache_example.php in disk_cache_example.php
+
+
+ +
+
e
+ +
+
+
+
+ ezSQL_codeigniter +
+
+
ezSQL_codeigniter in ezSQL_codeigniter
+
+
+ escape +
+
+
ezSQL_oracle8_9::escape() in ezSQL_oracle8_9
+
Format a Oracle string correctly for safe Oracle insert
+
+
+ escape +
+
+
ezSQL_sybase::escape() in ezSQL_sybase
+
Format a sybase string correctly for safe sybase insert
+
+
+ escape +
+
+
ezSQLcore::escape() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ escape +
+
+
ezSQL_pdo::escape() in ezSQL_pdo
+
Escape a string with the PDO method
+
+
+ escape +
+
+
ezSQL_postgresql::escape() in ezSQL_postgresql
+
Format a mySQL string correctly for safe mySQL insert (no matter if magic quotes are on or not)
+
+
+ escape +
+
+
ezSQL_mssql::escape() in ezSQL_mssql
+
Format a mssql string correctly for safe mssql insert
+
+
+ escape +
+
+
ezSQL_sqlite::escape() in ezSQL_sqlite
+
Format a SQLite string correctly for safe SQLite insert (no matter if magic quotes are on or not)
+
+
+ escape +
+
+
ezSQL_mysql::escape() in ezSQL_mysql
+
Format a mySQL string correctly for safe mySQL insert (no matter if magic quotes are on or not)
+
+
+ escape +
+
+
ezSQL_codeigniter::escape() in ezSQL_codeigniter
+
Format a sql string correctly for safe insert
+
+
+ ezSQLcore +
+
+
ezSQLcore::ezSQLcore() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ ezSQLcore +
+
+
ezSQLcore in ez_sql_core_202console.php
+
********************************************************************
+
+
+ ezSQLcore +
+
+
ezSQLcore in ezSQL
+
ezSQL Core module - database abstraction library to make it very easy to deal with databases. ezSQLcore can not be used by itself (it is designed for use by database specific modules).
+
+
+ ezSQL_codeigniter +
+
+
ezSQL_codeigniter in ezSQL_codeigniter
+
ezSQL Database specific class - codeigniter Desc..: codeigniter component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_mssql +
+
+
ezSQL_mssql in ezSQL_mssql
+
ezSQL Database specific class - mssql Microsoft Sql Server component (part of ezSQL databse abstraction library) - based on ezSql_mySql library class.
+
+
+ ezSQL_mysql +
+
+
ezSQL_mysql in ezSQL_mysql
+
ezSQL Database specific class - mySQL Desc..: mySQL component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_oracle8_9 +
+
+
ezSQL_oracle8_9 in ezSQL_oracle8_9
+
ezSQL Database specific class - Oracle 8 and 9 Desc..: Oracle 8i/9i component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_pdo +
+
+
ezSQL_pdo in ezSQL_pdo
+
ezSQL class - PDO Desc..: PDO component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_postgresql +
+
+
ezSQL_postgresql in ezSQL_postgresql
+
ezSQL Database specific class - PostgreSQL Desc..: PostgreSQL component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_sqlite +
+
+
ezSQL_sqlite in ezSQL_sqlite
+
ezSQL class - SQLite Desc..: SQLite component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_sybase +
+
+
ezSQL_sybase in ezSQL_sybase
+
ezSQL class - Sybase ASE Desc..: Sybase ASE component (part of ezSQL database abstraction library) - based on ezSql_mssql library class.
+
+
+ EZSQL_VERSION +
+
+ +
Constant string ezSQL version information
+
+
+ ezSQL_mssql +
+
+
ezSQL_mssql in ezSQL_mssql
+
+
+ ezSQL_mysql +
+
+
ezSQL_mysql in ezSQL_mysql
+
+
+ ezSQL_oracle8_9 +
+
+
ezSQL_oracle8_9 in ezSQL_oracle8_9
+
+
+ ezSQL_pdo +
+
+
ezSQL_pdo in ezSQL_pdo
+
+
+ ezSQL_postgresql +
+
+
ezSQL_postgresql in ezSQL_postgresql
+
+
+ ezSQL +
+
+
ezSQL in ezSQL
+
+
+ ez_sql_core_2.1_debughack_0.2alpha.php +
+
+
ez_sql_core_2.1_debughack_0.2alpha.php in ez_sql_core_2.1_debughack_0.2alpha.php
+
+
+ ez_sql_core_202console.php +
+
+
ez_sql_core_202console.php in ez_sql_core_202console.php
+
+
+ ezSQL_sqlite +
+
+
ezSQL_sqlite in ezSQL_sqlite
+
+
+ ezSQL_sybase +
+
+
ezSQL_sybase in ezSQL_sybase
+
+
+ +
+
f
+ +
+
+
+
+ flush +
+
+
ezSQLcore::flush() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ flush +
+
+ +
Kill cached query results
+
+
+ +
+
g
+ +
+
+
+
+ getCharset +
+
+ +
Returns the current connection charset
+
+
+ getDBHost +
+
+
ezSQL_postgresql::getDBHost() in ezSQL_postgresql
+
Returns the current database server host
+
+
+ getDBHost +
+
+ +
Returns the current database server host
+
+
+ getDBHost +
+
+ +
Returns the current database server host
+
+
+ getDBHost +
+
+ +
Returns the current database server host
+
+
+ getDBName +
+
+
ezSQL_oracle8_9::getDBName() in ezSQL_oracle8_9
+
Returns the current database name
+
+
+ getPort +
+
+
ezSQL_postgresql::getPort() in ezSQL_postgresql
+
Returns the current TCP/IP port
+
+
+ get_cache +
+
+
ezSQLcore::get_cache() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ get_cache +
+
+ +
Get the query cache of a query
+
+
+ get_col +
+
+
ezSQLcore::get_col() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ get_col +
+
+ +
Function to get 1 column from the cached result set based in X index see docs for usage and info
+
+
+ get_col_info +
+
+ +
Function to get column meta data info pertaining to the last query See docs for more info and usage
+
+
+ get_col_info +
+
+
ezSQLcore::get_col_info() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ get_results +
+
+
ezSQLcore::get_results() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ get_results +
+
+ +
Return the the query as a result set - see docs for more details
+
+
+ get_row +
+
+ +
Get one row from the DB - see docs for more detail
+
+
+ get_row +
+
+
ezSQLcore::get_row() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ get_set +
+
+ +
Creates a SET nvp sql string from an associative array (and escapes all values)
+
+
+ get_var +
+
+
ezSQLcore::get_var() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ get_var +
+
+ +
Get one variable from the DB - see docs for more detail
+
+
+ +
+
h
+ +
+
+
+
+ hide_errors +
+
+
ezSQLcore::hide_errors() in ez_sql_core_202console.php
+
+
+ hide_errors +
+
+ +
Turn error handling off
+
+
+ +
+
i
+ +
+
+
+
+ insert_id +
+
+
ezSQL_oracle8_9::insert_id() in ezSQL_oracle8_9
+
Another oracle specific function - if you have set up a sequence this function returns the next ID from that sequence If the sequence is not defined, the sequence is created by this method.
+
+
+ is_equal_int +
+
+ +
Returns an equal string for integer values
+
+
+ is_equal_str +
+
+ +
Returns an escaped equal string
+
+
+ +
+
l
+ +
+
+
+
+ $last_error +
+
+
ezSQLcore::$last_error in ez_sql_core_202console.php
+
+
+ $last_error +
+
+ +
The last error object
+
+
+ $last_query +
+
+
ezSQLcore::$last_query in ez_sql_core_202console.php
+
+
+ $last_query +
+
+ +
The last query object
+
+
+ +
+
n
+ +
+
+
+
+ $num_queries +
+
+ +
Number of queries
+
+
+ $num_queries +
+
+
ezSQLcore::$num_queries in ez_sql_core_202console.php
+
+
+ nextVal +
+
+
ezSQL_oracle8_9::nextVal() in ezSQL_oracle8_9
+
An alias for insert_id using the original Oracle function name.
+
+
+ +
+
o
+ +
+
+
+
+ OBJECT +
+
+ +
Constant boolean Object
+
+
+ +
+
p
+ +
+
+
+
+ $profile_times +
+
+ +
Array for storing profiling times
+
+
+ +
+
q
+ +
+
+
+
+ query +
+
+
ezSQL_postgresql::query() in ezSQL_postgresql
+
Perform PostgreSQL query and try to detirmin result value
+
+
+ query +
+
+
ezSQL_sqlite::query() in ezSQL_sqlite
+
Perform SQLite query and try to detirmin result value Basic Query - see docs for more detail
+
+
+ query +
+
+
ezSQL_sybase::query() in ezSQL_sybase
+
Perform sybase query and try to detirmin result value
+
+
+ query +
+
+
ezSQLcore::query() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ query +
+
+
ezSQL_codeigniter::query() in ezSQL_codeigniter
+
Perform codignitor query and try to determine result value
+
+
+ query +
+
+
ezSQL_pdo::query() in ezSQL_pdo
+
Basic Query - see docs for more detail
+
+
+ query +
+
+
ezSQL_mysql::query() in ezSQL_mysql
+
Perform mySQL query and try to determine result value
+
+
+ query +
+
+
ezSQL_mssql::query() in ezSQL_mssql
+
Perform the mssql query and try to determine the result value
+
+
+ query +
+
+
ezSQL_oracle8_9::query() in ezSQL_oracle8_9
+
Perform Oracle query and try to determine result value
+
+
+ quick_connect +
+
+ +
Short hand way to connect to mssql database server and select a mssql database at the same time
+
+
+ quick_connect +
+
+ +
Short hand way to connect to sybase database server and select a sybase database at the same time
+
+
+ quick_connect +
+
+ +
In the case of SQLite quick_connect is not really needed because std.
+
+
+ quick_connect +
+
+ +
In the case of PostgreSQL quick_connect is not really needed because std.
+
+
+ quick_connect +
+
+ +
With PDO it is only an alias for the connect method
+
+
+ quick_connect +
+
+ +
Short hand way to connect to mssql database server and select a mssql database at the same time
+
+
+ quick_connect +
+
+ +
In the case of Oracle quick_connect is not really needed because std.
+
+
+ +
+
r
+ +
+
+
+
+ register_error +
+
+
ezSQLcore::register_error() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ register_error +
+
+ +
Print SQL/DB error - over-ridden by specific DB class
+
+
+ +
+
s
+ +
+
+
+
+ $show_errors +
+
+
ezSQLcore::$show_errors in ez_sql_core_202console.php
+
+
+ $sql_log_file +
+
+ +
Use a SQL log file
+
+
+ select +
+
+
ezSQL_pdo::select() in ezSQL_pdo
+
With PDO it is only an alias for the connect method
+
+
+ select +
+
+
ezSQL_sqlite::select() in ezSQL_sqlite
+
No real equivalent of mySQL select in SQLite once again, function included for the sake of consistency
+
+
+ select +
+
+
ezSQL_sybase::select() in ezSQL_sybase
+
Try to select a sybase database
+
+
+ select +
+
+
ezSQLcore::select() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ select +
+
+
ezSQL_oracle8_9::select() in ezSQL_oracle8_9
+
No real equivalent of mySQL select in Oracle, once again, function included for the sake of consistency
+
+
+ select +
+
+
ezSQL_postgresql::select() in ezSQL_postgresql
+
No real equivalent of mySQL select in PostgreSQL once again, function included for the sake of consistency
+
+
+ select +
+
+
ezSQL_mssql::select() in ezSQL_mssql
+
Try to select a mssql database
+
+
+ select +
+
+
ezSQL_mysql::select() in ezSQL_mysql
+
Try to select a mySQL database
+
+
+ showDatabases +
+
+ +
Return all databases of the current server
+
+
+ showTables +
+
+
ezSQL_postgresql::showTables() in ezSQL_postgresql
+
Return PostgreSQL specific values: Return all tables of the current schema
+
+
+ show_errors +
+
+ +
Turn error handling on, by default error handling is on
+
+
+ show_errors +
+
+
ezSQLcore::show_errors() in ez_sql_core_202console.php
+
******************************************************************** Turn error handling on or off..
+
+
+ store_cache +
+
+ +
Store the cache
+
+
+ store_cache +
+
+
ezSQLcore::store_cache() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ sysdate +
+
+
ezSQLcore::sysdate() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ sysdate +
+
+
ezSQL_sybase::sysdate() in ezSQL_sybase
+
Return sybase specific system date syntax i.e. Oracle: SYSDATE sybase: getDate()
+
+
+ sysdate +
+
+
ezSQL_mssql::sysdate() in ezSQL_mssql
+
Return mssql specific system date syntax i.e. Oracle: SYSDATE mssql: NOW(), MS-SQL : getDate()
+
+
+ sysdate +
+
+
ezSQL_mysql::sysdate() in ezSQL_mysql
+
Return mySQL specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
+
+
+ sysdate +
+
+ +
Return SQLite specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
+
+
+ sysdate +
+
+
ezSQL_postgresql::sysdate() in ezSQL_postgresql
+
Return PostgreSQL specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
+
+
+ sysdate +
+
+
ezSQL_oracle8_9::sysdate() in ezSQL_oracle8_9
+
Return Oracle specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
+
+
+ sysdate +
+
+
ezSQL_sqlite::sysdate() in ezSQL_sqlite
+
Return SQLite specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
+
+
+ +
+
t
+ +
+
+
+
+ $timers +
+
+ +
Timers
+
+
+ $total_query_time +
+
+ +
The total query time
+
+
+ $trace +
+
+ +
same as $debug_all
+
+
+ $trace +
+
+
ezSQLcore::$trace in ez_sql_core_202console.php
+
+
+ $trace_log +
+
+ +
The trace log
+
+
+ timer_elapsed +
+
+ +
Returns the elapsed time of the given timer by name
+
+
+ timer_get_cur +
+
+ +
Get current time
+
+
+ timer_start +
+
+ +
Start a timer by name
+
+
+ timer_update_global +
+
+ +
Update the global timer with an existing timer
+
+
+ +
+
u
+ +
+
+
+
+ $use_disk_cache +
+
+ +
Using disk cache
+
+
+ $use_disk_cache +
+
+
ezSQLcore::$use_disk_cache in ez_sql_core_202console.php
+
+
+ $use_trace_log +
+
+ +
Use the trace log
+
+
+ +
+
v
+ +
+
+
+
+ $vardump_called +
+
+
ezSQLcore::$vardump_called in ez_sql_core_202console.php
+
+
+ $vardump_called +
+
+ +
Vardump called
+
+
+ vardump +
+
+
ezSQLcore::vardump() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ vardump +
+
+ +
Dumps the contents of any input variable to screen in a nicely formatted and easy to understand way - any type: Object, public or Array
+
+
+ +
+
_
+ +
+
+
+
+ __construct +
+
+ +
Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_postgresql class
+
+
+ __construct +
+
+ +
Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_sqlite class
+
+
+ __construct +
+
+ +
+
+ __construct +
+
+ +
Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_sqlite class
+
+
+ __construct +
+
+ +
Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_oracle8_9 class
+
+
+ __construct +
+
+ +
+
+ __construct +
+
+ +
Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_mssql class
+
+
+ __construct +
+
+ +
Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_mysql class
+
+
+ __construct +
+
+ +
Constructor of ezSQL
+
+
+ +
+ a + c + d + e + f + g + h + i + l + n + o + p + q + r + s + t + u + v + _ +
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/elementindex_default.html b/_Documentation/phpDocumentator/elementindex_default.html new file mode 100644 index 00000000..9ab62577 --- /dev/null +++ b/_Documentation/phpDocumentator/elementindex_default.html @@ -0,0 +1,438 @@ + + + + + + + + + + + +

[default] element index

+

Package indexes

+ +All elements +
+
+ c + d + e + f + g + h + l + n + q + r + s + t + u + v +
+ + +
+
c
+ +
+
+
+
+ $cache_dir +
+
+
ezSQLcore::$cache_dir in ez_sql_core_202console.php
+
+
+ $cache_inserts +
+
+
ezSQLcore::$cache_inserts in ez_sql_core_202console.php
+
+
+ $cache_queries +
+
+
ezSQLcore::$cache_queries in ez_sql_core_202console.php
+
+
+ $cache_timeout +
+
+
ezSQLcore::$cache_timeout in ez_sql_core_202console.php
+
+
+ $captured_errors +
+
+
ezSQLcore::$captured_errors in ez_sql_core_202console.php
+
+
+ $col_info +
+
+
ezSQLcore::$col_info in ez_sql_core_202console.php
+
+
+ connect +
+
+
ezSQLcore::connect() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ +
+
d
+ +
+
+
+
+ $debug_all +
+
+
ezSQLcore::$debug_all in ez_sql_core_202console.php
+
+
+ $debug_called +
+
+
ezSQLcore::$debug_called in ez_sql_core_202console.php
+
+
+ $debug_echo +
+
+
ezSQLcore::$debug_echo in ez_sql_core_202console.php
+
+
+ debug +
+
+
ezSQLcore::debug() in ez_sql_core_202console.php
+
******************************************************************** Displays the last query string that was sent to the database & a table listing results (if there were any).
+
+
+ donation +
+
+
ezSQLcore::donation() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ dumpvar +
+
+
ezSQLcore::dumpvar() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ disk_cache_example.php +
+
+
disk_cache_example.php in disk_cache_example.php
+
+
+ disk_cache_example.php +
+
+
disk_cache_example.php in disk_cache_example.php
+
+
+ +
+
e
+ +
+
+
+
+ escape +
+
+
ezSQLcore::escape() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ ezSQLcore +
+
+
ezSQLcore::ezSQLcore() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ ezSQLcore +
+
+
ezSQLcore in ez_sql_core_202console.php
+
********************************************************************
+
+
+ ez_sql_core_2.1_debughack_0.2alpha.php +
+
+
ez_sql_core_2.1_debughack_0.2alpha.php in ez_sql_core_2.1_debughack_0.2alpha.php
+
+
+ ez_sql_core_202console.php +
+
+
ez_sql_core_202console.php in ez_sql_core_202console.php
+
+
+ +
+
f
+ +
+
+
+
+ flush +
+
+
ezSQLcore::flush() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ +
+
g
+ +
+
+
+
+ get_cache +
+
+
ezSQLcore::get_cache() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ get_col +
+
+
ezSQLcore::get_col() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ get_col_info +
+
+
ezSQLcore::get_col_info() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ get_results +
+
+
ezSQLcore::get_results() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ get_row +
+
+
ezSQLcore::get_row() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ get_var +
+
+
ezSQLcore::get_var() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ +
+
h
+ +
+
+
+
+ hide_errors +
+
+
ezSQLcore::hide_errors() in ez_sql_core_202console.php
+
+
+ +
+
l
+ +
+
+
+
+ $last_error +
+
+
ezSQLcore::$last_error in ez_sql_core_202console.php
+
+
+ $last_query +
+
+
ezSQLcore::$last_query in ez_sql_core_202console.php
+
+
+ +
+
n
+ +
+
+
+
+ $num_queries +
+
+
ezSQLcore::$num_queries in ez_sql_core_202console.php
+
+
+ +
+
q
+ +
+
+
+
+ query +
+
+
ezSQLcore::query() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ +
+
r
+ +
+
+
+
+ register_error +
+
+
ezSQLcore::register_error() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ +
+
s
+ +
+
+
+
+ $show_errors +
+
+
ezSQLcore::$show_errors in ez_sql_core_202console.php
+
+
+ select +
+
+
ezSQLcore::select() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ show_errors +
+
+
ezSQLcore::show_errors() in ez_sql_core_202console.php
+
******************************************************************** Turn error handling on or off..
+
+
+ store_cache +
+
+
ezSQLcore::store_cache() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ sysdate +
+
+
ezSQLcore::sysdate() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ +
+
t
+ +
+
+
+
+ $trace +
+
+
ezSQLcore::$trace in ez_sql_core_202console.php
+
+
+ +
+
u
+ +
+
+
+
+ $use_disk_cache +
+
+
ezSQLcore::$use_disk_cache in ez_sql_core_202console.php
+
+
+ +
+
v
+ +
+
+
+
+ $vardump_called +
+
+
ezSQLcore::$vardump_called in ez_sql_core_202console.php
+
+
+ vardump +
+
+
ezSQLcore::vardump() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ +
+ c + d + e + f + g + h + l + n + q + r + s + t + u + v +
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/elementindex_ezSQL.html b/_Documentation/phpDocumentator/elementindex_ezSQL.html new file mode 100644 index 00000000..5681e416 --- /dev/null +++ b/_Documentation/phpDocumentator/elementindex_ezSQL.html @@ -0,0 +1,1206 @@ + + + + + + + + + + + +

[ezSQL] element index

+

Package indexes

+ +All elements +
+
+ a + c + d + e + f + g + h + i + l + n + o + p + q + r + s + t + u + v + _ +
+ + +
+
_
+ +
+
+
+
+ __construct +
+
+ +
Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_postgresql class
+
+
+ __construct +
+
+ +
Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_sqlite class
+
+
+ __construct +
+
+ +
+
+ __construct +
+
+ +
Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_sqlite class
+
+
+ __construct +
+
+ +
Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_oracle8_9 class
+
+
+ __construct +
+
+ +
+
+ __construct +
+
+ +
Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_mssql class
+
+
+ __construct +
+
+ +
Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_mysql class
+
+
+ __construct +
+
+ +
Constructor of ezSQL
+
+
+ +
+
a
+ +
+
+
+
+ ARRAY_A +
+
+ +
Constant boolean
+
+
+ ARRAY_N +
+
+ +
Constant boolean
+
+
+ +
+
c
+ +
+
+
+
+ $cache_dir +
+
+ +
Using the cache directory
+
+
+ $cache_inserts +
+
+ +
Insert queries into the cache
+
+
+ $cache_queries +
+
+ +
Caching queries
+
+
+ $cache_timeout +
+
+ +
The cache timeout in hours
+
+
+ $captured_errors +
+
+ +
Captured errors
+
+
+ $col_info +
+
+ +
The last column info
+
+
+ catch_error +
+
+ +
Hooks into PDO error system and reports it to user
+
+
+ connect +
+
+ +
Try to connect to the database server in the DSN parameters
+
+
+ connect +
+
+
ezSQL_postgresql::connect() in ezSQL_postgresql
+
Try to connect to PostgreSQL database server
+
+
+ connect +
+
+
ezSQL_sqlite::connect() in ezSQL_sqlite
+
Try to connect to SQLite database server
+
+
+ connect +
+
+
ezSQL_mssql::connect() in ezSQL_mssql
+
Try to connect to mssql database server
+
+
+ connect +
+
+
ezSQL_sybase::connect() in ezSQL_sybase
+
Try to connect to sybase database server
+
+
+ connect +
+
+
ezSQL_mysql::connect() in ezSQL_mysql
+
Try to connect to mySQL database server
+
+
+ connect +
+
+
ezSQL_oracle8_9::connect() in ezSQL_oracle8_9
+
Try to connect to Oracle database server
+
+
+ ConvertMySqlToMSSql +
+
+ +
Convert a Query From MySql Syntax to MS-Sql syntax Following conversions are made:
  1. The '`' character used for MySql queries is not supported - + the character is removed.
+
+
+ ConvertMySqlTosybase +
+
+ +
Convert a Query From MySql Syntax to Sybase syntax Following conversions are made:
  1. The '`' character used for MySql queries is not supported - the + character is removed.
+
+
+ +
+
d
+ +
+
+
+
+ $db_connect_time +
+
+ +
The time it took to establish a connection
+
+
+ $debug +
+
+
ezSQL_codeigniter::$debug in ezSQL_codeigniter
+
+
+ $debug_all +
+
+ +
same as $trace
+
+
+ $debug_called +
+
+ +
Debug is called
+
+
+ $debug_echo_is_on +
+
+ +
== TJH == default now needed for echo of debug function
+
+
+ $do_profile +
+
+ +
Using profiling
+
+
+ debug +
+
+ +
Displays the last query string that was sent to the database & a table listing results (if there were any).
+
+
+ descTable +
+
+
ezSQL_postgresql::descTable() in ezSQL_postgresql
+
Return the description of the given table
+
+
+ disconnect +
+
+
ezSQL_postgresql::disconnect() in ezSQL_postgresql
+
Close the database connection
+
+
+ disconnect +
+
+ +
Close the database connection
+
+
+ disconnect +
+
+ +
Close the database connection
+
+
+ disconnect +
+
+ +
Close the database connection
+
+
+ disconnect +
+
+ +
Close the database connection
+
+
+ disconnect +
+
+ +
Close the database connection
+
+
+ disconnect +
+
+ +
Close the database connection
+
+
+ donation +
+
+ +
Naughty little function to ask for some remuniration!
+
+
+ dumpvar +
+
+ +
An alias for vardump method
+
+
+ +
+
e
+ +
+
+
+
+ ezSQL_codeigniter +
+
+
ezSQL_codeigniter in ezSQL_codeigniter
+
+
+ escape +
+
+
ezSQL_postgresql::escape() in ezSQL_postgresql
+
Format a mySQL string correctly for safe mySQL insert (no matter if magic quotes are on or not)
+
+
+ escape +
+
+
ezSQL_mssql::escape() in ezSQL_mssql
+
Format a mssql string correctly for safe mssql insert
+
+
+ escape +
+
+
ezSQL_mysql::escape() in ezSQL_mysql
+
Format a mySQL string correctly for safe mySQL insert (no matter if magic quotes are on or not)
+
+
+ escape +
+
+
ezSQL_pdo::escape() in ezSQL_pdo
+
Escape a string with the PDO method
+
+
+ escape +
+
+
ezSQL_oracle8_9::escape() in ezSQL_oracle8_9
+
Format a Oracle string correctly for safe Oracle insert
+
+
+ escape +
+
+
ezSQL_sqlite::escape() in ezSQL_sqlite
+
Format a SQLite string correctly for safe SQLite insert (no matter if magic quotes are on or not)
+
+
+ escape +
+
+
ezSQL_sybase::escape() in ezSQL_sybase
+
Format a sybase string correctly for safe sybase insert
+
+
+ escape +
+
+
ezSQL_codeigniter::escape() in ezSQL_codeigniter
+
Format a sql string correctly for safe insert
+
+
+ ezSQLcore +
+
+
ezSQLcore in ezSQL
+
ezSQL Core module - database abstraction library to make it very easy to deal with databases. ezSQLcore can not be used by itself (it is designed for use by database specific modules).
+
+
+ ezSQL_codeigniter +
+
+
ezSQL_codeigniter in ezSQL_codeigniter
+
ezSQL Database specific class - codeigniter Desc..: codeigniter component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_mssql +
+
+
ezSQL_mssql in ezSQL_mssql
+
ezSQL Database specific class - mssql Microsoft Sql Server component (part of ezSQL databse abstraction library) - based on ezSql_mySql library class.
+
+
+ ezSQL_mysql +
+
+
ezSQL_mysql in ezSQL_mysql
+
ezSQL Database specific class - mySQL Desc..: mySQL component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_oracle8_9 +
+
+
ezSQL_oracle8_9 in ezSQL_oracle8_9
+
ezSQL Database specific class - Oracle 8 and 9 Desc..: Oracle 8i/9i component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_pdo +
+
+
ezSQL_pdo in ezSQL_pdo
+
ezSQL class - PDO Desc..: PDO component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_postgresql +
+
+
ezSQL_postgresql in ezSQL_postgresql
+
ezSQL Database specific class - PostgreSQL Desc..: PostgreSQL component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_sqlite +
+
+
ezSQL_sqlite in ezSQL_sqlite
+
ezSQL class - SQLite Desc..: SQLite component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_sybase +
+
+
ezSQL_sybase in ezSQL_sybase
+
ezSQL class - Sybase ASE Desc..: Sybase ASE component (part of ezSQL database abstraction library) - based on ezSql_mssql library class.
+
+
+ EZSQL_VERSION +
+
+ +
Constant string ezSQL version information
+
+
+ ezSQL_mssql +
+
+
ezSQL_mssql in ezSQL_mssql
+
+
+ ezSQL_mysql +
+
+
ezSQL_mysql in ezSQL_mysql
+
+
+ ezSQL_oracle8_9 +
+
+
ezSQL_oracle8_9 in ezSQL_oracle8_9
+
+
+ ezSQL_pdo +
+
+
ezSQL_pdo in ezSQL_pdo
+
+
+ ezSQL_postgresql +
+
+
ezSQL_postgresql in ezSQL_postgresql
+
+
+ ezSQL +
+
+
ezSQL in ezSQL
+
+
+ ezSQL_sqlite +
+
+
ezSQL_sqlite in ezSQL_sqlite
+
+
+ ezSQL_sybase +
+
+
ezSQL_sybase in ezSQL_sybase
+
+
+ +
+
f
+ +
+
+
+
+ flush +
+
+ +
Kill cached query results
+
+
+ +
+
g
+ +
+
+
+
+ getCharset +
+
+ +
Returns the current connection charset
+
+
+ getDBHost +
+
+ +
Returns the current database server host
+
+
+ getDBHost +
+
+ +
Returns the current database server host
+
+
+ getDBHost +
+
+
ezSQL_postgresql::getDBHost() in ezSQL_postgresql
+
Returns the current database server host
+
+
+ getDBHost +
+
+ +
Returns the current database server host
+
+
+ getDBName +
+
+
ezSQL_oracle8_9::getDBName() in ezSQL_oracle8_9
+
Returns the current database name
+
+
+ getPort +
+
+
ezSQL_postgresql::getPort() in ezSQL_postgresql
+
Returns the current TCP/IP port
+
+
+ get_cache +
+
+ +
Get the query cache of a query
+
+
+ get_col +
+
+ +
Function to get 1 column from the cached result set based in X index see docs for usage and info
+
+
+ get_col_info +
+
+ +
Function to get column meta data info pertaining to the last query See docs for more info and usage
+
+
+ get_results +
+
+ +
Return the the query as a result set - see docs for more details
+
+
+ get_row +
+
+ +
Get one row from the DB - see docs for more detail
+
+
+ get_set +
+
+ +
Creates a SET nvp sql string from an associative array (and escapes all values)
+
+
+ get_var +
+
+ +
Get one variable from the DB - see docs for more detail
+
+
+ +
+
h
+ +
+
+
+
+ hide_errors +
+
+ +
Turn error handling off
+
+
+ +
+
i
+ +
+
+
+
+ insert_id +
+
+
ezSQL_oracle8_9::insert_id() in ezSQL_oracle8_9
+
Another oracle specific function - if you have set up a sequence this function returns the next ID from that sequence If the sequence is not defined, the sequence is created by this method.
+
+
+ is_equal_int +
+
+ +
Returns an equal string for integer values
+
+
+ is_equal_str +
+
+ +
Returns an escaped equal string
+
+
+ +
+
l
+ +
+
+
+
+ $last_error +
+
+ +
The last error object
+
+
+ $last_query +
+
+ +
The last query object
+
+
+ +
+
n
+ +
+
+
+
+ $num_queries +
+
+ +
Number of queries
+
+
+ nextVal +
+
+
ezSQL_oracle8_9::nextVal() in ezSQL_oracle8_9
+
An alias for insert_id using the original Oracle function name.
+
+
+ +
+
o
+ +
+
+
+
+ OBJECT +
+
+ +
Constant boolean Object
+
+
+ +
+
p
+ +
+
+
+
+ $profile_times +
+
+ +
Array for storing profiling times
+
+
+ +
+
q
+ +
+
+
+
+ query +
+
+
ezSQL_codeigniter::query() in ezSQL_codeigniter
+
Perform codignitor query and try to determine result value
+
+
+ query +
+
+
ezSQL_postgresql::query() in ezSQL_postgresql
+
Perform PostgreSQL query and try to detirmin result value
+
+
+ query +
+
+
ezSQL_sqlite::query() in ezSQL_sqlite
+
Perform SQLite query and try to detirmin result value Basic Query - see docs for more detail
+
+
+ query +
+
+
ezSQL_sybase::query() in ezSQL_sybase
+
Perform sybase query and try to detirmin result value
+
+
+ query +
+
+
ezSQL_oracle8_9::query() in ezSQL_oracle8_9
+
Perform Oracle query and try to determine result value
+
+
+ query +
+
+
ezSQL_pdo::query() in ezSQL_pdo
+
Basic Query - see docs for more detail
+
+
+ query +
+
+
ezSQL_mysql::query() in ezSQL_mysql
+
Perform mySQL query and try to determine result value
+
+
+ query +
+
+
ezSQL_mssql::query() in ezSQL_mssql
+
Perform the mssql query and try to determine the result value
+
+
+ quick_connect +
+
+ +
In the case of SQLite quick_connect is not really needed because std.
+
+
+ quick_connect +
+
+ +
Short hand way to connect to sybase database server and select a sybase database at the same time
+
+
+ quick_connect +
+
+ +
Short hand way to connect to mssql database server and select a mssql database at the same time
+
+
+ quick_connect +
+
+ +
In the case of PostgreSQL quick_connect is not really needed because std.
+
+
+ quick_connect +
+
+ +
Short hand way to connect to mssql database server and select a mssql database at the same time
+
+
+ quick_connect +
+
+ +
With PDO it is only an alias for the connect method
+
+
+ quick_connect +
+
+ +
In the case of Oracle quick_connect is not really needed because std.
+
+
+ +
+
r
+ +
+
+
+
+ register_error +
+
+ +
Print SQL/DB error - over-ridden by specific DB class
+
+
+ +
+
s
+ +
+
+
+
+ $sql_log_file +
+
+ +
Use a SQL log file
+
+
+ select +
+
+
ezSQL_postgresql::select() in ezSQL_postgresql
+
No real equivalent of mySQL select in PostgreSQL once again, function included for the sake of consistency
+
+
+ select +
+
+
ezSQL_sqlite::select() in ezSQL_sqlite
+
No real equivalent of mySQL select in SQLite once again, function included for the sake of consistency
+
+
+ select +
+
+
ezSQL_sybase::select() in ezSQL_sybase
+
Try to select a sybase database
+
+
+ select +
+
+
ezSQL_oracle8_9::select() in ezSQL_oracle8_9
+
No real equivalent of mySQL select in Oracle, once again, function included for the sake of consistency
+
+
+ select +
+
+
ezSQL_pdo::select() in ezSQL_pdo
+
With PDO it is only an alias for the connect method
+
+
+ select +
+
+
ezSQL_mysql::select() in ezSQL_mysql
+
Try to select a mySQL database
+
+
+ select +
+
+
ezSQL_mssql::select() in ezSQL_mssql
+
Try to select a mssql database
+
+
+ showDatabases +
+
+ +
Return all databases of the current server
+
+
+ showTables +
+
+
ezSQL_postgresql::showTables() in ezSQL_postgresql
+
Return PostgreSQL specific values: Return all tables of the current schema
+
+
+ show_errors +
+
+ +
Turn error handling on, by default error handling is on
+
+
+ store_cache +
+
+ +
Store the cache
+
+
+ sysdate +
+
+
ezSQL_sqlite::sysdate() in ezSQL_sqlite
+
Return SQLite specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
+
+
+ sysdate +
+
+
ezSQL_sybase::sysdate() in ezSQL_sybase
+
Return sybase specific system date syntax i.e. Oracle: SYSDATE sybase: getDate()
+
+
+ sysdate +
+
+
ezSQL_postgresql::sysdate() in ezSQL_postgresql
+
Return PostgreSQL specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
+
+
+ sysdate +
+
+
ezSQL_oracle8_9::sysdate() in ezSQL_oracle8_9
+
Return Oracle specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
+
+
+ sysdate +
+
+
ezSQL_mysql::sysdate() in ezSQL_mysql
+
Return mySQL specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
+
+
+ sysdate +
+
+
ezSQL_mssql::sysdate() in ezSQL_mssql
+
Return mssql specific system date syntax i.e. Oracle: SYSDATE mssql: NOW(), MS-SQL : getDate()
+
+
+ sysdate +
+
+ +
Return SQLite specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
+
+
+ +
+
t
+ +
+
+
+
+ $timers +
+
+ +
Timers
+
+
+ $total_query_time +
+
+ +
The total query time
+
+
+ $trace +
+
+ +
same as $debug_all
+
+
+ $trace_log +
+
+ +
The trace log
+
+
+ timer_elapsed +
+
+ +
Returns the elapsed time of the given timer by name
+
+
+ timer_get_cur +
+
+ +
Get current time
+
+
+ timer_start +
+
+ +
Start a timer by name
+
+
+ timer_update_global +
+
+ +
Update the global timer with an existing timer
+
+
+ +
+
u
+ +
+
+
+
+ $use_disk_cache +
+
+ +
Using disk cache
+
+
+ $use_trace_log +
+
+ +
Use the trace log
+
+
+ +
+
v
+ +
+
+
+
+ $vardump_called +
+
+ +
Vardump called
+
+
+ vardump +
+
+ +
Dumps the contents of any input variable to screen in a nicely formatted and easy to understand way - any type: Object, public or Array
+
+
+ +
+ a + c + d + e + f + g + h + i + l + n + o + p + q + r + s + t + u + v + _ +
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/errors.html b/_Documentation/phpDocumentator/errors.html new file mode 100644 index 00000000..a700195e --- /dev/null +++ b/_Documentation/phpDocumentator/errors.html @@ -0,0 +1,49 @@ + + + + + + phpDocumentor Parser Errors and Warnings + + + + + Post-parsing
+disk_cache_example.php
+ez_sql_core_2.1_debughack_0.2alpha.php
+ez_sql_core_202console.php
+ +

Post-parsing

+

Warnings:


+Warning - +duplicate class element "ezSQLcore" in file /home/stefanie/Projects/ezSQL/ezSQL/shared/ez_sql_core_2.1_debughack_0.2alpha.php will be ignored. +Use an @ignore tag on the original if you want this case to be documented.
+ +

demo.php

+

Warnings:


+Warning on line 10 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/oracle8_9/demo.php
+Warning on line 10 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/pdo/demo.php
+Warning on line 10 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/postgresql/demo.php
+Warning on line 10 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/mssql/demo.php
+Warning on line 10 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/mysql/demo.php
+Warning on line 10 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/sqlite/demo.php
+ +

disk_cache_example.php

+

Warnings:


+Warning on line 55 - File "/home/stefanie/Projects/ezSQL/ezSQL/mysql/disk_cache_example.php" has no page-level DocBlock, use @package in the first DocBlock to create one
+Warning on line 58 - File "/home/stefanie/Projects/ezSQL/ezSQL/oracle8_9/disk_cache_example.php" has no page-level DocBlock, use @package in the first DocBlock to create one
+ +

ez_sql_core_2.1_debughack_0.2alpha.php

+

Warnings:


+Warning on line 67 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/shared/ez_sql_core_2.1_debughack_0.2alpha.php
+Warning on line 82 - no @package tag was used in a DocBlock for class ezSQLcore
+ +

ez_sql_core_202console.php

+

Warnings:


+Warning on line 30 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/shared/ez_sql_core_202console.php
+Warning on line 45 - no @package tag was used in a DocBlock for class ezSQLcore
+

+ Documentation generated on Sun, 01 Apr 2012 23:51:55 +0200 by phpDocumentor 1.4.4 +

+ + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_codeigniter---Ezsql_codeigniter.php.html b/_Documentation/phpDocumentator/ezSQL/_codeigniter---Ezsql_codeigniter.php.html new file mode 100644 index 00000000..16f1abef --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/_codeigniter---Ezsql_codeigniter.php.html @@ -0,0 +1,68 @@ + + + + + + Docs for page ezSQL_codeigniter + + + + +
+

/codeigniter/Ezsql_codeigniter.php

+ + +
+
Description
+ +
+ +

ezSQL Database specific class - codeigniter Desc..: codeigniter component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting (mail@stefanie-stoelting.de)
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_codeigniter
  • +
  • license: FREE
  • +
+ +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_codeigniter + + ezSQL Database specific class - codeigniter Desc..: codeigniter component (part of ezSQL databse abstraction library) +
+
+
+ + + + + +

+ Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_mssql---ez_sql_mssql.php.html b/_Documentation/phpDocumentator/ezSQL/_mssql---ez_sql_mssql.php.html new file mode 100644 index 00000000..958fb176 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/_mssql---ez_sql_mssql.php.html @@ -0,0 +1,68 @@ + + + + + + Docs for page ezSQL_mssql + + + + +
+

/mssql/ez_sql_mssql.php

+ + +
+
Description
+ +
+ +

ezSQL Database specific class - mssql Microsoft Sql Server component (part of ezSQL databse abstraction library) - based on ezSql_mySql library class.

+
    +
  • author: ashank (ashank@gmail.com)
  • +
  • author: Stefanie Janine Stoelting (mail@stefanie-stoelting.de)
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_mssql
  • +
  • license: FREE
  • +
+ +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_mssql + + ezSQL Database specific class - mssql Microsoft Sql Server component (part of ezSQL databse abstraction library) - based on ezSql_mySql library class. +
+
+
+ + + + + +

+ Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_mysql---ez_sql_mysql.php.html b/_Documentation/phpDocumentator/ezSQL/_mysql---ez_sql_mysql.php.html new file mode 100644 index 00000000..adf30f45 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/_mysql---ez_sql_mysql.php.html @@ -0,0 +1,68 @@ + + + + + + Docs for page ezSQL_mysql + + + + +
+

/mysql/ez_sql_mysql.php

+ + +
+
Description
+ +
+ +

ezSQL Database specific class - mySQL Desc..: mySQL component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting (mail@stefanie-stoelting.de)
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_mysql
  • +
  • license: FREE
  • +
+ +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_mysql + + ezSQL Database specific class - mySQL Desc..: mySQL component (part of ezSQL databse abstraction library) +
+
+
+ + + + + +

+ Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_oracle8_9---ez_sql_oracle8_9.php.html b/_Documentation/phpDocumentator/ezSQL/_oracle8_9---ez_sql_oracle8_9.php.html new file mode 100644 index 00000000..86cb40bd --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/_oracle8_9---ez_sql_oracle8_9.php.html @@ -0,0 +1,68 @@ + + + + + + Docs for page ezSQL_oracle8_9 + + + + +
+

/oracle8_9/ez_sql_oracle8_9.php

+ + +
+
Description
+ +
+ +

ezSQL Database specific class - Oracle 8 and 9 Desc..: Oracle 8i/9i component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting (mail@stefanie-stoelting.de)
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_oracle8_9
  • +
  • license: FREE
  • +
+ +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_oracle8_9 + + ezSQL Database specific class - Oracle 8 and 9 Desc..: Oracle 8i/9i component (part of ezSQL databse abstraction library) +
+
+
+ + + + + +

+ Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_pdo---ez_sql_pdo.php.html b/_Documentation/phpDocumentator/ezSQL/_pdo---ez_sql_pdo.php.html new file mode 100644 index 00000000..033b94f0 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/_pdo---ez_sql_pdo.php.html @@ -0,0 +1,68 @@ + + + + + + Docs for page ezSQL_pdo + + + + +
+

/pdo/ez_sql_pdo.php

+ + +
+
Description
+ +
+ +

ezSQL class - PDO Desc..: PDO component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting (mail@stefanie-stoelting.de)
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_pdo
  • +
  • license: FREE
  • +
+ +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_pdo + + ezSQL class - PDO Desc..: PDO component (part of ezSQL databse abstraction library) +
+
+
+ + + + + +

+ Documentation generated on Sun, 01 Apr 2012 23:51:55 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_postgresql---ez_sql_postgresql.php.html b/_Documentation/phpDocumentator/ezSQL/_postgresql---ez_sql_postgresql.php.html new file mode 100644 index 00000000..27068364 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/_postgresql---ez_sql_postgresql.php.html @@ -0,0 +1,68 @@ + + + + + + Docs for page ezSQL_postgresql + + + + +
+

/postgresql/ez_sql_postgresql.php

+ + +
+
Description
+ +
+ +

ezSQL Database specific class - PostgreSQL Desc..: PostgreSQL component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting (mail@stefanie-stoelting.de)
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_postgresql
  • +
  • license: FREE
  • +
+ +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_postgresql + + ezSQL Database specific class - PostgreSQL Desc..: PostgreSQL component (part of ezSQL databse abstraction library) +
+
+
+ + + + + +

+ Documentation generated on Sun, 01 Apr 2012 23:51:55 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_shared---ez_sql_core.php.html b/_Documentation/phpDocumentator/ezSQL/_shared---ez_sql_core.php.html new file mode 100644 index 00000000..51d88d58 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/_shared---ez_sql_core.php.html @@ -0,0 +1,68 @@ + + + + + + Docs for page ezSQL + + + + +
+

/shared/ez_sql_core.php

+ + +
+
Description
+ +
+ +

ezSQL Core module - database abstraction library to make it very easy to deal with databases. ezSQLcore can not be used by itself (it is designed for use by database specific modules).

+
    +
  • author: Justin Vincent (jv@vip.ie)
  • +
  • author: Stefanie Janine Stoelting (mail@stefanie-stoelting.de)
  • +
  • link: http://justinvincent.com
  • +
  • name: ezSQL
  • +
  • license: FREE
  • +
+ +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQLcore + + ezSQL Core module - database abstraction library to make it very easy to deal with databases. ezSQLcore can not be used by itself (it is designed for use by database specific modules). +
+
+
+ + + + + +

+ Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_sqlite---ez_sql_sqlite.php.html b/_Documentation/phpDocumentator/ezSQL/_sqlite---ez_sql_sqlite.php.html new file mode 100644 index 00000000..6bbe875d --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/_sqlite---ez_sql_sqlite.php.html @@ -0,0 +1,68 @@ + + + + + + Docs for page ezSQL_sqlite + + + + +
+

/sqlite/ez_sql_sqlite.php

+ + +
+
Description
+ +
+ +

ezSQL class - SQLite Desc..: SQLite component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting (mail@stefanie-stoelting.de)
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_sqlite
  • +
  • license: FREE
  • +
+ +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_sqlite + + ezSQL class - SQLite Desc..: SQLite component (part of ezSQL databse abstraction library) +
+
+
+ + + + + +

+ Documentation generated on Sun, 01 Apr 2012 23:51:55 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_sybase---ez_sql_sybase.php.html b/_Documentation/phpDocumentator/ezSQL/_sybase---ez_sql_sybase.php.html new file mode 100644 index 00000000..dac8878c --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/_sybase---ez_sql_sybase.php.html @@ -0,0 +1,68 @@ + + + + + + Docs for page ezSQL_sybase + + + + +
+

/sybase/ez_sql_sybase.php

+ + +
+
Description
+ +
+ +

ezSQL class - Sybase ASE Desc..: Sybase ASE component (part of ezSQL database abstraction library) - based on ezSql_mssql library class.

+
    +
  • author: Muhammad Iyas (iyasilias@gmail.com)
  • +
  • author: Stefanie Janine Stoelting (mail@stefanie-stoelting.de)
  • +
  • link:
  • +
  • name: ezSQL_sybase
  • +
  • license: FREE
  • +
+ +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_sybase + + ezSQL class - Sybase ASE Desc..: Sybase ASE component (part of ezSQL database abstraction library) - based on ezSql_mssql library class. +
+
+
+ + + + + +

+ Documentation generated on Sun, 01 Apr 2012 23:51:55 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/ezSQL_codeigniter.html b/_Documentation/phpDocumentator/ezSQL/ezSQL_codeigniter.html new file mode 100644 index 00000000..c08ee61a --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/ezSQL_codeigniter.html @@ -0,0 +1,393 @@ + + + + + + Docs For Class ezSQL_codeigniter + + + + +
+

Class ezSQL_codeigniter

+ + +
+
Description
+ +
+ +

ezSQL Database specific class - codeigniter Desc..: codeigniter component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting (mail@stefanie-stoelting.de)
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_codeigniter
  • +
  • license: FREE
  • +
+

+ Located in /codeigniter/Ezsql_codeigniter.php (line 14) +

+ + +
ezSQLcore
+   |
+   --ezSQL_codeigniter
+ +
+
+ + + + +
+
Variable Summary
+ +
+
+
+ mixed + $debug +
+
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ ezSQL_codeigniter + __construct + () +
+
+ string + escape + (string $str, [boolean $like = false]) +
+
+ boolean|int + query + (string $query) +
+
+
+
+ + + + + +
+
Methods
+ +
+ + + +
+ +
+ Constructor __construct (line 23) +
+ + +
    +
  • throws: Exception Requires ez_sql_core.php
  • +
+ +
+ ezSQL_codeigniter + + __construct + + () +
+ + +
+
Redefinition of:
+
+
ezSQLcore::__construct()
+
Constructor of ezSQL
+
+ +
+ +
+ +
+ escape (line 154) +
+ + +

Format a sql string correctly for safe insert

+
    +
  • access: public
  • +
+ +
+ string + + escape + + (string $str, [boolean $like = false]) +
+ +
    +
  • + string + $str
  • +
  • + boolean + $like
  • +
+ + +
+ +
+ +
+ query (line 39) +
+ + +

Perform codignitor query and try to determine result value

+
    +
  • access: public
  • +
+ +
+ boolean|int + + query + + (string $query) +
+ +
    +
  • + string + $query
  • +
+ + +
+

Inherited Methods

+ + +

Inherited From ezSQLcore

+
+ ezSQLcore::__construct()
+ ezSQLcore::debug()
+ ezSQLcore::donation()
+ ezSQLcore::dumpvar()
+ ezSQLcore::flush()
+ ezSQLcore::get_cache()
+ ezSQLcore::get_col()
+ ezSQLcore::get_col_info()
+ ezSQLcore::get_results()
+ ezSQLcore::get_row()
+ ezSQLcore::get_set()
+ ezSQLcore::get_var()
+ ezSQLcore::hide_errors()
+ ezSQLcore::register_error()
+ ezSQLcore::show_errors()
+ ezSQLcore::store_cache()
+ ezSQLcore::timer_elapsed()
+ ezSQLcore::timer_get_cur()
+ ezSQLcore::timer_start()
+ ezSQLcore::timer_update_global()
+ ezSQLcore::vardump()
+
+ +
+
+ + +
+
Class Constants
+ +
+

Inherited Constants

+ +

Inherited from ezSQLcore

+
+ + ezSQLcore::ARRAY_A
+
+ + ezSQLcore::ARRAY_N
+
+ + ezSQLcore::EZSQL_VERSION
+
+ + ezSQLcore::OBJECT
+
+
+ +
+
+ +

+ Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/ezSQL_mssql.html b/_Documentation/phpDocumentator/ezSQL/ezSQL_mssql.html new file mode 100644 index 00000000..3c5e2cb5 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/ezSQL_mssql.html @@ -0,0 +1,607 @@ + + + + + + Docs For Class ezSQL_mssql + + + + +
+

Class ezSQL_mssql

+ + +
+
Description
+ +
+ +

ezSQL Database specific class - mssql Microsoft Sql Server component (part of ezSQL databse abstraction library) - based on ezSql_mySql library class.

+
    +
  • author: ashank (ashank@gmail.com)
  • +
  • author: Stefanie Janine Stoelting (mail@stefanie-stoelting.de)
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_mssql
  • +
  • license: FREE
  • +
+

+ Located in /mssql/ez_sql_mssql.php (line 14) +

+ + +
ezSQLcore
+   |
+   --ezSQL_mssql
+ +
+
+ + + + + +
+
Method Summary
+ +
+
+ +
+ ezSQL_mssql + __construct + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [boolean $convertMySqlToMSSqlQuery = true]) +
+
+ boolean + connect + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbhost = 'localhost']) +
+
+ string + ConvertMySqlToMSSql + (string $query) +
+
+ void + disconnect + () +
+
+ string + escape + (string $str) +
+
+ string + getDBHost + () +
+
+ boolean + query + (string $query) +
+
+ boolean + quick_connect + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost']) +
+
+ boolean + select + ([string $dbname = '']) +
+
+ string + sysdate + () +
+
+
+
+ + + + + +
+
Methods
+ +
+ + + +
+ +
+ Constructor __construct (line 75) +
+ + +

Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_mssql class

+
    +
  • throws: Exception Requires ntwdblib.dll and ez_sql_core.php
  • +
  • access: public
  • +
+ +
+ ezSQL_mssql + + __construct + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [boolean $convertMySqlToMSSqlQuery = true]) +
+ +
    +
  • + string + $dbuser: The database user name Default is empty string
  • +
  • + string + $dbpassword: The database users password Default is empty string
  • +
  • + string + $dbname: The name of the database Default is empty string
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
  • + boolean + $convertMySqlToMSSqlQuery: Default is true
  • +
+ +
+
Redefinition of:
+
+
ezSQLcore::__construct()
+
Constructor of ezSQL
+
+ +
+ +
+ +
+ connect (line 120) +
+ + +

Try to connect to mssql database server

+
    +
  • access: public
  • +
+ +
+ boolean + + connect + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbhost = 'localhost']) +
+ +
    +
  • + string + $dbuser: The database user name
  • +
  • + string + $dbpassword: The database users password
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
+ + +
+ +
+ +
+ ConvertMySqlToMSSql (line 365) +
+ + +

Convert a Query From MySql Syntax to MS-Sql syntax Following conversions are made:

  1. The '`' character used for MySql queries is not supported - + the character is removed.

+

2. FROM_UNIXTIME method is not supported. The Function is removed.It is replaced with getDate(). Warning: This logic may not be right. 3. unix_timestamp function is removed. 4. LIMIT keyowrd is replaced with TOP keyword. Warning: Logic not fully tested.

Note: This method is only a small attempt to convert the syntax. There are many aspects which are not covered here. This method doesn't at all guarantee complete conversion. Certain queries will still not work. e.g. MS SQL requires all columns in Select Clause to be present in 'group by' clause. There is no such restriction in MySql.

+
    +
  • access: public
  • +
+ +
+ string + + ConvertMySqlToMSSql + + (string $query) +
+ +
    +
  • + string + $query
  • +
+ + +
+ +
+ +
+ disconnect (line 404) +
+ + +

Close the database connection

+
    +
  • access: public
  • +
+ +
+ void + + disconnect + + () +
+ + + +
+ +
+ +
+ escape (line 179) +
+ + +

Format a mssql string correctly for safe mssql insert

+
    +
  • access: public
  • +
+ +
+ string + + escape + + (string $str) +
+ +
    +
  • + string + $str
  • +
+ + +
+ +
+ +
+ getDBHost (line 415) +
+ + +

Returns the current database server host

+
    +
  • access: public
  • +
+ +
+ string + + getDBHost + + () +
+ + + +
+ +
+ +
+ query (line 223) +
+ + +

Perform the mssql query and try to determine the result value

+
    +
  • access: public
  • +
+ +
+ boolean + + query + + (string $query) +
+ +
    +
  • + string + $query
  • +
+ + +
+ +
+ +
+ quick_connect (line 103) +
+ + +

Short hand way to connect to mssql database server and select a mssql database at the same time

+
    +
  • access: public
  • +
+ +
+ boolean + + quick_connect + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost']) +
+ +
    +
  • + string + $dbuser: The database user name
  • +
  • + string + $dbpassword: The database users password
  • +
  • + string + $dbname: The name of the database
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
+ + +
+ +
+ +
+ select (line 148) +
+ + +

Try to select a mssql database

+
    +
  • access: public
  • +
+ +
+ boolean + + select + + ([string $dbname = '']) +
+ +
    +
  • + string + $dbname: The name of the database
  • +
+ + +
+ +
+ +
+ sysdate (line 212) +
+ + +

Return mssql specific system date syntax i.e. Oracle: SYSDATE mssql: NOW(), MS-SQL : getDate()

+
    +
  • access: public
  • +
+ +
+ string + + sysdate + + () +
+ + + +
+

Inherited Methods

+ + +

Inherited From ezSQLcore

+
+ ezSQLcore::__construct()
+ ezSQLcore::debug()
+ ezSQLcore::donation()
+ ezSQLcore::dumpvar()
+ ezSQLcore::flush()
+ ezSQLcore::get_cache()
+ ezSQLcore::get_col()
+ ezSQLcore::get_col_info()
+ ezSQLcore::get_results()
+ ezSQLcore::get_row()
+ ezSQLcore::get_set()
+ ezSQLcore::get_var()
+ ezSQLcore::hide_errors()
+ ezSQLcore::register_error()
+ ezSQLcore::show_errors()
+ ezSQLcore::store_cache()
+ ezSQLcore::timer_elapsed()
+ ezSQLcore::timer_get_cur()
+ ezSQLcore::timer_start()
+ ezSQLcore::timer_update_global()
+ ezSQLcore::vardump()
+
+ +
+
+ + +
+
Class Constants
+ +
+

Inherited Constants

+ +

Inherited from ezSQLcore

+
+ + ezSQLcore::ARRAY_A
+
+ + ezSQLcore::ARRAY_N
+
+ + ezSQLcore::EZSQL_VERSION
+
+ + ezSQLcore::OBJECT
+
+
+ +
+
+ +

+ Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/ezSQL_mysql.html b/_Documentation/phpDocumentator/ezSQL/ezSQL_mysql.html new file mode 100644 index 00000000..35f23490 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/ezSQL_mysql.html @@ -0,0 +1,602 @@ + + + + + + Docs For Class ezSQL_mysql + + + + +
+

Class ezSQL_mysql

+ + +
+
Description
+ +
+ +

ezSQL Database specific class - mySQL Desc..: mySQL component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting (mail@stefanie-stoelting.de)
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_mysql
  • +
  • license: FREE
  • +
+

+ Located in /mysql/ez_sql_mysql.php (line 14) +

+ + +
ezSQLcore
+   |
+   --ezSQL_mysql
+ +
+
+ + + + + +
+
Method Summary
+ +
+
+ +
+ ezSQL_mysql + __construct + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [string $charset = '']) +
+
+ boolean + connect + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbhost = 'localhost'], [type $charset = '']) +
+
+ void + disconnect + () +
+
+ string + escape + (string $str) +
+
+ string + getCharset + () +
+
+ string + getDBHost + () +
+
+ boolean + query + (type $query) +
+
+ boolean + quick_connect + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost']) +
+
+ boolean + select + ([string $dbname = '']) +
+
+ string + sysdate + () +
+
+
+
+ + + + + +
+
Methods
+ +
+ + + +
+ +
+ Constructor __construct (line 72) +
+ + +

Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_mysql class

+
    +
  • access: public
  • +
+ +
+ ezSQL_mysql + + __construct + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [string $charset = '']) +
+ +
    +
  • + string + $dbuser: The database user name
  • +
  • + string + $dbpassword: The database users password
  • +
  • + string + $dbname: The name of the database
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
  • + string + $charset: The database charset Default is empty string
  • +
+ +
+
Redefinition of:
+
+
ezSQLcore::__construct()
+
Constructor of ezSQL
+
+ +
+ +
+ +
+ connect (line 121) +
+ + +

Try to connect to mySQL database server

+
    +
  • access: public
  • +
+ +
+ boolean + + connect + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbhost = 'localhost'], [type $charset = '']) +
+ +
    +
  • + string + $dbuser: The database user name
  • +
  • + string + $dbpassword: The database users password
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
  • + type + $charset: The database charset Default is empty string
  • +
+ + +
+ +
+ +
+ disconnect (line 308) +
+ + +

Close the database connection

+
    +
  • access: public
  • +
+ +
+ void + + disconnect + + () +
+ + + +
+ +
+ +
+ escape (line 189) +
+ + +

Format a mySQL string correctly for safe mySQL insert (no matter if magic quotes are on or not)

+
    +
  • access: public
  • +
+ +
+ string + + escape + + (string $str) +
+ +
    +
  • + string + $str
  • +
+ + +
+ +
+ +
+ getCharset (line 328) +
+ + +

Returns the current connection charset

+
    +
  • access: public
  • +
+ +
+ string + + getCharset + + () +
+ + + +
+ +
+ +
+ getDBHost (line 319) +
+ + +

Returns the current database server host

+
    +
  • access: public
  • +
+ +
+ string + + getDBHost + + () +
+ + + +
+ +
+ +
+ query (line 215) +
+ + +

Perform mySQL query and try to determine result value

+
    +
  • access: public
  • +
+ +
+ boolean + + query + + (type $query) +
+ +
    +
  • + type + $query
  • +
+ + +
+ +
+ +
+ quick_connect (line 102) +
+ + +

Short hand way to connect to mssql database server and select a mssql database at the same time

+
    +
  • access: public
  • +
+ +
+ boolean + + quick_connect + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost']) +
+ +
    +
  • + string + $dbuser: The database user name
  • +
  • + string + $dbpassword: The database users password
  • +
  • + string + $dbname: The name of the database
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
+ + +
+ +
+ +
+ select (line 154) +
+ + +

Try to select a mySQL database

+
    +
  • access: public
  • +
+ +
+ boolean + + select + + ([string $dbname = '']) +
+ +
    +
  • + string + $dbname: The name of the database
  • +
+ + +
+ +
+ +
+ sysdate (line 205) +
+ + +

Return mySQL specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()

+
    +
  • access: public
  • +
+ +
+ string + + sysdate + + () +
+ + + +
+

Inherited Methods

+ + +

Inherited From ezSQLcore

+
+ ezSQLcore::__construct()
+ ezSQLcore::debug()
+ ezSQLcore::donation()
+ ezSQLcore::dumpvar()
+ ezSQLcore::flush()
+ ezSQLcore::get_cache()
+ ezSQLcore::get_col()
+ ezSQLcore::get_col_info()
+ ezSQLcore::get_results()
+ ezSQLcore::get_row()
+ ezSQLcore::get_set()
+ ezSQLcore::get_var()
+ ezSQLcore::hide_errors()
+ ezSQLcore::register_error()
+ ezSQLcore::show_errors()
+ ezSQLcore::store_cache()
+ ezSQLcore::timer_elapsed()
+ ezSQLcore::timer_get_cur()
+ ezSQLcore::timer_start()
+ ezSQLcore::timer_update_global()
+ ezSQLcore::vardump()
+
+ +
+
+ + +
+
Class Constants
+ +
+

Inherited Constants

+ +

Inherited from ezSQLcore

+
+ + ezSQLcore::ARRAY_A
+
+ + ezSQLcore::ARRAY_N
+
+ + ezSQLcore::EZSQL_VERSION
+
+ + ezSQLcore::OBJECT
+
+
+ +
+
+ +

+ Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/ezSQL_oracle8_9.html b/_Documentation/phpDocumentator/ezSQL/ezSQL_oracle8_9.html new file mode 100644 index 00000000..7f791672 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/ezSQL_oracle8_9.html @@ -0,0 +1,706 @@ + + + + + + Docs For Class ezSQL_oracle8_9 + + + + +
+

Class ezSQL_oracle8_9

+ + +
+
Description
+ +
+ +

ezSQL Database specific class - Oracle 8 and 9 Desc..: Oracle 8i/9i component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting (mail@stefanie-stoelting.de)
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_oracle8_9
  • +
  • license: FREE
  • +
+

+ Located in /oracle8_9/ez_sql_oracle8_9.php (line 14) +

+ + +
ezSQLcore
+   |
+   --ezSQL_oracle8_9
+ +
+
+ + + + + +
+
Method Summary
+ +
+
+ +
+ ezSQL_oracle8_9 + __construct + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = '']) +
+
+ boolean + connect + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = '']) +
+
+ void + disconnect + () +
+
+ string + escape + (string $str) +
+
+ string + getDBName + () +
+
+ string + insert_id + (string $seq_name) +
+
+ string + is_equal_int + (string $int) +
+
+ string + is_equal_str + ([string $str = '']) +
+
+ string + nextVal + (string $seq_name) +
+
+ object + query + (string $query) +
+
+ boolean + quick_connect + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = '']) +
+
+ boolean + select + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = '']) +
+
+ string + sysdate + () +
+
+
+
+ + + + + +
+
Methods
+ +
+ + + +
+ +
+ Constructor __construct (line 56) +
+ + +

Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_oracle8_9 class

+
    +
  • throws: Exception Requires Orcle OCI Lib and ez_sql_core.php
  • +
  • access: public
  • +
+ +
+ ezSQL_oracle8_9 + + __construct + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = '']) +
+ +
    +
  • + string + $dbuser: The database user name Default is empty string
  • +
  • + string + $dbpassword: The database users password Default is empty string
  • +
  • + string + $dbname: The name of the database Default is empty string
  • +
+ +
+
Redefinition of:
+
+
ezSQLcore::__construct()
+
Constructor of ezSQL
+
+ +
+ +
+ +
+ connect (line 86) +
+ + +

Try to connect to Oracle database server

+
    +
  • access: public
  • +
+ +
+ boolean + + connect + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = '']) +
+ +
    +
  • + string + $dbuser: The database user name Default is empty string
  • +
  • + string + $dbpassword: The database users password Default is empty string
  • +
  • + string + $dbname: The name of the database Default is empty string
  • +
+ + +
+ +
+ +
+ disconnect (line 343) +
+ + +

Close the database connection

+
    +
  • access: public
  • +
+ +
+ void + + disconnect + + () +
+ + + +
+ +
+ +
+ escape (line 150) +
+ + +

Format a Oracle string correctly for safe Oracle insert

+
    +
  • access: public
  • +
+ +
+ string + + escape + + (string $str) +
+ +
    +
  • + string + $str
  • +
+ + +
+ +
+ +
+ getDBName (line 354) +
+ + +

Returns the current database name

+
    +
  • access: public
  • +
+ +
+ string + + getDBName + + () +
+ + + +
+ +
+ +
+ insert_id (line 226) +
+ + +

Another oracle specific function - if you have set up a sequence this function returns the next ID from that sequence If the sequence is not defined, the sequence is created by this method.

+

Though be shure, that you use the correct sequence name not to end in more than one sequence for a primary key of a table.

+
    +
  • access: public
  • +
+ +
+ string + + insert_id + + (string $seq_name) +
+ +
    +
  • + string + $seq_name: Name of the sequenze
  • +
+ + +
+ +
+ +
+ is_equal_int (line 212) +
+ + +

Returns an equal string for integer values

+
    +
  • access: public
  • +
+ +
+ string + + is_equal_int + + (string $int) +
+ +
    +
  • + string + $int
  • +
+ + +
+ +
+ +
+ is_equal_str (line 202) +
+ + +

Returns an escaped equal string

+
    +
  • access: public
  • +
+ +
+ string + + is_equal_str + + ([string $str = '']) +
+ +
    +
  • + string + $str
  • +
+ + +
+ +
+ +
+ nextVal (line 246) +
+ + +

An alias for insert_id using the original Oracle function name.

+
    +
  • access: public
  • +
+ +
+ string + + nextVal + + (string $seq_name) +
+ +
    +
  • + string + $seq_name: Name of the sequenze
  • +
+ + +
+ +
+ +
+ query (line 256) +
+ + +

Perform Oracle query and try to determine result value

+
    +
  • access: public
  • +
+ +
+ object + + query + + (string $query) +
+ +
    +
  • + string + $query
  • +
+ + +
+ +
+ +
+ quick_connect (line 124) +
+ + +

In the case of Oracle quick_connect is not really needed because std.

+

connect already does what quick connect does - but for the sake of consistency it has been included

+
    +
  • access: public
  • +
+ +
+ boolean + + quick_connect + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = '']) +
+ +
    +
  • + string + $dbuser: The database user name Default is empty string
  • +
  • + string + $dbpassword: The database users password Default is empty string
  • +
  • + string + $dbname: The name of the database Default is empty string
  • +
+ + +
+ +
+ +
+ select (line 140) +
+ + +

No real equivalent of mySQL select in Oracle, once again, function included for the sake of consistency

+
    +
  • access: public
  • +
+ +
+ boolean + + select + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = '']) +
+ +
    +
  • + string + $dbuser: The database user name Default is empty string
  • +
  • + string + $dbpassword: The database users password Default is empty string
  • +
  • + string + $dbname: The name of the database Default is empty string
  • +
+ + +
+ +
+ +
+ sysdate (line 183) +
+ + +

Return Oracle specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()

+
    +
  • access: public
  • +
+ +
+ string + + sysdate + + () +
+ + + +
+

Inherited Methods

+ + +

Inherited From ezSQLcore

+
+ ezSQLcore::__construct()
+ ezSQLcore::debug()
+ ezSQLcore::donation()
+ ezSQLcore::dumpvar()
+ ezSQLcore::flush()
+ ezSQLcore::get_cache()
+ ezSQLcore::get_col()
+ ezSQLcore::get_col_info()
+ ezSQLcore::get_results()
+ ezSQLcore::get_row()
+ ezSQLcore::get_set()
+ ezSQLcore::get_var()
+ ezSQLcore::hide_errors()
+ ezSQLcore::register_error()
+ ezSQLcore::show_errors()
+ ezSQLcore::store_cache()
+ ezSQLcore::timer_elapsed()
+ ezSQLcore::timer_get_cur()
+ ezSQLcore::timer_start()
+ ezSQLcore::timer_update_global()
+ ezSQLcore::vardump()
+
+ +
+
+ + +
+
Class Constants
+ +
+

Inherited Constants

+ +

Inherited from ezSQLcore

+
+ + ezSQLcore::ARRAY_A
+
+ + ezSQLcore::ARRAY_N
+
+ + ezSQLcore::EZSQL_VERSION
+
+ + ezSQLcore::OBJECT
+
+
+ +
+
+ +

+ Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/ezSQL_pdo.html b/_Documentation/phpDocumentator/ezSQL/ezSQL_pdo.html new file mode 100644 index 00000000..a4a92f82 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/ezSQL_pdo.html @@ -0,0 +1,567 @@ + + + + + + Docs For Class ezSQL_pdo + + + + +
+

Class ezSQL_pdo

+ + +
+
Description
+ +
+ +

ezSQL class - PDO Desc..: PDO component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting (mail@stefanie-stoelting.de)
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_pdo
  • +
  • license: FREE
  • +
+

+ Located in /pdo/ez_sql_pdo.php (line 14) +

+ + +
ezSQLcore
+   |
+   --ezSQL_pdo
+ +
+
+ + + + + +
+
Method Summary
+ +
+
+ +
+ ezSQL_pdo + __construct + ([string $dsn = ''], [string $user = ''], [string $password = '']) +
+
+ string + catch_error + () +
+
+ boolean + connect + ([string $dsn = ''], [string $user = ''], [string $password = '']) +
+
+ void + disconnect + () +
+
+ string + escape + (string $str) +
+
+ object + query + (type $query) +
+
+ boolean + quick_connect + ([string $dsn = ''], [string $user = ''], [string $password = '']) +
+
+ boolean + select + ([string $dsn = ''], [string $user = ''], [string $password = '']) +
+
+ string + sysdate + () +
+
+
+
+ + + + + +
+
Methods
+ +
+ + + +
+ +
+ Constructor __construct (line 54) +
+ + +

Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_sqlite class

+
    +
  • access: public
  • +
+ +
+ ezSQL_pdo + + __construct + + ([string $dsn = ''], [string $user = ''], [string $password = '']) +
+ +
    +
  • + string + $dsn: The connection parameter string Default is empty string
  • +
  • + string + $user: The database user name Default is empty string
  • +
  • + string + $password: The database password Default is empty string
  • +
+ +
+
Redefinition of:
+
+
ezSQLcore::__construct()
+
Constructor of ezSQL
+
+ +
+ +
+ +
+ catch_error (line 182) +
+ + +

Hooks into PDO error system and reports it to user

+
    +
  • access: public
  • +
+ +
+ string + + catch_error + + () +
+ + + +
+ +
+ +
+ connect (line 83) +
+ + +

Try to connect to the database server in the DSN parameters

+
    +
  • access: public
  • +
+ +
+ boolean + + connect + + ([string $dsn = ''], [string $user = ''], [string $password = '']) +
+ +
    +
  • + string + $dsn: The connection parameter string Default is empty string
  • +
  • + string + $user: The database user name Default is empty string
  • +
  • + string + $password: The database password Default is empty string
  • +
+ + +
+ +
+ +
+ disconnect (line 333) +
+ + +

Close the database connection

+
    +
  • access: public
  • +
+ +
+ void + + disconnect + + () +
+ + + +
+ +
+ +
+ escape (line 155) +
+ + +

Escape a string with the PDO method

+
    +
  • access: public
  • +
+ +
+ string + + escape + + (string $str) +
+ +
    +
  • + string + $str
  • +
+ + +
+ +
+ +
+ query (line 211) +
+ + +

Basic Query - see docs for more detail

+
    +
  • access: public
  • +
+ +
+ object + + query + + (type $query) +
+ +
    +
  • + type + $query
  • +
+ + +
+ +
+ +
+ quick_connect (line 120) +
+ + +

With PDO it is only an alias for the connect method

+
    +
  • access: public
  • +
+ +
+ boolean + + quick_connect + + ([string $dsn = ''], [string $user = ''], [string $password = '']) +
+ +
    +
  • + string + $dsn: The connection parameter string Default is empty string
  • +
  • + string + $user: The database user name Default is empty string
  • +
  • + string + $password: The database password Default is empty string
  • +
+ + +
+ +
+ +
+ select (line 140) +
+ + +

With PDO it is only an alias for the connect method

+
    +
  • access: public
  • +
+ +
+ boolean + + select + + ([string $dsn = ''], [string $user = ''], [string $password = '']) +
+ +
    +
  • + string + $dsn: The connection parameter string Default is empty string
  • +
  • + string + $user: The database user name Default is empty string
  • +
  • + string + $password: The database password Default is empty string
  • +
+ + +
+ +
+ +
+ sysdate (line 173) +
+ + +

Return SQLite specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()

+
    +
  • access: public
  • +
+ +
+ string + + sysdate + + () +
+ + + +
+

Inherited Methods

+ + +

Inherited From ezSQLcore

+
+ ezSQLcore::__construct()
+ ezSQLcore::debug()
+ ezSQLcore::donation()
+ ezSQLcore::dumpvar()
+ ezSQLcore::flush()
+ ezSQLcore::get_cache()
+ ezSQLcore::get_col()
+ ezSQLcore::get_col_info()
+ ezSQLcore::get_results()
+ ezSQLcore::get_row()
+ ezSQLcore::get_set()
+ ezSQLcore::get_var()
+ ezSQLcore::hide_errors()
+ ezSQLcore::register_error()
+ ezSQLcore::show_errors()
+ ezSQLcore::store_cache()
+ ezSQLcore::timer_elapsed()
+ ezSQLcore::timer_get_cur()
+ ezSQLcore::timer_start()
+ ezSQLcore::timer_update_global()
+ ezSQLcore::vardump()
+
+ +
+
+ + +
+
Class Constants
+ +
+

Inherited Constants

+ +

Inherited from ezSQLcore

+
+ + ezSQLcore::ARRAY_A
+
+ + ezSQLcore::ARRAY_N
+
+ + ezSQLcore::EZSQL_VERSION
+
+ + ezSQLcore::OBJECT
+
+
+ +
+
+ +

+ Documentation generated on Sun, 01 Apr 2012 23:51:55 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/ezSQL_postgresql.html b/_Documentation/phpDocumentator/ezSQL/ezSQL_postgresql.html new file mode 100644 index 00000000..1fde7796 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/ezSQL_postgresql.html @@ -0,0 +1,710 @@ + + + + + + Docs For Class ezSQL_postgresql + + + + +
+

Class ezSQL_postgresql

+ + +
+
Description
+ +
+ +

ezSQL Database specific class - PostgreSQL Desc..: PostgreSQL component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting (mail@stefanie-stoelting.de)
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_postgresql
  • +
  • license: FREE
  • +
+

+ Located in /postgresql/ez_sql_postgresql.php (line 14) +

+ + +
ezSQLcore
+   |
+   --ezSQL_postgresql
+ +
+
+ + + + + +
+
Method Summary
+ +
+
+ +
+ ezSQL_postgresql + __construct + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [string $port = '5432']) +
+
+ boolean + connect + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [string $port = '5432']) +
+
+ string + descTable + (string $tbl_name) +
+
+ void + disconnect + () +
+
+ string + escape + (string $str) +
+
+ string + getDBHost + () +
+
+ string + getPort + () +
+
+ boolean + query + (string $query) +
+
+ boolean + quick_connect + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [string $port = '5432']) +
+
+ boolean + select + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [string $port = '5432']) +
+
+ string + showDatabases + () +
+
+ string + showTables + () +
+
+ string + sysdate + () +
+
+
+
+ + + + + +
+
Methods
+ +
+ + + +
+ +
+ Constructor __construct (line 71) +
+ + +

Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_postgresql class

+
    +
  • access: public
  • +
+ +
+ ezSQL_postgresql + + __construct + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [string $port = '5432']) +
+ +
    +
  • + string + $dbuser: The database user name
  • +
  • + string + $dbpassword: The database users password
  • +
  • + string + $dbname: The name of the database
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
  • + string + $port: The database TCP/IP port Default is PostgreSQL default port 5432
  • +
+ +
+
Redefinition of:
+
+
ezSQLcore::__construct()
+
Constructor of ezSQL
+
+ +
+ +
+ +
+ connect (line 126) +
+ + +

Try to connect to PostgreSQL database server

+
    +
  • access: public
  • +
+ +
+ boolean + + connect + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [string $port = '5432']) +
+ +
    +
  • + string + $dbuser: The database user name
  • +
  • + string + $dbpassword: The database users password
  • +
  • + string + $dbname: The name of the database
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
  • + string + $port: The database TCP/IP port Default is PostgreSQL default port 5432
  • +
+ + +
+ +
+ +
+ descTable (line 208) +
+ + +

Return the description of the given table

+
    +
  • access: public
  • +
+ +
+ string + + descTable + + (string $tbl_name) +
+ +
    +
  • + string + $tbl_name: The table name
  • +
+ + +
+ +
+ +
+ disconnect (line 336) +
+ + +

Close the database connection

+
    +
  • access: public
  • +
+ +
+ void + + disconnect + + () +
+ + + +
+ +
+ +
+ escape (line 178) +
+ + +

Format a mySQL string correctly for safe mySQL insert (no matter if magic quotes are on or not)

+
    +
  • access: public
  • +
+ +
+ string + + escape + + (string $str) +
+ +
    +
  • + string + $str
  • +
+ + +
+ +
+ +
+ getDBHost (line 347) +
+ + +

Returns the current database server host

+
    +
  • access: public
  • +
+ +
+ string + + getDBHost + + () +
+ + + +
+ +
+ +
+ getPort (line 356) +
+ + +

Returns the current TCP/IP port

+
    +
  • access: public
  • +
+ +
+ string + + getPort + + () +
+ + + +
+ +
+ +
+ query (line 227) +
+ + +

Perform PostgreSQL query and try to detirmin result value

+
    +
  • access: public
  • +
+ +
+ boolean + + query + + (string $query) +
+ +
    +
  • + string + $query
  • +
+ + +
+ +
+ +
+ quick_connect (line 102) +
+ + +

In the case of PostgreSQL quick_connect is not really needed because std.

+

connect already does what quick connect does - but for the sake of consistency it has been included

+ +
+ boolean + + quick_connect + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [string $port = '5432']) +
+ +
    +
  • + string + $dbuser: The database user name
  • +
  • + string + $dbpassword: The database users password
  • +
  • + string + $dbname: The name of the database
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
  • + string + $port: The database TCP/IP port Default is PostgreSQL default port 5432
  • +
+ + +
+ +
+ +
+ select (line 163) +
+ + +

No real equivalent of mySQL select in PostgreSQL once again, function included for the sake of consistency

+
    +
  • access: public
  • +
+ +
+ boolean + + select + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [string $port = '5432']) +
+ +
    +
  • + string + $dbuser: The database user name
  • +
  • + string + $dbpassword: The database users password
  • +
  • + string + $dbname: The name of the database
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
  • + string + $port: The database TCP/IP port Default is PostgreSQL default port 5432
  • +
+ + +
+ +
+ +
+ showDatabases (line 217) +
+ + +

Return all databases of the current server

+
    +
  • access: public
  • +
+ +
+ string + + showDatabases + + () +
+ + + +
+ +
+ +
+ showTables (line 198) +
+ + +

Return PostgreSQL specific values: Return all tables of the current schema

+
    +
  • access: public
  • +
+ +
+ string + + showTables + + () +
+ + + +
+ +
+ +
+ sysdate (line 188) +
+ + +

Return PostgreSQL specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()

+
    +
  • access: public
  • +
+ +
+ string + + sysdate + + () +
+ + + +
+

Inherited Methods

+ + +

Inherited From ezSQLcore

+
+ ezSQLcore::__construct()
+ ezSQLcore::debug()
+ ezSQLcore::donation()
+ ezSQLcore::dumpvar()
+ ezSQLcore::flush()
+ ezSQLcore::get_cache()
+ ezSQLcore::get_col()
+ ezSQLcore::get_col_info()
+ ezSQLcore::get_results()
+ ezSQLcore::get_row()
+ ezSQLcore::get_set()
+ ezSQLcore::get_var()
+ ezSQLcore::hide_errors()
+ ezSQLcore::register_error()
+ ezSQLcore::show_errors()
+ ezSQLcore::store_cache()
+ ezSQLcore::timer_elapsed()
+ ezSQLcore::timer_get_cur()
+ ezSQLcore::timer_start()
+ ezSQLcore::timer_update_global()
+ ezSQLcore::vardump()
+
+ +
+
+ + +
+
Class Constants
+ +
+

Inherited Constants

+ +

Inherited from ezSQLcore

+
+ + ezSQLcore::ARRAY_A
+
+ + ezSQLcore::ARRAY_N
+
+ + ezSQLcore::EZSQL_VERSION
+
+ + ezSQLcore::OBJECT
+
+
+ +
+
+ +

+ Documentation generated on Sun, 01 Apr 2012 23:51:55 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/ezSQL_sqlite.html b/_Documentation/phpDocumentator/ezSQL/ezSQL_sqlite.html new file mode 100644 index 00000000..346b8f6c --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/ezSQL_sqlite.html @@ -0,0 +1,527 @@ + + + + + + Docs For Class ezSQL_sqlite + + + + +
+

Class ezSQL_sqlite

+ + +
+
Description
+ +
+ +

ezSQL class - SQLite Desc..: SQLite component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting (mail@stefanie-stoelting.de)
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_sqlite
  • +
  • license: FREE
  • +
+

+ Located in /sqlite/ez_sql_sqlite.php (line 14) +

+ + +
ezSQLcore
+   |
+   --ezSQL_sqlite
+ +
+
+ + + + + +
+
Method Summary
+ +
+
+ +
+ ezSQL_sqlite + __construct + ([string $dbpath = ''], [string $dbname = '']) +
+
+ boolean + connect + ([string $dbpath = ''], [string $dbname = '']) +
+
+ void + disconnect + () +
+
+ string + escape + (string $str) +
+
+ object + query + (string $query) +
+
+ boolean + quick_connect + ([string $dbpath = ''], [string $dbname = '']) +
+
+ boolean + select + ([string $dbpath = ''], [string $dbname = '']) +
+
+ string + sysdate + () +
+
+
+
+ + + + + +
+
Methods
+ +
+ + + +
+ +
+ Constructor __construct (line 34) +
+ + +

Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_sqlite class

+
    +
  • access: public
  • +
+ +
+ ezSQL_sqlite + + __construct + + ([string $dbpath = ''], [string $dbname = '']) +
+ +
    +
  • + string + $dbpath: Path to the SQLite file Default is empty string
  • +
  • + string + $dbname: Name of the database Default is empty string
  • +
+ +
+
Redefinition of:
+
+
ezSQLcore::__construct()
+
Constructor of ezSQL
+
+ +
+ +
+ +
+ connect (line 61) +
+ + +

Try to connect to SQLite database server

+
    +
  • access: public
  • +
+ +
+ boolean + + connect + + ([string $dbpath = ''], [string $dbname = '']) +
+ +
    +
  • + string + $dbpath: Path to the SQLite file Default is empty string
  • +
  • + string + $dbname: Name of the database Default is empty string
  • +
+ + +
+ +
+ +
+ disconnect (line 215) +
+ + +

Close the database connection

+
    +
  • access: public
  • +
+ +
+ void + + disconnect + + () +
+ + + +
+ +
+ +
+ escape (line 115) +
+ + +

Format a SQLite string correctly for safe SQLite insert (no matter if magic quotes are on or not)

+
    +
  • access: public
  • +
+ +
+ string + + escape + + (string $str) +
+ +
    +
  • + string + $str
  • +
+ + +
+ +
+ +
+ query (line 136) +
+ + +

Perform SQLite query and try to detirmin result value Basic Query - see docs for more detail

+
    +
  • access: public
  • +
+ +
+ object + + query + + (string $query) +
+ +
    +
  • + string + $query
  • +
+ + +
+ +
+ +
+ quick_connect (line 90) +
+ + +

In the case of SQLite quick_connect is not really needed because std.

+

connect already does what quick connect does - but for the sake of consistency it has been included

+
    +
  • access: public
  • +
+ +
+ boolean + + quick_connect + + ([string $dbpath = ''], [string $dbname = '']) +
+ +
    +
  • + string + $dbpath: Path to the SQLite file Default is empty string
  • +
  • + string + $dbname: Name of the database Default is empty string
  • +
+ + +
+ +
+ +
+ select (line 104) +
+ + +

No real equivalent of mySQL select in SQLite once again, function included for the sake of consistency

+
    +
  • access: public
  • +
+ +
+ boolean + + select + + ([string $dbpath = ''], [string $dbname = '']) +
+ +
    +
  • + string + $dbpath: Path to the SQLite file Default is empty string
  • +
  • + string + $dbname: Name of the database Default is empty string
  • +
+ + +
+ +
+ +
+ sysdate (line 125) +
+ + +

Return SQLite specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()

+
    +
  • access: public
  • +
+ +
+ string + + sysdate + + () +
+ + + +
+

Inherited Methods

+ + +

Inherited From ezSQLcore

+
+ ezSQLcore::__construct()
+ ezSQLcore::debug()
+ ezSQLcore::donation()
+ ezSQLcore::dumpvar()
+ ezSQLcore::flush()
+ ezSQLcore::get_cache()
+ ezSQLcore::get_col()
+ ezSQLcore::get_col_info()
+ ezSQLcore::get_results()
+ ezSQLcore::get_row()
+ ezSQLcore::get_set()
+ ezSQLcore::get_var()
+ ezSQLcore::hide_errors()
+ ezSQLcore::register_error()
+ ezSQLcore::show_errors()
+ ezSQLcore::store_cache()
+ ezSQLcore::timer_elapsed()
+ ezSQLcore::timer_get_cur()
+ ezSQLcore::timer_start()
+ ezSQLcore::timer_update_global()
+ ezSQLcore::vardump()
+
+ +
+
+ + +
+
Class Constants
+ +
+

Inherited Constants

+ +

Inherited from ezSQLcore

+
+ + ezSQLcore::ARRAY_A
+
+ + ezSQLcore::ARRAY_N
+
+ + ezSQLcore::EZSQL_VERSION
+
+ + ezSQLcore::OBJECT
+
+
+ +
+
+ +

+ Documentation generated on Sun, 01 Apr 2012 23:51:55 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/ezSQL_sybase.html b/_Documentation/phpDocumentator/ezSQL/ezSQL_sybase.html new file mode 100644 index 00000000..72817cb3 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/ezSQL_sybase.html @@ -0,0 +1,606 @@ + + + + + + Docs For Class ezSQL_sybase + + + + +
+

Class ezSQL_sybase

+ + +
+
Description
+ +
+ +

ezSQL class - Sybase ASE Desc..: Sybase ASE component (part of ezSQL database abstraction library) - based on ezSql_mssql library class.

+
    +
  • author: Muhammad Iyas (iyasilias@gmail.com)
  • +
  • author: Stefanie Janine Stoelting (mail@stefanie-stoelting.de)
  • +
  • link:
  • +
  • name: ezSQL_sybase
  • +
  • license: FREE
  • +
+

+ Located in /sybase/ez_sql_sybase.php (line 15) +

+ + +
ezSQLcore
+   |
+   --ezSQL_sybase
+ +
+
+ + + + + +
+
Method Summary
+ +
+
+ +
+ ezSQL_sybase + __construct + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [boolean $convertMySqlToSybaseQuery = true]) +
+
+ boolean + connect + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbhost = 'localhost']) +
+
+ string + ConvertMySqlTosybase + (string $query) +
+
+ void + disconnect + () +
+
+ string + escape + (string $str) +
+
+ string + getDBHost + () +
+
+ object + query + (string $query) +
+
+ boolean + quick_connect + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost']) +
+
+ boolean + select + ([string $dbname = '']) +
+
+ string + sysdate + () +
+
+
+
+ + + + + +
+
Methods
+ +
+ + + +
+ +
+ Constructor __construct (line 79) +
+ + +
    +
  • throws: Exception Requires ntwdblib.dll and ez_sql_core.php
  • +
  • access: public
  • +
+ +
+ ezSQL_sybase + + __construct + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [boolean $convertMySqlToSybaseQuery = true]) +
+ +
    +
  • + string + $dbuser: The database user name Default is empty string
  • +
  • + string + $dbpassword: The database users password Default is empty string
  • +
  • + string + $dbname: The name of the database Default is empty string
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
  • + boolean + $convertMySqlToSybaseQuery: Default is true
  • +
+ +
+
Redefinition of:
+
+
ezSQLcore::__construct()
+
Constructor of ezSQL
+
+ +
+ +
+ +
+ connect (line 130) +
+ + +

Try to connect to sybase database server

+
    +
  • access: public
  • +
+ +
+ boolean + + connect + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbhost = 'localhost']) +
+ +
    +
  • + string + $dbuser: The database user name Default is empty string
  • +
  • + string + $dbpassword: The database users password Default is empty string
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
+ + +
+ +
+ +
+ ConvertMySqlTosybase (line 372) +
+ + +

Convert a Query From MySql Syntax to Sybase syntax Following conversions are made:

  1. The '`' character used for MySql queries is not supported - the + character is removed.

+

2. FROM_UNIXTIME method is not supported. The Function is removed.It is replaced with getDate(). Warning: This logic may not be right. 3. unix_timestamp function is removed. 4. LIMIT keyowrd is replaced with TOP keyword. Warning: Logic not fully tested.

Note: This method is only a small attempt to convert the syntax. There are many aspects which are not covered here. This method doesn't at all guarantee complete conversion. Certain queries will still not work.

+
    +
  • access: public
  • +
+ +
+ string + + ConvertMySqlTosybase + + (string $query) +
+ +
    +
  • + string + $query
  • +
+ + +
+ +
+ +
+ disconnect (line 416) +
+ + +

Close the database connection

+
    +
  • access: public
  • +
+ +
+ void + + disconnect + + () +
+ + + +
+ +
+ +
+ escape (line 192) +
+ + +

Format a sybase string correctly for safe sybase insert

+
    +
  • access: public
  • +
+ +
+ string + + escape + + (string $str) +
+ +
    +
  • + string + $str
  • +
+ + +
+ +
+ +
+ getDBHost (line 427) +
+ + +

Returns the current database server host

+
    +
  • access: public
  • +
+ +
+ string + + getDBHost + + () +
+ + + +
+ +
+ +
+ query (line 235) +
+ + +

Perform sybase query and try to detirmin result value

+
    +
  • access: public
  • +
+ +
+ object + + query + + (string $query) +
+ +
    +
  • + string + $query
  • +
+ + +
+ +
+ +
+ quick_connect (line 111) +
+ + +

Short hand way to connect to sybase database server and select a sybase database at the same time

+
    +
  • access: public
  • +
+ +
+ boolean + + quick_connect + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost']) +
+ +
    +
  • + string + $dbuser: The database user name Default is empty string
  • +
  • + string + $dbpassword: The database users password Default is empty string
  • +
  • + string + $dbname: The name of the database Default is empty string
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
+ + +
+ +
+ +
+ select (line 161) +
+ + +

Try to select a sybase database

+
    +
  • access: public
  • +
+ +
+ boolean + + select + + ([string $dbname = '']) +
+ +
    +
  • + string + $dbname
  • +
+ + +
+ +
+ +
+ sysdate (line 225) +
+ + +

Return sybase specific system date syntax i.e. Oracle: SYSDATE sybase: getDate()

+
    +
  • access: public
  • +
+ +
+ string + + sysdate + + () +
+ + + +
+

Inherited Methods

+ + +

Inherited From ezSQLcore

+
+ ezSQLcore::__construct()
+ ezSQLcore::debug()
+ ezSQLcore::donation()
+ ezSQLcore::dumpvar()
+ ezSQLcore::flush()
+ ezSQLcore::get_cache()
+ ezSQLcore::get_col()
+ ezSQLcore::get_col_info()
+ ezSQLcore::get_results()
+ ezSQLcore::get_row()
+ ezSQLcore::get_set()
+ ezSQLcore::get_var()
+ ezSQLcore::hide_errors()
+ ezSQLcore::register_error()
+ ezSQLcore::show_errors()
+ ezSQLcore::store_cache()
+ ezSQLcore::timer_elapsed()
+ ezSQLcore::timer_get_cur()
+ ezSQLcore::timer_start()
+ ezSQLcore::timer_update_global()
+ ezSQLcore::vardump()
+
+ +
+
+ + +
+
Class Constants
+ +
+

Inherited Constants

+ +

Inherited from ezSQLcore

+
+ + ezSQLcore::ARRAY_A
+
+ + ezSQLcore::ARRAY_N
+
+ + ezSQLcore::EZSQL_VERSION
+
+ + ezSQLcore::OBJECT
+
+
+ +
+
+ +

+ Documentation generated on Sun, 01 Apr 2012 23:51:55 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/ezSQLcore.html b/_Documentation/phpDocumentator/ezSQL/ezSQLcore.html new file mode 100644 index 00000000..42fe22b0 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/ezSQLcore.html @@ -0,0 +1,1688 @@ + + + + + + Docs For Class ezSQLcore + + + + +
+

Class ezSQLcore

+ + +
+
Description
+ +
+ +

ezSQL Core module - database abstraction library to make it very easy to deal with databases. ezSQLcore can not be used by itself (it is designed for use by database specific modules).

+
    +
  • author: Justin Vincent (jv@vip.ie)
  • +
  • author: Stefanie Janine Stoelting (mail@stefanie-stoelting.de)
  • +
  • link: http://justinvincent.com
  • +
  • name: ezSQL
  • +
  • license: FREE
  • +
+

+ Located in /shared/ez_sql_core.php (line 14) +

+ + +

+	
+			
+
+ + +
+
Direct descendents
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ClassDescription
ezSQL_sqlite + ezSQL class - SQLite Desc..: SQLite component (part of ezSQL databse abstraction library) +
ezSQL_sybase + ezSQL class - Sybase ASE Desc..: Sybase ASE component (part of ezSQL database abstraction library) - based on ezSql_mssql library class. +
ezSQL_mssql + ezSQL Database specific class - mssql Microsoft Sql Server component (part of ezSQL databse abstraction library) - based on ezSql_mySql library class. +
ezSQL_mysql + ezSQL Database specific class - mySQL Desc..: mySQL component (part of ezSQL databse abstraction library) +
ezSQL_oracle8_9 + ezSQL Database specific class - Oracle 8 and 9 Desc..: Oracle 8i/9i component (part of ezSQL databse abstraction library) +
ezSQL_pdo + ezSQL class - PDO Desc..: PDO component (part of ezSQL databse abstraction library) +
ezSQL_postgresql + ezSQL Database specific class - PostgreSQL Desc..: PostgreSQL component (part of ezSQL databse abstraction library) +
ezSQL_codeigniter + ezSQL Database specific class - codeigniter Desc..: codeigniter component (part of ezSQL databse abstraction library) +
+
+
+ + +
+
Class Constant Summary
+ +
+
+
+ ARRAY_A = true + +
+
+ ARRAY_N = true + +
+
+ EZSQL_VERSION = '3.0' + +
+
+ OBJECT = true + +
+
+
+
+ + +
+
Variable Summary
+ +
+
+
+ boolean + $cache_dir +
+
+ boolean + $cache_inserts +
+
+ boolean + $cache_queries +
+
+ integer + $cache_timeout +
+
+ array + $captured_errors +
+
+ object Default + $col_info +
+
+ int + $db_connect_time +
+
+ boolean + $debug_all +
+
+ mixed + $debug_called +
+
+ boolean + $debug_echo_is_on +
+
+ boolean + $do_profile +
+
+ object Default + $last_error +
+
+ object Default + $last_query +
+
+ int + $num_queries +
+
+ array + $profile_times +
+
+ boolean + $sql_log_file +
+
+ array + $timers +
+
+ int + $total_query_time +
+
+ boolean + $trace +
+
+ array + $trace_log +
+
+ boolean + $use_disk_cache +
+
+ boolean + $use_trace_log +
+
+ boolean + $vardump_called +
+
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ ezSQLcore + __construct + () +
+
+ string + debug + ([boolean $print_to_screen = true]) +
+
+ string + donation + () +
+
+ string + dumpvar + (variant $mixed) +
+
+ void + flush + () +
+
+ object + get_cache + (object $query) +
+
+ array + get_col + ([object $query = null], [type $x = 0]) +
+
+ type + get_col_info + ([type $info_type = 'name'], [type $col_offset = -1]) +
+
+ array + get_results + ([object $query = null], [boolean $output = self::OBJECT]) +
+
+ type + get_row + ([object $query = null], [bolean $output = self::OBJECT], [int $y = 0]) +
+
+ string + get_set + (array $parms) +
+
+ variant + get_var + ([$query $query = null], [$x $x = 0], [$y $y = 0]) +
+
+ void + hide_errors + () +
+
+ void + register_error + ($err_str $err_str) +
+
+ void + show_errors + () +
+
+ void + store_cache + (object $query, boolean $is_insert) +
+
+ float + timer_elapsed + (string $timer_name) +
+
+ float + timer_get_cur + () +
+
+ void + timer_start + (string $timer_name) +
+
+ void + timer_update_global + (string $timer_name) +
+
+ string + vardump + ([variant $mixed = '']) +
+
+
+
+ + +
+
Variables
+ +
+ +
+ +
+ + boolean + $cache_dir + = false (line 100) + +
+ + +

Using the cache directory

+
    +
  • var: Default is false
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + boolean + $cache_inserts + = false (line 112) + +
+ + +

Insert queries into the cache

+
    +
  • var: Default is false
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + boolean + $cache_queries + = false (line 106) + +
+ + +

Caching queries

+
    +
  • var: Default is false
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + integer + $cache_timeout + = 24 (line 124) + +
+ + +

The cache timeout in hours

+
    +
  • var: Default is 24
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + array + $captured_errors + = array() (line 94) + +
+ + +

Captured errors

+
    +
  • var: Default is empty array
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + object Default + $col_info + = null (line 88) + +
+ + +

The last column info

+
    +
  • var: is null
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + int + $db_connect_time + = 0 (line 142) + +
+ + +

The time it took to establish a connection

+
    +
  • var: Default is 0
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + boolean + $debug_all + = false (line 46) + +
+ + +

same as $trace

+
    +
  • var: Default is false
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + mixed + $debug_called + = false (line 52) + +
+ + +

Debug is called

+
    +
  • public: boolean Default is false
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + boolean + $debug_echo_is_on + = true (line 180) + +
+ + +

== TJH == default now needed for echo of debug function

+

The default for returning errors, turn it of, if you are not interested in seeing your database errors

+
    +
  • var: Default is true
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + boolean + $do_profile + = false (line 166) + +
+ + +

Using profiling

+
    +
  • var: Default is false
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + object Default + $last_error + = null (line 82) + +
+ + +

The last error object

+
    +
  • var: is null
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + object Default + $last_query + = null (line 76) + +
+ + +

The last query object

+
    +
  • var: is null
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + int + $num_queries + = 0 (line 70) + +
+ + +

Number of queries

+
    +
  • var: Default is 0
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + array + $profile_times + = array() (line 172) + +
+ + +

Array for storing profiling times

+
    +
  • var: Default is empty array
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + boolean + $sql_log_file + = false (line 160) + +
+ + +

Use a SQL log file

+
    +
  • var: Default is false
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + array + $timers + = array() (line 130) + +
+ + +

Timers

+
    +
  • var: Default is empty array
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + int + $total_query_time + = 0 (line 136) + +
+ + +

The total query time

+
    +
  • var: Default is 0
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + boolean + $trace + = false (line 40) + +
+ + +

same as $debug_all

+
    +
  • var: Default is false
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + array + $trace_log + = array() (line 148) + +
+ + +

The trace log

+
    +
  • var: Default is empty array
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + boolean + $use_disk_cache + = false (line 118) + +
+ + +

Using disk cache

+
    +
  • var: Default is false
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + boolean + $use_trace_log + = false (line 154) + +
+ + +

Use the trace log

+
    +
  • var: Default is false
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + boolean + $vardump_called + = false (line 58) + +
+ + +

Vardump called

+
    +
  • var: Default is false
  • +
  • access: public
  • +
+ + + + + +
+ +
+
+ + +
+
Methods
+ +
+ + + +
+ +
+ Constructor __construct (line 185) +
+ + +

Constructor of ezSQL

+
    +
  • access: public
  • +
+ +
+ ezSQLcore + + __construct + + () +
+ + + +
+
Redefined in descendants as:
+ +
+ +
+ +
+ debug (line 508) +
+ + +

Displays the last query string that was sent to the database & a table listing results (if there were any).

+

(Abstracted into a seperate files to save server overhead).

+
    +
  • return: The HTML result
  • +
  • access: public
  • +
+ +
+ string + + debug + + ([boolean $print_to_screen = true]) +
+ +
    +
  • + boolean + $print_to_screen: Default is true
  • +
+ + +
+ +
+ +
+ donation (line 598) +
+ + +

Naughty little function to ask for some remuniration!

+
    +
  • return: An HTML string with payment information
  • +
  • access: public
  • +
+ +
+ string + + donation + + () +
+ + + +
+ +
+ +
+ dumpvar (line 496) +
+ + +

An alias for vardump method

+
    +
  • return: Returns HTML result
  • +
  • access: public
  • +
+ +
+ string + + dumpvar + + (variant $mixed) +
+ +
    +
  • + variant + $mixed: Default is empty String
  • +
+ + +
+ +
+ +
+ flush (line 223) +
+ + +

Kill cached query results

+
    +
  • access: public
  • +
+ +
+ void + + flush + + () +
+ + + +
+ +
+ +
+ get_cache (line 423) +
+ + +

Get the query cache of a query

+
    +
  • access: public
  • +
+ +
+ object + + get_cache + + (object $query) +
+ +
    +
  • + object + $query
  • +
+ + +
+ +
+ +
+ get_col (line 300) +
+ + +

Function to get 1 column from the cached result set based in X index see docs for usage and info

+
    +
  • access: public
  • +
+ +
+ array + + get_col + + ([object $query = null], [type $x = 0]) +
+ +
    +
  • + object + $query: Default is null
  • +
  • + type + $x: Default is 0
  • +
+ + +
+ +
+ +
+ get_col_info (line 370) +
+ + +

Function to get column meta data info pertaining to the last query See docs for more info and usage

+
    +
  • access: public
  • +
+ +
+ type + + get_col_info + + ([type $info_type = 'name'], [type $col_offset = -1]) +
+ +
    +
  • + type + $info_type
  • +
  • + type + $col_offset
  • +
+ + +
+ +
+ +
+ get_results (line 326) +
+ + +

Return the the query as a result set - see docs for more details

+
    +
  • access: public
  • +
+ +
+ array + + get_results + + ([object $query = null], [boolean $output = self::OBJECT]) +
+ +
    +
  • + object + $query: Default is null
  • +
  • + boolean + $output: Default is the OBJECT constant
  • +
+ + +
+ +
+ +
+ get_row (line 265) +
+ + +

Get one row from the DB - see docs for more detail

+
    +
  • access: public
  • +
+ +
+ type + + get_row + + ([object $query = null], [bolean $output = self::OBJECT], [int $y = 0]) +
+ +
    +
  • + object + $query: Default is null
  • +
  • + bolean + $output: Default is the OBJECT constant
  • +
  • + int + $y: Default is 0
  • +
+ + +
+ +
+ +
+ get_set (line 675) +
+ + +

Creates a SET nvp sql string from an associative array (and escapes all values)

+

$db_data = array('login'=>'jv','email'=>'jv@vip.ie', 'user_id' => 1, 'created' => 'NOW()');

$db->query("INSERT INTO users SET ".$db->get_set($db_data));

...OR...

$db->query("UPDATE users SET ".$db->get_set($db_data)." WHERE user_id = 1");

Output:

login = 'jv', email = 'jv@vip.ie', user_id = 1, created = NOW()

+
    +
  • access: public
  • +
+ +
+ string + + get_set + + (array $parms) +
+ +
    +
  • + array + $parms
  • +
+ + +
+ +
+ +
+ get_var (line 239) +
+ + +

Get one variable from the DB - see docs for more detail

+
    +
  • return: The value of a variable
  • +
  • access: public
  • +
+ +
+ variant + + get_var + + ([$query $query = null], [$x $x = 0], [$y $y = 0]) +
+ +
    +
  • + $query + $query: object A query object, default is null
  • +
  • + $x + $x: int Default is 0
  • +
  • + $y + $y: int Default is 0
  • +
+ + +
+ +
+ +
+ hide_errors (line 216) +
+ + +

Turn error handling off

+
    +
  • access: public
  • +
+ +
+ void + + hide_errors + + () +
+ + + +
+ +
+ +
+ register_error (line 194) +
+ + +

Print SQL/DB error - over-ridden by specific DB class

+
    +
  • access: public
  • +
+ +
+ void + + register_error + + ($err_str $err_str) +
+ +
    +
  • + $err_str + $err_str: string
  • +
+ + +
+ +
+ +
+ show_errors (line 209) +
+ + +

Turn error handling on, by default error handling is on

+
    +
  • access: public
  • +
+ +
+ void + + show_errors + + () +
+ + + +
+ +
+ +
+ store_cache (line 393) +
+ + +

Store the cache

+
    +
  • access: public
  • +
+ +
+ void + + store_cache + + (object $query, boolean $is_insert) +
+ +
    +
  • + object + $query
  • +
  • + boolean + $is_insert
  • +
+ + +
+ +
+ +
+ timer_elapsed (line 636) +
+ + +

Returns the elapsed time of the given timer by name

+
    +
  • access: public
  • +
+ +
+ float + + timer_elapsed + + (string $timer_name) +
+ +
    +
  • + string + $timer_name
  • +
+ + +
+ +
+ +
+ timer_get_cur (line 616) +
+ + +

Get current time

+
    +
  • access: public
  • +
+ +
+ float + + timer_get_cur + + () +
+ + + +
+ +
+ +
+ timer_start (line 626) +
+ + +

Start a timer by name

+
    +
  • access: public
  • +
+ +
+ void + + timer_start + + (string $timer_name) +
+ +
    +
  • + string + $timer_name
  • +
+ + +
+ +
+ +
+ timer_update_global (line 645) +
+ + +

Update the global timer with an existing timer

+
    +
  • access: public
  • +
+ +
+ void + + timer_update_global + + (string $timer_name) +
+ +
    +
  • + string + $timer_name
  • +
+ + +
+ +
+ +
+ vardump (line 456) +
+ + +

Dumps the contents of any input variable to screen in a nicely formatted and easy to understand way - any type: Object, public or Array

+
    +
  • return: Returns HTML result
  • +
  • access: public
  • +
+ +
+ string + + vardump + + ([variant $mixed = '']) +
+ +
    +
  • + variant + $mixed: Default is empty String
  • +
+ + +
+ +
+
+ + +
+
Class Constants
+ +
+ +
+ +
+ + ARRAY_A + = true + (line 29) + +
+ + +

Constant boolean

+ + +
+ +
+ +
+ + ARRAY_N + = true + (line 34) + +
+ + +

Constant boolean

+ + +
+ +
+ +
+ + EZSQL_VERSION + = '3.0' + (line 19) + +
+ + +

Constant string ezSQL version information

+ + +
+ +
+ +
+ + OBJECT + = true + (line 24) + +
+ + +

Constant boolean Object

+ + +
+ +
+
+ +

+ Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/index.html b/_Documentation/phpDocumentator/index.html new file mode 100644 index 00000000..49497d03 --- /dev/null +++ b/_Documentation/phpDocumentator/index.html @@ -0,0 +1,24 @@ + + + + + + Generated Documentation + + + + + + + + + + + <H2>Frame Alert</H2> + <P>This document is designed to be viewed using the frames feature. + If you see this message, you are using a non-frame-capable web client.</P> + + + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/li_default.html b/_Documentation/phpDocumentator/li_default.html new file mode 100644 index 00000000..4243a37e --- /dev/null +++ b/_Documentation/phpDocumentator/li_default.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
default
+ +

phpDocumentor v 1.4.4

+ + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/li_ezSQL.html b/_Documentation/phpDocumentator/li_ezSQL.html new file mode 100644 index 00000000..e22ef72a --- /dev/null +++ b/_Documentation/phpDocumentator/li_ezSQL.html @@ -0,0 +1,50 @@ + + + + + + + + + + +
ezSQL
+ +

phpDocumentor v 1.4.4

+ + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/media/banner.css b/_Documentation/phpDocumentator/media/banner.css new file mode 100644 index 00000000..f2149ebb --- /dev/null +++ b/_Documentation/phpDocumentator/media/banner.css @@ -0,0 +1,32 @@ +body +{ + background-color: #CCCCFF; + margin: 0px; + padding: 0px; +} + +/* Banner (top bar) classes */ + +.banner { } + +.banner-menu +{ + clear: both; + padding: .5em; + border-top: 2px solid #6666AA; +} + +.banner-title +{ + text-align: right; + font-size: 20pt; + font-weight: bold; + margin: .2em; +} + +.package-selector +{ + background-color: #AAAADD; + border: 1px solid black; + color: yellow; +} diff --git a/_Documentation/phpDocumentator/media/stylesheet.css b/_Documentation/phpDocumentator/media/stylesheet.css new file mode 100644 index 00000000..1fc91c19 --- /dev/null +++ b/_Documentation/phpDocumentator/media/stylesheet.css @@ -0,0 +1,144 @@ +a { color: #336699; text-decoration: none; } +a:hover { color: #6699CC; text-decoration: underline; } +a:active { color: #6699CC; text-decoration: underline; } + +body { background : #FFFFFF; } +body, table { font-family: Georgia, Times New Roman, Times, serif; font-size: 10pt } +p, li { line-height: 140% } +a img { border: 0px; } +dd { margin-left: 0px; padding-left: 1em; } + +/* Page layout/boxes */ + +.info-box {} +.info-box-title { margin: 1em 0em 0em 0em; padding: .25em; font-weight: normal; font-size: 14pt; border: 2px solid #999999; background-color: #CCCCFF } +.info-box-body { border: 1px solid #999999; padding: .5em; } +.nav-bar { font-size: 8pt; white-space: nowrap; text-align: right; padding: .2em; margin: 0em 0em 1em 0em; } + +.oddrow { background-color: #F8F8F8; border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em} +.evenrow { border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em} + +.page-body { max-width: 800px; margin: auto; } +.tree dl { margin: 0px } + +/* Index formatting classes */ + +.index-item-body { margin-top: .5em; margin-bottom: .5em} +.index-item-description { margin-top: .25em } +.index-item-details { font-weight: normal; font-style: italic; font-size: 8pt } +.index-letter-section { background-color: #EEEEEE; border: 1px dotted #999999; padding: .5em; margin-bottom: 1em} +.index-letter-title { font-size: 12pt; font-weight: bold } +.index-letter-menu { text-align: center; margin: 1em } +.index-letter { font-size: 12pt } + +/* Docbook classes */ + +.description {} +.short-description { font-weight: bold; color: #666666; } +.tags { padding-left: 0em; margin-left: 3em; color: #666666; list-style-type: square; } +.parameters { padding-left: 0em; margin-left: 3em; font-style: italic; list-style-type: square; } +.redefinitions { font-size: 8pt; padding-left: 0em; margin-left: 2em; } +.package { } +.package-title { font-weight: bold; font-size: 14pt; border-bottom: 1px solid black } +.package-details { font-size: 85%; } +.sub-package { font-weight: bold; font-size: 120% } +.tutorial { border-width: thin; border-color: #0066ff } +.tutorial-nav-box { width: 100%; border: 1px solid #999999; background-color: #F8F8F8; } +.nav-button-disabled { color: #999999; } +.nav-button:active, +.nav-button:focus, +.nav-button:hover { background-color: #DDDDDD; outline: 1px solid #999999; text-decoration: none } +.folder-title { font-style: italic } + +/* Generic formatting */ + +.field { font-weight: bold; } +.detail { font-size: 8pt; } +.notes { font-style: italic; font-size: 8pt; } +.separator { background-color: #999999; height: 2px; } +.warning { color: #FF6600; } +.disabled { font-style: italic; color: #999999; } + +/* Code elements */ + +.line-number { } + +.class-table { width: 100%; } +.class-table-header { border-bottom: 1px dotted #666666; text-align: left} +.class-name { color: #000000; font-weight: bold; } + +.method-summary { padding-left: 1em; font-size: 8pt } +.method-header { } +.method-definition { margin-bottom: .3em } +.method-title { font-weight: bold; } +.method-name { font-weight: bold; } +.method-signature { font-size: 85%; color: #666666; margin: .5em 0em } +.method-result { font-style: italic; } + +.var-summary { padding-left: 1em; font-size: 8pt; } +.var-header { } +.var-title { margin-bottom: .3em } +.var-type { font-style: italic; } +.var-name { font-weight: bold; } +.var-default {} +.var-description { font-weight: normal; color: #000000; } + +.include-title { } +.include-type { font-style: italic; } +.include-name { font-weight: bold; } + +.const-title { } +.const-name { font-weight: bold; } + +/* Syntax highlighting */ + +.src-code { border: 1px solid #336699; padding: 1em; background-color: #EEEEEE; } +.src-line { font-family: 'Courier New', Courier, monospace; font-weight: normal; } + +.src-comm { color: green; } +.src-id { } +.src-inc { color: #0000FF; } +.src-key { color: #0000FF; } +.src-num { color: #CC0000; } +.src-str { color: #66cccc; } +.src-sym { font-weight: bold; } +.src-var { } + +.src-php { font-weight: bold; } + +.src-doc { color: #009999 } +.src-doc-close-template { color: #0000FF } +.src-doc-coretag { color: #0099FF; font-weight: bold } +.src-doc-inlinetag { color: #0099FF } +.src-doc-internal { color: #6699cc } +.src-doc-tag { color: #0080CC } +.src-doc-template { color: #0000FF } +.src-doc-type { font-style: italic } +.src-doc-var { font-style: italic } + +.tute-tag { color: #009999 } +.tute-attribute-name { color: #0000FF } +.tute-attribute-value { color: #0099FF } +.tute-entity { font-weight: bold; } +.tute-comment { font-style: italic } +.tute-inline-tag { color: #636311; font-weight: bold } + +/* tutorial */ + +.authors { } +.author { font-style: italic; font-weight: bold } +.author-blurb { margin: .5em 0em .5em 2em; font-size: 85%; font-weight: normal; font-style: normal } +.example { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; } +*[class="example"] { line-height : 0.5em } +.listing { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; white-space: nowrap; } +*[class="listing"] { line-height : 0.5em } +.release-info { font-size: 85%; font-style: italic; margin: 1em 0em } +.ref-title-box { } +.ref-title { } +.ref-purpose { font-style: italic; color: #666666 } +.ref-synopsis { } +.title { font-weight: bold; margin: 1em 0em 0em 0em; padding: .25em; border: 2px solid #999999; background-color: #CCCCFF } +.cmd-synopsis { margin: 1em 0em } +.cmd-title { font-weight: bold } +.toc { margin-left: 2em; padding-left: 0em } + diff --git a/_Documentation/phpDocumentator/packages.html b/_Documentation/phpDocumentator/packages.html new file mode 100644 index 00000000..a8b4cd8e --- /dev/null +++ b/_Documentation/phpDocumentator/packages.html @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + \ No newline at end of file From 2ee4ffa070c1234cdcb1209797cfc848c07bc39a Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Mon, 2 Apr 2012 22:06:10 +0200 Subject: [PATCH 051/126] Added PHPUnit test bodies. This is the initial commit of the unit test files. A call off phpunit to any of these test cases will show, that the count of test cases is the same number as the number of inclomplete tests. --- .../codeigniter/ezSQL_codeigniterTest.php | 57 ++++ _Test/unit_tests/mssql/ezSQL_mssqlTest.php | 134 +++++++++ _Test/unit_tests/mysql/ezSQL_mysqlTest.php | 134 +++++++++ .../oracle8_9/ezSQL_oracle8_9Test.php | 167 ++++++++++++ _Test/unit_tests/pdo/ezSQL_pdoTest.php | 122 +++++++++ .../postgresql/ezSQL_postgresqlTest.php | 167 ++++++++++++ _Test/unit_tests/shared/ezSQLcoreTest.php | 254 ++++++++++++++++++ _Test/unit_tests/sqlite/ezSQL_sqliteTest.php | 112 ++++++++ _Test/unit_tests/sybase/ezSQL_sybaseTest.php | 134 +++++++++ 9 files changed, 1281 insertions(+) create mode 100644 _Test/unit_tests/codeigniter/ezSQL_codeigniterTest.php create mode 100644 _Test/unit_tests/mssql/ezSQL_mssqlTest.php create mode 100644 _Test/unit_tests/mysql/ezSQL_mysqlTest.php create mode 100644 _Test/unit_tests/oracle8_9/ezSQL_oracle8_9Test.php create mode 100644 _Test/unit_tests/pdo/ezSQL_pdoTest.php create mode 100644 _Test/unit_tests/postgresql/ezSQL_postgresqlTest.php create mode 100644 _Test/unit_tests/shared/ezSQLcoreTest.php create mode 100644 _Test/unit_tests/sqlite/ezSQL_sqliteTest.php create mode 100644 _Test/unit_tests/sybase/ezSQL_sybaseTest.php diff --git a/_Test/unit_tests/codeigniter/ezSQL_codeigniterTest.php b/_Test/unit_tests/codeigniter/ezSQL_codeigniterTest.php new file mode 100644 index 00000000..3f9e4f05 --- /dev/null +++ b/_Test/unit_tests/codeigniter/ezSQL_codeigniterTest.php @@ -0,0 +1,57 @@ +object = new ezSQL_codeigniter; + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() { + + } + + /** + * @covers ezSQL_codeigniter::query + * @todo Implement testQuery(). + */ + public function testQuery() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_codeigniter::escape + * @todo Implement testEscape(). + */ + public function testEscape() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + +} + +?> diff --git a/_Test/unit_tests/mssql/ezSQL_mssqlTest.php b/_Test/unit_tests/mssql/ezSQL_mssqlTest.php new file mode 100644 index 00000000..9701523a --- /dev/null +++ b/_Test/unit_tests/mssql/ezSQL_mssqlTest.php @@ -0,0 +1,134 @@ +object = new ezSQL_mssql; + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() { + + } + + /** + * @covers ezSQL_mssql::quick_connect + * @todo Implement testQuick_connect(). + */ + public function testQuick_connect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_mssql::connect + * @todo Implement testConnect(). + */ + public function testConnect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_mssql::select + * @todo Implement testSelect(). + */ + public function testSelect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_mssql::escape + * @todo Implement testEscape(). + */ + public function testEscape() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_mssql::sysdate + * @todo Implement testSysdate(). + */ + public function testSysdate() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_mssql::query + * @todo Implement testQuery(). + */ + public function testQuery() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_mssql::ConvertMySqlToMSSql + * @todo Implement testConvertMySqlToMSSql(). + */ + public function testConvertMySqlToMSSql() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_mssql::disconnect + * @todo Implement testDisconnect(). + */ + public function testDisconnect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_mssql::getDBHost + * @todo Implement testGetDBHost(). + */ + public function testGetDBHost() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + +} + +?> diff --git a/_Test/unit_tests/mysql/ezSQL_mysqlTest.php b/_Test/unit_tests/mysql/ezSQL_mysqlTest.php new file mode 100644 index 00000000..8f0f2cbd --- /dev/null +++ b/_Test/unit_tests/mysql/ezSQL_mysqlTest.php @@ -0,0 +1,134 @@ +object = new ezSQL_mysql; + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() { + + } + + /** + * @covers ezSQL_mysql::quick_connect + * @todo Implement testQuick_connect(). + */ + public function testQuick_connect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_mysql::connect + * @todo Implement testConnect(). + */ + public function testConnect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_mysql::select + * @todo Implement testSelect(). + */ + public function testSelect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_mysql::escape + * @todo Implement testEscape(). + */ + public function testEscape() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_mysql::sysdate + * @todo Implement testSysdate(). + */ + public function testSysdate() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_mysql::query + * @todo Implement testQuery(). + */ + public function testQuery() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_mysql::disconnect + * @todo Implement testDisconnect(). + */ + public function testDisconnect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_mysql::getDBHost + * @todo Implement testGetDBHost(). + */ + public function testGetDBHost() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_mysql::getCharset + * @todo Implement testGetCharset(). + */ + public function testGetCharset() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + +} + +?> diff --git a/_Test/unit_tests/oracle8_9/ezSQL_oracle8_9Test.php b/_Test/unit_tests/oracle8_9/ezSQL_oracle8_9Test.php new file mode 100644 index 00000000..5503e290 --- /dev/null +++ b/_Test/unit_tests/oracle8_9/ezSQL_oracle8_9Test.php @@ -0,0 +1,167 @@ +object = new ezSQL_oracle8_9; + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() { + + } + + /** + * @covers ezSQL_oracle8_9::connect + * @todo Implement testConnect(). + */ + public function testConnect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_oracle8_9::quick_connect + * @todo Implement testQuick_connect(). + */ + public function testQuick_connect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_oracle8_9::select + * @todo Implement testSelect(). + */ + public function testSelect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_oracle8_9::escape + * @todo Implement testEscape(). + */ + public function testEscape() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_oracle8_9::sysdate + * @todo Implement testSysdate(). + */ + public function testSysdate() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_oracle8_9::is_equal_str + * @todo Implement testIs_equal_str(). + */ + public function testIs_equal_str() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_oracle8_9::is_equal_int + * @todo Implement testIs_equal_int(). + */ + public function testIs_equal_int() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_oracle8_9::insert_id + * @todo Implement testInsert_id(). + */ + public function testInsert_id() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_oracle8_9::nextVal + * @todo Implement testNextVal(). + */ + public function testNextVal() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_oracle8_9::query + * @todo Implement testQuery(). + */ + public function testQuery() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_oracle8_9::disconnect + * @todo Implement testDisconnect(). + */ + public function testDisconnect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_oracle8_9::getDBName + * @todo Implement testGetDBName(). + */ + public function testGetDBName() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + +} + +?> diff --git a/_Test/unit_tests/pdo/ezSQL_pdoTest.php b/_Test/unit_tests/pdo/ezSQL_pdoTest.php new file mode 100644 index 00000000..528b4831 --- /dev/null +++ b/_Test/unit_tests/pdo/ezSQL_pdoTest.php @@ -0,0 +1,122 @@ +object = new ezSQL_pdo; + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() { + + } + + /** + * @covers ezSQL_pdo::connect + * @todo Implement testConnect(). + */ + public function testConnect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_pdo::quick_connect + * @todo Implement testQuick_connect(). + */ + public function testQuick_connect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_pdo::select + * @todo Implement testSelect(). + */ + public function testSelect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_pdo::escape + * @todo Implement testEscape(). + */ + public function testEscape() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_pdo::sysdate + * @todo Implement testSysdate(). + */ + public function testSysdate() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_pdo::catch_error + * @todo Implement testCatch_error(). + */ + public function testCatch_error() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_pdo::query + * @todo Implement testQuery(). + */ + public function testQuery() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_pdo::disconnect + * @todo Implement testDisconnect(). + */ + public function testDisconnect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + +} + +?> diff --git a/_Test/unit_tests/postgresql/ezSQL_postgresqlTest.php b/_Test/unit_tests/postgresql/ezSQL_postgresqlTest.php new file mode 100644 index 00000000..efb9eacf --- /dev/null +++ b/_Test/unit_tests/postgresql/ezSQL_postgresqlTest.php @@ -0,0 +1,167 @@ +object = new ezSQL_postgresql; + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() { + + } + + /** + * @covers ezSQL_postgresql::quick_connect + * @todo Implement testQuick_connect(). + */ + public function testQuick_connect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_postgresql::connect + * @todo Implement testConnect(). + */ + public function testConnect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_postgresql::select + * @todo Implement testSelect(). + */ + public function testSelect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_postgresql::escape + * @todo Implement testEscape(). + */ + public function testEscape() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_postgresql::sysdate + * @todo Implement testSysdate(). + */ + public function testSysdate() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_postgresql::showTables + * @todo Implement testShowTables(). + */ + public function testShowTables() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_postgresql::descTable + * @todo Implement testDescTable(). + */ + public function testDescTable() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_postgresql::showDatabases + * @todo Implement testShowDatabases(). + */ + public function testShowDatabases() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_postgresql::query + * @todo Implement testQuery(). + */ + public function testQuery() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_postgresql::disconnect + * @todo Implement testDisconnect(). + */ + public function testDisconnect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_postgresql::getDBHost + * @todo Implement testGetDBHost(). + */ + public function testGetDBHost() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_postgresql::getPort + * @todo Implement testGetPort(). + */ + public function testGetPort() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + +} + +?> diff --git a/_Test/unit_tests/shared/ezSQLcoreTest.php b/_Test/unit_tests/shared/ezSQLcoreTest.php new file mode 100644 index 00000000..38b10cb3 --- /dev/null +++ b/_Test/unit_tests/shared/ezSQLcoreTest.php @@ -0,0 +1,254 @@ +object = new ezSQLcore; + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() { + + } + + /** + * @covers ezSQLcore::register_error + * @todo Implement testRegister_error(). + */ + public function testRegister_error() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQLcore::show_errors + * @todo Implement testShow_errors(). + */ + public function testShow_errors() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQLcore::hide_errors + * @todo Implement testHide_errors(). + */ + public function testHide_errors() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQLcore::flush + * @todo Implement testFlush(). + */ + public function testFlush() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQLcore::get_var + * @todo Implement testGet_var(). + */ + public function testGet_var() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQLcore::get_row + * @todo Implement testGet_row(). + */ + public function testGet_row() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQLcore::get_col + * @todo Implement testGet_col(). + */ + public function testGet_col() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQLcore::get_results + * @todo Implement testGet_results(). + */ + public function testGet_results() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQLcore::get_col_info + * @todo Implement testGet_col_info(). + */ + public function testGet_col_info() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQLcore::store_cache + * @todo Implement testStore_cache(). + */ + public function testStore_cache() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQLcore::get_cache + * @todo Implement testGet_cache(). + */ + public function testGet_cache() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQLcore::vardump + * @todo Implement testVardump(). + */ + public function testVardump() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQLcore::dumpvar + * @todo Implement testDumpvar(). + */ + public function testDumpvar() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQLcore::debug + * @todo Implement testDebug(). + */ + public function testDebug() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQLcore::donation + * @todo Implement testDonation(). + */ + public function testDonation() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQLcore::timer_get_cur + * @todo Implement testTimer_get_cur(). + */ + public function testTimer_get_cur() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQLcore::timer_start + * @todo Implement testTimer_start(). + */ + public function testTimer_start() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQLcore::timer_elapsed + * @todo Implement testTimer_elapsed(). + */ + public function testTimer_elapsed() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQLcore::timer_update_global + * @todo Implement testTimer_update_global(). + */ + public function testTimer_update_global() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQLcore::get_set + * @todo Implement testGet_set(). + */ + public function testGet_set() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + +} + +?> diff --git a/_Test/unit_tests/sqlite/ezSQL_sqliteTest.php b/_Test/unit_tests/sqlite/ezSQL_sqliteTest.php new file mode 100644 index 00000000..87bc0054 --- /dev/null +++ b/_Test/unit_tests/sqlite/ezSQL_sqliteTest.php @@ -0,0 +1,112 @@ +object = new ezSQL_sqlite; + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() { + + } + + /** + * @covers ezSQL_sqlite::connect + * @todo Implement testConnect(). + */ + public function testConnect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_sqlite::quick_connect + * @todo Implement testQuick_connect(). + */ + public function testQuick_connect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_sqlite::select + * @todo Implement testSelect(). + */ + public function testSelect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_sqlite::escape + * @todo Implement testEscape(). + */ + public function testEscape() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_sqlite::sysdate + * @todo Implement testSysdate(). + */ + public function testSysdate() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_sqlite::query + * @todo Implement testQuery(). + */ + public function testQuery() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_sqlite::disconnect + * @todo Implement testDisconnect(). + */ + public function testDisconnect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + +} + +?> diff --git a/_Test/unit_tests/sybase/ezSQL_sybaseTest.php b/_Test/unit_tests/sybase/ezSQL_sybaseTest.php new file mode 100644 index 00000000..dd565a0b --- /dev/null +++ b/_Test/unit_tests/sybase/ezSQL_sybaseTest.php @@ -0,0 +1,134 @@ +object = new ezSQL_sybase; + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() { + + } + + /** + * @covers ezSQL_sybase::quick_connect + * @todo Implement testQuick_connect(). + */ + public function testQuick_connect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_sybase::connect + * @todo Implement testConnect(). + */ + public function testConnect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_sybase::select + * @todo Implement testSelect(). + */ + public function testSelect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_sybase::escape + * @todo Implement testEscape(). + */ + public function testEscape() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_sybase::sysdate + * @todo Implement testSysdate(). + */ + public function testSysdate() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_sybase::query + * @todo Implement testQuery(). + */ + public function testQuery() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_sybase::ConvertMySqlTosybase + * @todo Implement testConvertMySqlTosybase(). + */ + public function testConvertMySqlTosybase() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_sybase::disconnect + * @todo Implement testDisconnect(). + */ + public function testDisconnect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + + /** + * @covers ezSQL_sybase::getDBHost + * @todo Implement testGetDBHost(). + */ + public function testGetDBHost() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } + +} + +?> From 15dd908fd5aa733224367bf95f4c6088181b9fbf Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Mon, 2 Apr 2012 23:35:07 +0200 Subject: [PATCH 052/126] Added public property show_errors --- mysql/ez_sql_mysql.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mysql/ez_sql_mysql.php b/mysql/ez_sql_mysql.php index f682d7f4..5d941902 100755 --- a/mysql/ez_sql_mysql.php +++ b/mysql/ez_sql_mysql.php @@ -56,6 +56,12 @@ class ezSQL_mysql extends ezSQLcore * @var string Default is utf8 */ private $charset = 'utf8'; + + /** + * Show errors + * @var boolean Default is true + */ + public $show_errors = true; /** * Constructor - allow the user to perform a qucik connect at the same time From dd185a2e631359a93dfb6699ed1449fbdae5eabd Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Mon, 2 Apr 2012 23:35:21 +0200 Subject: [PATCH 053/126] Added public property show_errors --- postgresql/ez_sql_postgresql.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/postgresql/ez_sql_postgresql.php b/postgresql/ez_sql_postgresql.php index 1190a8a8..5e92bd0c 100755 --- a/postgresql/ez_sql_postgresql.php +++ b/postgresql/ez_sql_postgresql.php @@ -56,6 +56,12 @@ class ezSQL_postgresql extends ezSQLcore */ private $port = '5432'; + /** + * Show errors + * @var boolean Default is true + */ + public $show_errors = true; + /** * Constructor - allow the user to perform a qucik connect at the same time * as initialising the ezSQL_postgresql class From 6ebe930bc21707e9fd4237db52ef30c91aba3f0e Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Mon, 2 Apr 2012 23:36:02 +0200 Subject: [PATCH 054/126] Added public property show_errors --- mssql/ez_sql_mssql.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mssql/ez_sql_mssql.php b/mssql/ez_sql_mssql.php index 2885a1b3..632b93d4 100755 --- a/mssql/ez_sql_mssql.php +++ b/mssql/ez_sql_mssql.php @@ -50,6 +50,12 @@ class ezSQL_mssql extends ezSQLcore */ private $dbhost; + /** + * Show errors + * @var boolean Default is true + */ + public $show_errors = true; + /** * If we want to convert Queries in MySql syntax to MS-SQL syntax. Yes, * there are some differences in query syntax. From e386a9db024d55c40874d53a3822f593f6b77709 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Mon, 2 Apr 2012 23:36:36 +0200 Subject: [PATCH 055/126] Added public property show_errors --- pdo/ez_sql_pdo.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pdo/ez_sql_pdo.php b/pdo/ez_sql_pdo.php index 6c2405a3..4d3fc5a6 100755 --- a/pdo/ez_sql_pdo.php +++ b/pdo/ez_sql_pdo.php @@ -40,6 +40,12 @@ class ezSQL_pdo extends ezSQLcore */ private $password; + /** + * Show errors + * @var boolean Default is true + */ + public $show_errors = true; + /** * Constructor - allow the user to perform a qucik connect at the same time * as initialising the ezSQL_sqlite class From c03ebe473d2e8e1976927ceaea5c78b63090193c Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Mon, 2 Apr 2012 23:37:08 +0200 Subject: [PATCH 056/126] Added public property show_errors --- sqlite/ez_sql_sqlite.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sqlite/ez_sql_sqlite.php b/sqlite/ez_sql_sqlite.php index f8ae4f71..34836852 100755 --- a/sqlite/ez_sql_sqlite.php +++ b/sqlite/ez_sql_sqlite.php @@ -22,6 +22,12 @@ class ezSQL_sqlite extends ezSQLcore 1 => 'Require $dbpath and $dbname to open an SQLite database' ); + /** + * Show errors + * @var boolean Default is true + */ + public $show_errors = true; + /** * Constructor - allow the user to perform a qucik connect at the same time * as initialising the ezSQL_sqlite class From 404d2bfd31c37ea60c6f10ce817ed20db9e957a6 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Mon, 2 Apr 2012 23:38:07 +0200 Subject: [PATCH 057/126] Added public property show_errors --- sybase/ez_sql_sybase.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sybase/ez_sql_sybase.php b/sybase/ez_sql_sybase.php index 8d93d08c..71ced787 100644 --- a/sybase/ez_sql_sybase.php +++ b/sybase/ez_sql_sybase.php @@ -51,6 +51,12 @@ class ezSQL_sybase extends ezSQLcore */ private $dbhost; + /** + * Show errors + * @var boolean Default is true + */ + public $show_errors = true; + /** * if we want to convert Queries in MySql syntax to Sybase syntax. Yes, * there are some differences in query syntax. From 5a780d0f82448c50dc83d188c213b7451215c42a Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Mon, 2 Apr 2012 23:38:35 +0200 Subject: [PATCH 058/126] Added public property show_errors --- oracle8_9/ez_sql_oracle8_9.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/oracle8_9/ez_sql_oracle8_9.php b/oracle8_9/ez_sql_oracle8_9.php index efb721d6..d3026643 100755 --- a/oracle8_9/ez_sql_oracle8_9.php +++ b/oracle8_9/ez_sql_oracle8_9.php @@ -41,6 +41,12 @@ class ezSQL_oracle8_9 extends ezSQLcore */ private $dbname; + /** + * Show errors + * @var boolean Default is true + */ + public $show_errors = true; + /** * Constructor - allow the user to perform a qucik connect at the same time * as initialising the ezSQL_oracle8_9 class From feb0fbe13a4d18019fbd996dba1ed9646ea5b445 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Mon, 2 Apr 2012 23:40:08 +0200 Subject: [PATCH 059/126] Added public property show_errors --- codeigniter/Ezsql_codeigniter.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/codeigniter/Ezsql_codeigniter.php b/codeigniter/Ezsql_codeigniter.php index 643bb5f4..64e38b69 100755 --- a/codeigniter/Ezsql_codeigniter.php +++ b/codeigniter/Ezsql_codeigniter.php @@ -14,9 +14,18 @@ */ class ezSQL_codeigniter extends ezSQLcore { - + /** + * Run in debug mode + * @var boolean Default is true + */ public $debug = true; + /** + * Show errors + * @var boolean Default is true + */ + public $show_errors = true; + /** * * @throws Exception Requires ez_sql_core.php From 210f723c42797f579f3bf0c47862fdc433084cfb Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Tue, 3 Apr 2012 22:58:58 +0200 Subject: [PATCH 060/126] - Added tear up script for creating a test database and a test user - Added tear down script to remove all test objects --- .../unit_tests/mysql/mysql_test_db_tear_down.sql | 16 ++++++++++++++++ .../unit_tests/mysql/myssql_test_db_tear_up.sql | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 _Test/unit_tests/mysql/mysql_test_db_tear_down.sql create mode 100644 _Test/unit_tests/mysql/myssql_test_db_tear_up.sql diff --git a/_Test/unit_tests/mysql/mysql_test_db_tear_down.sql b/_Test/unit_tests/mysql/mysql_test_db_tear_down.sql new file mode 100644 index 00000000..bb76a654 --- /dev/null +++ b/_Test/unit_tests/mysql/mysql_test_db_tear_down.sql @@ -0,0 +1,16 @@ +/** + * Tear down script to remove all test objects after the test + * + * @author Stefanie Janine Stoelting (mail@stefanie-stoelting.de) + * + * @name ezSQL_mysql_tear_down + * @package ezSQL + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + +*/ + +-- Drop the database +DROP DATABASE ez_test; + +-- Drop the user +DROP USER ezTest; diff --git a/_Test/unit_tests/mysql/myssql_test_db_tear_up.sql b/_Test/unit_tests/mysql/myssql_test_db_tear_up.sql new file mode 100644 index 00000000..6d134851 --- /dev/null +++ b/_Test/unit_tests/mysql/myssql_test_db_tear_up.sql @@ -0,0 +1,16 @@ +/** + * Tear up script for generating database and user for tests + * + * @author Stefanie Janine Stoelting (mail@stefanie-stoelting.de) + * + * @name ezSQL_mysql_tear_up + * @package ezSQL + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + +*/ + +-- Create the database +CREATE DATABASE ez_test charset='utf8'; + +-- Create the user +GRANT ALL PRIVILEGES ON ez_test.* TO ezTest@localhost IDENTIFIED BY 'ezTest'; From 8a563aa17b834c4a215ec1c3c6c5e26c803d259a Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Wed, 4 Apr 2012 06:27:27 +0200 Subject: [PATCH 061/126] A connection is not needed to escape a string, removed that. --- mysql/ez_sql_mysql.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/mysql/ez_sql_mysql.php b/mysql/ez_sql_mysql.php index 5d941902..abd892cb 100755 --- a/mysql/ez_sql_mysql.php +++ b/mysql/ez_sql_mysql.php @@ -193,12 +193,6 @@ public function select($dbname='') { * @return string */ public function escape($str) { - // If there is no existing database connection then try to connect - if ( ! isset($this->dbh) || ! $this->dbh ) { - $this->connect($this->dbuser, $this->dbpassword, $this->dbhost); - $this->select($this->dbname); - } - return mysql_real_escape_string(stripslashes($str)); } // escape From 4cd15ec2914b8814832ac2a153cc51ecd1b5d435 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Wed, 4 Apr 2012 20:03:25 +0200 Subject: [PATCH 062/126] Changed the behavior of the connect method of the ezSQL_mysql class. The connect could not have worked at all without user, password , etc. on the contructor. --- mysql/ez_sql_mysql.php | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/mysql/ez_sql_mysql.php b/mysql/ez_sql_mysql.php index abd892cb..4a55aeac 100755 --- a/mysql/ez_sql_mysql.php +++ b/mysql/ez_sql_mysql.php @@ -126,24 +126,21 @@ public function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='l */ public function connect($dbuser='', $dbpassword='', $dbhost='localhost', $charset='') { $return_val = false; - + + $this->dbuser = empty($dbuser) ? $this->dbuser : $dbuser; + $this->dbpassword = empty($dbpassword) ? $this->dbpassword : $dbpassword; + $this->dbhost = empty($dbhost) ? $this->dbhost : $dbhost; + $this->charset = empty($charset) ? $this->charset : $charset; + // Must have a user and a password - if ( ! $dbuser ) { + if ( empty($this->dbuser) ) { $this->register_error($this->ezsql_mysql_str[1] . ' in ' . __FILE__ . ' on line ' . __LINE__); $this->show_errors ? trigger_error($this->ezsql_mysql_str[1], E_USER_WARNING) : null; - } else if ( ! $this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword, true, 131074) ) { + } else if ( ! $this->dbh = @mysql_connect($this->dbhost, $$this->dbuser, $this->dbpassword, true, 131074) ) { // Try to establish the server database handle $this->register_error($this->ezsql_mysql_str[2] . ' in ' . __FILE__ . ' on line ' . __LINE__); $this->show_errors ? trigger_error($this->ezsql_mysql_str[2], E_USER_WARNING) : null; } else { - $this->dbuser = $dbuser; - $this->dbpassword = $dbpassword; - $this->dbhost = $dbhost; - - if ( ! empty($charset) ) { - $this->charset = $charset; - } - mysql_set_charset($this->charset, $this->dbh); $return_val = true; } From d7ee4237295096e7fa77ecfa8cdce96bf5933cfd Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Wed, 4 Apr 2012 21:32:19 +0200 Subject: [PATCH 063/126] Solved an error with a duplicated $ --- mysql/ez_sql_mysql.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql/ez_sql_mysql.php b/mysql/ez_sql_mysql.php index 4a55aeac..4093e84c 100755 --- a/mysql/ez_sql_mysql.php +++ b/mysql/ez_sql_mysql.php @@ -136,7 +136,7 @@ public function connect($dbuser='', $dbpassword='', $dbhost='localhost', $charse if ( empty($this->dbuser) ) { $this->register_error($this->ezsql_mysql_str[1] . ' in ' . __FILE__ . ' on line ' . __LINE__); $this->show_errors ? trigger_error($this->ezsql_mysql_str[1], E_USER_WARNING) : null; - } else if ( ! $this->dbh = @mysql_connect($this->dbhost, $$this->dbuser, $this->dbpassword, true, 131074) ) { + } else if ( ! $this->dbh = @mysql_connect($this->dbhost, $this->dbuser, $this->dbpassword, true, 131074) ) { // Try to establish the server database handle $this->register_error($this->ezsql_mysql_str[2] . ' in ' . __FILE__ . ' on line ' . __LINE__); $this->show_errors ? trigger_error($this->ezsql_mysql_str[2], E_USER_WARNING) : null; From af0fb2f9fb9c6fbc25b4f31eefff39bcf8d50ccc Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Thu, 5 Apr 2012 06:14:57 +0200 Subject: [PATCH 064/126] Extended the core class with connection information and a public variable for the database connection, instead of creating the variable in by connecting to a database. --- shared/ez_sql_core.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/shared/ez_sql_core.php b/shared/ez_sql_core.php index 513db36b..741acdf0 100755 --- a/shared/ez_sql_core.php +++ b/shared/ez_sql_core.php @@ -171,6 +171,18 @@ class ezSQLcore */ public $profile_times = array(); + /** + * The database connection object + * @var object Default is null + */ + public $dbh = null; + + /** + * Whether the database connection is established, or not + * @var boolean Default is false + */ + protected $connected = false; + /** * == TJH == default now needed for echo of debug function * The default for returning errors, turn it of, if you are not @@ -693,4 +705,12 @@ public function get_set($parms) { return substr($sql, 0, -2); } // get_set + /** + * Returns, whether a database connection is established, or not + * + * @return boolean + */ + public function isConnected() { + return $this->connected; + } // isConnected } // ezSQLcore \ No newline at end of file From 07ab4e3d3c08d48467d51dfce76d1d06b200891b Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Thu, 5 Apr 2012 06:21:33 +0200 Subject: [PATCH 065/126] Extended the MySQL class with connection information in a property --- mysql/ez_sql_mysql.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/mysql/ez_sql_mysql.php b/mysql/ez_sql_mysql.php index 4093e84c..3396072f 100755 --- a/mysql/ez_sql_mysql.php +++ b/mysql/ez_sql_mysql.php @@ -106,11 +106,10 @@ public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='loc * @return boolean */ public function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') { - $return_val = false; - if ( ! $this->connect($dbuser, $dbpassword, $dbhost,true) ) ; + if ( ! $this->connect($dbuser, $dbpassword, $dbhost, true) ) ; else if ( ! $this->select($dbname) ) ; - else $return_val = true; - return $return_val; + + return $this->connected; } // quick_connect /** @@ -125,7 +124,7 @@ public function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='l * @return boolean */ public function connect($dbuser='', $dbpassword='', $dbhost='localhost', $charset='') { - $return_val = false; + $this->connected = false; $this->dbuser = empty($dbuser) ? $this->dbuser : $dbuser; $this->dbpassword = empty($dbpassword) ? $this->dbpassword : $dbpassword; @@ -142,10 +141,10 @@ public function connect($dbuser='', $dbpassword='', $dbhost='localhost', $charse $this->show_errors ? trigger_error($this->ezsql_mysql_str[2], E_USER_WARNING) : null; } else { mysql_set_charset($this->charset, $this->dbh); - $return_val = true; + $this->connected = true; } - return $return_val; + return $this->connected; } // connect /** @@ -155,7 +154,7 @@ public function connect($dbuser='', $dbpassword='', $dbhost='localhost', $charse * @return boolean */ public function select($dbname='') { - $return_val = false; + $this->connected = false; if ( ! $dbname ) { // Must have a database name @@ -176,10 +175,10 @@ public function select($dbname='') { $this->show_errors ? trigger_error($str, E_USER_WARNING) : null; } else { $this->dbname = $dbname; - $return_val = true; + $this->connected = true; } - return $return_val; + return $this->connected; } // select /** @@ -306,6 +305,8 @@ public function disconnect() { if ( $this->dbh ) { mysql_close($this->dbh); } + + $this->connected = false; } // function /** From 31cf394397c054c91035f596ba01ff433aeefa88 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Thu, 5 Apr 2012 06:25:59 +0200 Subject: [PATCH 066/126] Extended the PostgreSQL class with connection information in a property --- postgresql/ez_sql_postgresql.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/postgresql/ez_sql_postgresql.php b/postgresql/ez_sql_postgresql.php index 5e92bd0c..6eac938c 100755 --- a/postgresql/ez_sql_postgresql.php +++ b/postgresql/ez_sql_postgresql.php @@ -106,11 +106,10 @@ public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='loc * @return boolean */ function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') { - $return_val = false; if ( ! $this->connect($dbuser, $dbpassword, $dbname, $dbhost, $port, true) ) ; - else if ( ! $this->select($dbname) ) ; - else $return_val = true; - return $return_val; + else if ( ! $this->select($dbname) ); + + return $this->connected; } // quick_connect /********************************************************************** @@ -130,7 +129,7 @@ function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhos * @return boolean */ public function connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') { - $return_val = false; + $this->connected = false; if ( ! $dbuser ) { // Must have a user and a password @@ -147,10 +146,10 @@ public function connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localho $this->dbname = $dbname; $this->port = $port; - $return_val = true; + $this->connected = true; } - return $return_val; + return $this->connected; } // connect /** @@ -167,11 +166,10 @@ public function connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localho * @return boolean */ public function select($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') { - $return_val = false; if ( ! $this->connect($dbuser, $dbpassword, $dbname, $dbhost, $port, true) ) ; - else if ( ! $this->select($dbname) ) ; - else $return_val = true; - return $return_val; + else if ( ! $this->select($dbname) ); + + return $this->connected; } // select /** From ac1980ef4afbbd417041a87abd8090f94c87e73c Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Thu, 5 Apr 2012 06:28:02 +0200 Subject: [PATCH 067/126] Extended the MS SQL Server class with connection information in a property --- mssql/ez_sql_mssql.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/mssql/ez_sql_mssql.php b/mssql/ez_sql_mssql.php index 632b93d4..cfc8b983 100755 --- a/mssql/ez_sql_mssql.php +++ b/mssql/ez_sql_mssql.php @@ -107,11 +107,10 @@ public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='loc * @return boolean */ public function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') { - $return_val = false; if ( ! $this->connect($dbuser, $dbpassword, $dbhost,true) ) ; - else if ( ! $this->select($dbname) ) ; - else $return_val = true; - return $return_val; + else if ( ! $this->select($dbname) ); + + return $this->connected; } // quick_connect /** @@ -124,7 +123,7 @@ public function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='l * @return boolean */ public function connect($dbuser='', $dbpassword='', $dbhost='localhost') { - $return_val = false; + $this->connected = false; // Must have a user and a password if ( ! $dbuser ) @@ -139,7 +138,7 @@ public function connect($dbuser='', $dbpassword='', $dbhost='localhost') { $this->dbuser = $dbuser; $this->dbpassword = $dbpassword; $this->dbhost = $dbhost; - $return_val = true; + $this->connected = true; } return $return_val; @@ -170,10 +169,10 @@ public function select($dbname='') { $this->show_errors ? trigger_error($str, E_USER_WARNING) : null; } else { $this->dbname = $dbname; - $return_val = true; + $this->connected = true; } - return $return_val; + return $this->connected; } // select /** From 40fd9b0519157b5bf92633ae6150ca994b7a4a7a Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Thu, 5 Apr 2012 06:31:39 +0200 Subject: [PATCH 068/126] Extended the PDO class with connection information in a property --- pdo/ez_sql_pdo.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pdo/ez_sql_pdo.php b/pdo/ez_sql_pdo.php index 4d3fc5a6..59203e51 100755 --- a/pdo/ez_sql_pdo.php +++ b/pdo/ez_sql_pdo.php @@ -87,7 +87,7 @@ public function __construct($dsn='', $user='', $password='') { * @return boolean */ public function connect($dsn='', $user='', $password='') { - $return_val = false; + $this->connected = false; // Must have a user and a password if ( ! $dsn || ! $user || ! $password ) { @@ -98,18 +98,16 @@ public function connect($dsn='', $user='', $password='') { // Establish PDO connection try { $this->dbh = new PDO($dsn, $user, $password); - $return_val = true; + $this->connected = true; } catch (PDOException $e) { $this->register_error($e->getMessage()); $this->show_errors ? trigger_error($e->getMessage(), E_USER_WARNING) : null; } - if ( $return_val ) { - // Set information about an established database connection - $this->isConnected = true; - } - return $return_val; + $this->isConnected = $this->connected; + + return $this->connected; } // connect /** @@ -337,7 +335,10 @@ public function query($query) { * Close the database connection */ public function disconnect(){ - $this->dbh = null; + if ($this->dbh) { + $this->dbh = null; + $this->connected = false; + } } // disconnect } // ezSQL_pdo From b4e5d6398e2b47396a72f5939a735a54d4458fb8 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Thu, 5 Apr 2012 06:33:33 +0200 Subject: [PATCH 069/126] On disconnect the connection property has to be set to false, corrected this in the classes MySQL, PostgreSQL, MS SQL Server --- mssql/ez_sql_mssql.php | 1 + mysql/ez_sql_mysql.php | 1 + postgresql/ez_sql_postgresql.php | 1 + 3 files changed, 3 insertions(+) diff --git a/mssql/ez_sql_mssql.php b/mssql/ez_sql_mssql.php index cfc8b983..b982ed25 100755 --- a/mssql/ez_sql_mssql.php +++ b/mssql/ez_sql_mssql.php @@ -409,6 +409,7 @@ public function ConvertMySqlToMSSql($query) { public function disconnect() { if ( $this->dbh ) { $this->dbh = null; + $this->connected = false; } } // disconnect diff --git a/mysql/ez_sql_mysql.php b/mysql/ez_sql_mysql.php index 3396072f..41a6a671 100755 --- a/mysql/ez_sql_mysql.php +++ b/mysql/ez_sql_mysql.php @@ -304,6 +304,7 @@ public function query($query) { public function disconnect() { if ( $this->dbh ) { mysql_close($this->dbh); + $this->connected = false; } $this->connected = false; diff --git a/postgresql/ez_sql_postgresql.php b/postgresql/ez_sql_postgresql.php index 6eac938c..ca129a8a 100755 --- a/postgresql/ez_sql_postgresql.php +++ b/postgresql/ez_sql_postgresql.php @@ -340,6 +340,7 @@ public function query($query) { public function disconnect() { if ( $this->dbh ) { pg_close($this->dbh); + $this->connected = false; } } // disconnect From 351d9a216d758ae4d479cfe766910ef2c79d1482 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Thu, 5 Apr 2012 06:40:37 +0200 Subject: [PATCH 070/126] Extended the SQLite class with connection information in a property --- sqlite/ez_sql_sqlite.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sqlite/ez_sql_sqlite.php b/sqlite/ez_sql_sqlite.php index 34836852..6faca942 100755 --- a/sqlite/ez_sql_sqlite.php +++ b/sqlite/ez_sql_sqlite.php @@ -65,7 +65,7 @@ public function __construct($dbpath='', $dbname='') { * @return boolean */ public function connect($dbpath='', $dbname='') { - $return_val = false; + $this->connected = false; // Must have a user and a password if ( ! $dbpath || ! $dbname ) { @@ -75,11 +75,11 @@ public function connect($dbpath='', $dbname='') { // Try to establish the server database handle $this->register_error($php_errormsg); $this->show_errors ? trigger_error($php_errormsg, E_USER_WARNING) : null; + } else { + $this->connected = true; } - else - $return_val = true; - return $return_val; + return $this->connected; } // connect /** @@ -219,7 +219,10 @@ public function query($query) { * Close the database connection */ public function disconnect(){ - $this->dbh = null; + if ($this->dbh) { + $this->dbh = null; + $this->connected = false; + } } // disconnect } // ezSQL_sqlite \ No newline at end of file From 1ae64d5078fb61d353d90fa0dcc1be04f1390aa6 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Thu, 5 Apr 2012 06:42:32 +0200 Subject: [PATCH 071/126] Extended the Sybase ASE class with connection information in a property --- sybase/ez_sql_sybase.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sybase/ez_sql_sybase.php b/sybase/ez_sql_sybase.php index 71ced787..cd54fb33 100644 --- a/sybase/ez_sql_sybase.php +++ b/sybase/ez_sql_sybase.php @@ -115,11 +115,10 @@ public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='loc * @return boolean */ public function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') { - $return_val = false; if ( ! $this->connect($dbuser, $dbpassword, $dbhost,true) ) ; else if ( ! $this->select($dbname) ) ; - else $return_val = true; - return $return_val; + + return $this->connected; } // quick_connect /** @@ -134,7 +133,7 @@ public function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='l * @return boolean */ public function connect($dbuser='', $dbpassword='', $dbhost='localhost') { - $return_val = false; + $this->connected = false; // Must have a user and a password if ( ! $dbuser ) { @@ -148,10 +147,10 @@ public function connect($dbuser='', $dbpassword='', $dbhost='localhost') { $this->dbuser = $dbuser; $this->dbpassword = $dbpassword; $this->dbhost = $dbhost; - $return_val = true; + $this->connected = true; } - return $return_val; + return $this->connected; } // connect /********************************************************************** @@ -165,7 +164,7 @@ public function connect($dbuser='', $dbpassword='', $dbhost='localhost') { * @return boolean */ public function select($dbname='') { - $return_val = false; + $this->connected = false; // Must have a database name if ( ! $dbname ) { @@ -183,10 +182,10 @@ public function select($dbname='') { $this->show_errors ? trigger_error($str, E_USER_WARNING) : null; } else { $this->dbname = $dbname; - $return_val = true; + $this->connected = true; } - return $return_val; + return $this->connected; } // select /** @@ -422,6 +421,7 @@ public function ConvertMySqlTosybase($query) { public function disconnect() { if ( $this->dbh ) { $this->dbh = null; + $this->connected = false; } } // disconnect From 743cc8e2e0ad46c4c056fbd59ad9f846e9f76cb0 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Thu, 5 Apr 2012 06:43:50 +0200 Subject: [PATCH 072/126] Extended the Oracle 8/9 class with connection information in a property --- oracle8_9/ez_sql_oracle8_9.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/oracle8_9/ez_sql_oracle8_9.php b/oracle8_9/ez_sql_oracle8_9.php index d3026643..7a59c7b4 100755 --- a/oracle8_9/ez_sql_oracle8_9.php +++ b/oracle8_9/ez_sql_oracle8_9.php @@ -90,7 +90,7 @@ public function __construct($dbuser='', $dbpassword='', $dbname='') { * @return boolean */ public function connect($dbuser='', $dbpassword='', $dbname='') { - $return_val = false; + $this->connected = false; // Must have a user and a password if ( ! $dbuser || ! $dbpassword || ! $dbname ) { @@ -102,16 +102,14 @@ public function connect($dbuser='', $dbpassword='', $dbname='') { { $this->register_error($php_errormsg); $this->show_errors ? trigger_error($php_errormsg,E_USER_WARNING) : null; - } - else - { + } else { $this->dbuser = $dbuser; $this->dbpassword = $dbpassword; $this->dbname = $dbname; - $return_val = true; + $this->connected = true; } - return $return_val; + return $this->connected; } /** @@ -349,6 +347,7 @@ public function query($query) { public function disconnect() { if ( $this->dbh ) { $this->dbh = null; + $this->connected = false; } } // disconnect From bc03b76c7b54abcda333996aaa4928e4c075aea9 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Thu, 5 Apr 2012 19:58:35 +0200 Subject: [PATCH 073/126] Finished unit tests on MySQL class and corrected failures in that class, to pass all unit tests. --- _Test/unit_tests/mysql/ezSQL_mysqlTest.php | 167 +++++++++++++-------- mysql/ez_sql_mysql.php | 4 +- 2 files changed, 106 insertions(+), 65 deletions(-) diff --git a/_Test/unit_tests/mysql/ezSQL_mysqlTest.php b/_Test/unit_tests/mysql/ezSQL_mysqlTest.php index 8f0f2cbd..2ea78c75 100644 --- a/_Test/unit_tests/mysql/ezSQL_mysqlTest.php +++ b/_Test/unit_tests/mysql/ezSQL_mysqlTest.php @@ -5,10 +5,47 @@ /** * Test class for ezSQL_mysql. - * Generated by PHPUnit on 2012-04-02 at 00:22:16. + * Generated by PHPUnit + * + * Needs database tear up to run test, that creates database and a user with + * appropriate rights. + * Run database tear down after tests to get rid of the database and the user. + * + * @author Stefanie Janine Stoelting (mail@stefanie-stoelting.de) + * @name ezSQL_mysql_tear_up + * @uses mysql_test_db_tear_up.sql + * @uses mysql_test_db_tear_down.sql + * @package ezSQL + * @subpackage unitTests + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) */ class ezSQL_mysqlTest extends PHPUnit_Framework_TestCase { + /** + * constant string user name + */ + const TEST_DB_USER = 'ezTest'; + + /** + * constant string password + */ + const TEST_DB_PASSWORD = 'ezTest'; + + /** + * constant database name + */ + const TEST_DB_NAME = 'ez_test'; + + /** + * constant database host + */ + const TEST_DB_HOST = 'localhost'; + + /** + * constant database connection charset + */ + const TEST_DB_CHARSET = 'utf8'; + /** * @var ezSQL_mysql */ @@ -26,109 +63,115 @@ protected function setUp() { * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. */ - protected function tearDown() { - + protected function tearDown() { + $this->object = null; } /** * @covers ezSQL_mysql::quick_connect - * @todo Implement testQuick_connect(). */ public function testQuick_connect() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); + $result = $this->object->quick_connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD, self::TEST_DB_NAME); + + $this->assertTrue($result); } /** * @covers ezSQL_mysql::connect - * @todo Implement testConnect(). */ public function testConnect() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $result = $this->object->connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD); + + $this->assertTrue($result); + } // testConnect /** * @covers ezSQL_mysql::select - * @todo Implement testSelect(). */ public function testSelect() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $this->object->connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD); + $this->assertTrue($this->object->isConnected()); + + $result = $this->object->select(self::TEST_DB_NAME); + + $this->assertTrue($result); + } // testSelect /** * @covers ezSQL_mysql::escape - * @todo Implement testEscape(). */ public function testEscape() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $result = $this->object->escape("This is'nt escaped."); + + $this->assertEquals("This is\\'nt escaped.", $result); + } // testEscape /** * @covers ezSQL_mysql::sysdate - * @todo Implement testSysdate(). */ public function testSysdate() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $this->assertEquals('NOW()', $this->object->sysdate()); + } // testSysdate /** * @covers ezSQL_mysql::query * @todo Implement testQuery(). */ public function testQuery() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } - - /** - * @covers ezSQL_mysql::disconnect - * @todo Implement testDisconnect(). - */ - public function testDisconnect() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $this->object->connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD); + + $this->object->select(self::TEST_DB_NAME); + + $this->assertEquals($this->object->query('CREATE TABLE unit_test(id integer, test_key varchar(50), PRIMARY KEY (ID))'), 0); + $this->assertEquals($this->object->query('INSERT INTO unit_test(id, test_key) VALUES(1, \'test 1\')'), 1); + $this->assertEquals($this->object->query('DROP TABLE unit_test'), 0); + + } // testQuery /** * @covers ezSQL_mysql::getDBHost - * @todo Implement testGetDBHost(). */ public function testGetDBHost() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $this->assertEquals(self::TEST_DB_HOST, $this->object->getDBHost()); + } // testGetDBHost /** * @covers ezSQL_mysql::getCharset - * @todo Implement testGetCharset(). */ public function testGetCharset() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $this->assertEquals(self::TEST_DB_CHARSET, $this->object->getCharset()); + } // testGetCharset + + /** + * @covers ezSQL_mysql::disconnect + */ + public function testDisconnect() { + $this->object->disconnect(); + + $this->assertTrue(true); + } // testDisconnect -} + + /** + * + public function testConstructionWithParameters() { + // Reset the test object + $this->tearDown(); + + // Create a new object with given parameters + $this->object = new ezSQL_mysql(self::TEST_DB_USER, self::TEST_DB_PASSWORD, self::TEST_DB_HOST, self::TEST_DB_CHARSET); + + // Run all previous tests again + $this->testQuick_connect(); + $this->testConnect(); + $this->testSelect(); + $this->testEscape(); + $this->testSysdate(); + $this->testQuery(); + $this->testGetDBHost(); + $this->testGetCharset(); + $this->testDisconnect(); + } // testConstructionWithParameters + */ -?> +} // ezSQL_mysqlTest \ No newline at end of file diff --git a/mysql/ez_sql_mysql.php b/mysql/ez_sql_mysql.php index 41a6a671..f84563de 100755 --- a/mysql/ez_sql_mysql.php +++ b/mysql/ez_sql_mysql.php @@ -154,8 +154,6 @@ public function connect($dbuser='', $dbpassword='', $dbhost='localhost', $charse * @return boolean */ public function select($dbname='') { - $this->connected = false; - if ( ! $dbname ) { // Must have a database name $this->register_error($this->ezsql_mysql_str[3] . ' in ' . __FILE__ . ' on line ' . __LINE__); @@ -164,7 +162,7 @@ public function select($dbname='') { // Must have an active database connection $this->register_error($this->ezsql_mysql_str[4] . ' in ' . __FILE__ . ' on line ' . __LINE__); $this->show_errors ? trigger_error($this->ezsql_mysql_str[4], E_USER_WARNING) : null; - } else if ( !@mysql_select_db($dbname,$this->dbh) ) { + } else if ( !@mysql_select_db($dbname, $this->dbh) ) { // Try to connect to the database // Try to get error supplied by mysql if not use our own if ( !$str = @mysql_error($this->dbh)) { From 32714ae168149bff19fde1042740110fd903cc75 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Thu, 5 Apr 2012 20:01:01 +0200 Subject: [PATCH 074/126] Changed database tear up and tear down scripts for MySQL. You need to run the tear up script manually before you start the unit tests. --- _Test/unit_tests/mysql/mysql_test_db_tear_down.sql | 9 ++++----- _Test/unit_tests/mysql/myssql_test_db_tear_up.sql | 5 ++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/_Test/unit_tests/mysql/mysql_test_db_tear_down.sql b/_Test/unit_tests/mysql/mysql_test_db_tear_down.sql index bb76a654..9b7b009c 100644 --- a/_Test/unit_tests/mysql/mysql_test_db_tear_down.sql +++ b/_Test/unit_tests/mysql/mysql_test_db_tear_down.sql @@ -2,15 +2,14 @@ * Tear down script to remove all test objects after the test * * @author Stefanie Janine Stoelting (mail@stefanie-stoelting.de) - * * @name ezSQL_mysql_tear_down * @package ezSQL + * @subpackage unitTests * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + */ -*/ +-- Drop the user +DROP USER ezTest@localhost; -- Drop the database DROP DATABASE ez_test; - --- Drop the user -DROP USER ezTest; diff --git a/_Test/unit_tests/mysql/myssql_test_db_tear_up.sql b/_Test/unit_tests/mysql/myssql_test_db_tear_up.sql index 6d134851..b2aa5b09 100644 --- a/_Test/unit_tests/mysql/myssql_test_db_tear_up.sql +++ b/_Test/unit_tests/mysql/myssql_test_db_tear_up.sql @@ -2,12 +2,11 @@ * Tear up script for generating database and user for tests * * @author Stefanie Janine Stoelting (mail@stefanie-stoelting.de) - * * @name ezSQL_mysql_tear_up * @package ezSQL + * @subpackage unitTests * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) - -*/ + */ -- Create the database CREATE DATABASE ez_test charset='utf8'; From 884ca241f284832562e4a1d33d9d6e51042cfcb9 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Thu, 5 Apr 2012 20:09:46 +0200 Subject: [PATCH 075/126] Removed a not used unit test for MySQL and trailing spaces. --- _Test/unit_tests/mysql/ezSQL_mysqlTest.php | 65 +++++++--------------- 1 file changed, 21 insertions(+), 44 deletions(-) diff --git a/_Test/unit_tests/mysql/ezSQL_mysqlTest.php b/_Test/unit_tests/mysql/ezSQL_mysqlTest.php index 2ea78c75..46844e24 100644 --- a/_Test/unit_tests/mysql/ezSQL_mysqlTest.php +++ b/_Test/unit_tests/mysql/ezSQL_mysqlTest.php @@ -6,11 +6,11 @@ /** * Test class for ezSQL_mysql. * Generated by PHPUnit - * + * * Needs database tear up to run test, that creates database and a user with * appropriate rights. * Run database tear down after tests to get rid of the database and the user. - * + * * @author Stefanie Janine Stoelting (mail@stefanie-stoelting.de) * @name ezSQL_mysql_tear_up * @uses mysql_test_db_tear_up.sql @@ -22,27 +22,27 @@ class ezSQL_mysqlTest extends PHPUnit_Framework_TestCase { /** - * constant string user name + * constant string user name */ const TEST_DB_USER = 'ezTest'; - + /** - * constant string password + * constant string password */ const TEST_DB_PASSWORD = 'ezTest'; - + /** - * constant database name + * constant database name */ const TEST_DB_NAME = 'ez_test'; - + /** * constant database host */ const TEST_DB_HOST = 'localhost'; - + /** - * constant database connection charset + * constant database connection charset */ const TEST_DB_CHARSET = 'utf8'; @@ -63,7 +63,7 @@ protected function setUp() { * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. */ - protected function tearDown() { + protected function tearDown() { $this->object = null; } @@ -72,7 +72,7 @@ protected function tearDown() { */ public function testQuick_connect() { $result = $this->object->quick_connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD, self::TEST_DB_NAME); - + $this->assertTrue($result); } @@ -81,7 +81,7 @@ public function testQuick_connect() { */ public function testConnect() { $result = $this->object->connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD); - + $this->assertTrue($result); } // testConnect @@ -91,9 +91,9 @@ public function testConnect() { public function testSelect() { $this->object->connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD); $this->assertTrue($this->object->isConnected()); - + $result = $this->object->select(self::TEST_DB_NAME); - + $this->assertTrue($result); } // testSelect @@ -102,7 +102,7 @@ public function testSelect() { */ public function testEscape() { $result = $this->object->escape("This is'nt escaped."); - + $this->assertEquals("This is\\'nt escaped.", $result); } // testEscape @@ -119,13 +119,13 @@ public function testSysdate() { */ public function testQuery() { $this->object->connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD); - + $this->object->select(self::TEST_DB_NAME); - + $this->assertEquals($this->object->query('CREATE TABLE unit_test(id integer, test_key varchar(50), PRIMARY KEY (ID))'), 0); $this->assertEquals($this->object->query('INSERT INTO unit_test(id, test_key) VALUES(1, \'test 1\')'), 1); $this->assertEquals($this->object->query('DROP TABLE unit_test'), 0); - + } // testQuery /** @@ -141,37 +141,14 @@ public function testGetDBHost() { public function testGetCharset() { $this->assertEquals(self::TEST_DB_CHARSET, $this->object->getCharset()); } // testGetCharset - + /** * @covers ezSQL_mysql::disconnect */ public function testDisconnect() { $this->object->disconnect(); - + $this->assertTrue(true); } // testDisconnect - - /** - * - public function testConstructionWithParameters() { - // Reset the test object - $this->tearDown(); - - // Create a new object with given parameters - $this->object = new ezSQL_mysql(self::TEST_DB_USER, self::TEST_DB_PASSWORD, self::TEST_DB_HOST, self::TEST_DB_CHARSET); - - // Run all previous tests again - $this->testQuick_connect(); - $this->testConnect(); - $this->testSelect(); - $this->testEscape(); - $this->testSysdate(); - $this->testQuery(); - $this->testGetDBHost(); - $this->testGetCharset(); - $this->testDisconnect(); - } // testConstructionWithParameters - */ - } // ezSQL_mysqlTest \ No newline at end of file From 40687ef8014761eaf0735d7158e0ead6b434861b Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Thu, 5 Apr 2012 20:38:42 +0200 Subject: [PATCH 076/126] Created tear up and tear down SQL scripts to initialize the database and to remove them after using them. --- .../postgresql/postgresql_test_db_tear_down.sql | 15 +++++++++++++++ .../postgresql/postgresql_test_db_tear_up.sql | 15 +++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 _Test/unit_tests/postgresql/postgresql_test_db_tear_down.sql create mode 100644 _Test/unit_tests/postgresql/postgresql_test_db_tear_up.sql diff --git a/_Test/unit_tests/postgresql/postgresql_test_db_tear_down.sql b/_Test/unit_tests/postgresql/postgresql_test_db_tear_down.sql new file mode 100644 index 00000000..a90e7400 --- /dev/null +++ b/_Test/unit_tests/postgresql/postgresql_test_db_tear_down.sql @@ -0,0 +1,15 @@ +/** + * Tear down script to remove all test objects after the test + * + * @author Stefanie Janine Stoelting (mail@stefanie-stoelting.de) + * @name ezSQL_postgresql_tear_down + * @package ezSQL + * @subpackage unitTests + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + */ + +-- Drop the database +DROP DATABASE ez_test; + +-- Drop the user +DROP USER ezTest; diff --git a/_Test/unit_tests/postgresql/postgresql_test_db_tear_up.sql b/_Test/unit_tests/postgresql/postgresql_test_db_tear_up.sql new file mode 100644 index 00000000..da9d3c6b --- /dev/null +++ b/_Test/unit_tests/postgresql/postgresql_test_db_tear_up.sql @@ -0,0 +1,15 @@ +/** + * Tear up script for generating database and user for tests + * + * @author Stefanie Janine Stoelting (mail@stefanie-stoelting.de) + * @name ezSQL_postgresql_tear_up + * @package ezSQL + * @subpackage unitTests + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + */ + +-- Create the user +CREATE USER ez_test WITH PASSWORD 'ezTest'; + +-- Create the database +CREATE DATABASE ez_test OWNER ez_test; From 78f6581554d1b37b45286be1c8af054f94957b21 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Thu, 5 Apr 2012 21:44:53 +0200 Subject: [PATCH 077/126] Changed comparison of host and charset with defaults instead of empty values --- mysql/ez_sql_mysql.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql/ez_sql_mysql.php b/mysql/ez_sql_mysql.php index f84563de..a09c803f 100755 --- a/mysql/ez_sql_mysql.php +++ b/mysql/ez_sql_mysql.php @@ -128,7 +128,7 @@ public function connect($dbuser='', $dbpassword='', $dbhost='localhost', $charse $this->dbuser = empty($dbuser) ? $this->dbuser : $dbuser; $this->dbpassword = empty($dbpassword) ? $this->dbpassword : $dbpassword; - $this->dbhost = empty($dbhost) ? $this->dbhost : $dbhost; + $this->dbhost = $dbhost!='localhost' ? $this->dbhost : $dbhost; $this->charset = empty($charset) ? $this->charset : $charset; // Must have a user and a password From ecad5d76061cf965bcd2fb1dba272af8de72765d Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Thu, 5 Apr 2012 23:42:48 +0200 Subject: [PATCH 078/126] Completed unit tests for PostgreSQL and correted failures in the PostgreSQL class --- .../postgresql/ezSQL_postgresqlTest.php | 172 ++++++++++-------- postgresql/ez_sql_postgresql.php | 57 +++--- 2 files changed, 124 insertions(+), 105 deletions(-) diff --git a/_Test/unit_tests/postgresql/ezSQL_postgresqlTest.php b/_Test/unit_tests/postgresql/ezSQL_postgresqlTest.php index efb9eacf..77dd2421 100644 --- a/_Test/unit_tests/postgresql/ezSQL_postgresqlTest.php +++ b/_Test/unit_tests/postgresql/ezSQL_postgresqlTest.php @@ -5,10 +5,47 @@ /** * Test class for ezSQL_postgresql. - * Generated by PHPUnit on 2012-04-02 at 00:22:45. + * Generated by PHPUnit + * + * Needs database tear up to run test, that creates database and a user with + * appropriate rights. + * Run database tear down after tests to get rid of the database and the user. + * + * @author Stefanie Janine Stoelting (mail@stefanie-stoelting.de) + * @name ezSQL_postgresql_tear_up + * @uses postgresql_test_db_tear_up.sql + * @uses postgresql_test_db_tear_down.sql + * @package ezSQL + * @subpackage unitTests + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) */ class ezSQL_postgresqlTest extends PHPUnit_Framework_TestCase { + /** + * constant string user name + */ + const TEST_DB_USER = 'ez_test'; + + /** + * constant string password + */ + const TEST_DB_PASSWORD = 'ezTest'; + + /** + * constant database name + */ + const TEST_DB_NAME = 'ez_test'; + + /** + * constant database host + */ + const TEST_DB_HOST = 'localhost'; + + /** + * constant database port + */ + const TEST_DB_PORT = '5434'; + /** * @var ezSQL_postgresql */ @@ -20,148 +57,129 @@ class ezSQL_postgresqlTest extends PHPUnit_Framework_TestCase { */ protected function setUp() { $this->object = new ezSQL_postgresql; - } + } // setUp /** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. */ protected function tearDown() { - - } + $this->object = null; + } // tearDown /** * @covers ezSQL_postgresql::quick_connect - * @todo Implement testQuick_connect(). */ public function testQuick_connect() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $this->object->quick_connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD, self::TEST_DB_NAME, self::TEST_DB_HOST, self::TEST_DB_PORT); + } // testQuick_connect /** * @covers ezSQL_postgresql::connect - * @todo Implement testConnect(). + * */ public function testConnect() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $this->object->connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD, self::TEST_DB_NAME, self::TEST_DB_HOST, self::TEST_DB_PORT); + } // testConnect /** * @covers ezSQL_postgresql::select - * @todo Implement testSelect(). */ public function testSelect() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $this->object->quick_connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD, self::TEST_DB_NAME, self::TEST_DB_HOST, self::TEST_DB_PORT); + + $this->assertTrue($this->object->select(self::TEST_DB_NAME)); + } // testSelect /** * @covers ezSQL_postgresql::escape - * @todo Implement testEscape(). */ public function testEscape() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $result = $this->object->escape("This is'nt escaped."); + + $this->assertEquals("This is''nt escaped.", $result); + } // testEscape /** * @covers ezSQL_postgresql::sysdate - * @todo Implement testSysdate(). */ public function testSysdate() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $this->assertEquals('NOW()', $this->object->sysdate()); + } // testSysdate /** * @covers ezSQL_postgresql::showTables - * @todo Implement testShowTables(). */ public function testShowTables() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $this->assertTrue($this->object->connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD, self::TEST_DB_NAME, self::TEST_DB_HOST, self::TEST_DB_PORT)); + + $result = $this->object->showTables(); + + $this->assertEquals('SELECT table_name FROM information_schema.tables WHERE table_schema = \'' . self::TEST_DB_NAME . '\' AND table_type=\'BASE TABLE\'', $result); + } // testShowTables /** * @covers ezSQL_postgresql::descTable - * @todo Implement testDescTable(). */ public function testDescTable() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' + $this->assertTrue($this->object->connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD, self::TEST_DB_NAME, self::TEST_DB_HOST, self::TEST_DB_PORT)); + + $this->assertEquals(0, $this->object->query('CREATE TABLE unit_test(id integer, test_key varchar(50), PRIMARY KEY (ID))')); + + $this->assertEquals( + "SELECT ordinal_position, column_name, data_type, column_default, is_nullable, character_maximum_length, numeric_precision FROM information_schema.columns WHERE table_name = 'unit_test' AND table_schema='" . self::TEST_DB_NAME . "' ORDER BY ordinal_position", + $this->object->descTable('unit_test') ); - } + + $this->assertEquals(0, $this->object->query('DROP TABLE unit_test')); + } // testDescTable /** * @covers ezSQL_postgresql::showDatabases - * @todo Implement testShowDatabases(). */ public function testShowDatabases() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' + $this->assertTrue($this->object->connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD, self::TEST_DB_NAME, self::TEST_DB_HOST, self::TEST_DB_PORT)); + + $this->assertEquals( + "SELECT datname FROM pg_database WHERE datname NOT IN ('template0', 'template1') ORDER BY 1", + $this->object->showDatabases() ); - } + } // testShowDatabases /** * @covers ezSQL_postgresql::query - * @todo Implement testQuery(). */ public function testQuery() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $this->assertTrue($this->object->connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD, self::TEST_DB_NAME, self::TEST_DB_HOST, self::TEST_DB_PORT)); + + $this->assertEquals(0, $this->object->query('CREATE TABLE unit_test(id integer, test_key varchar(50), PRIMARY KEY (ID))')); + + $this->assertEquals(0, $this->object->query('DROP TABLE unit_test')); + } // testQuery /** * @covers ezSQL_postgresql::disconnect - * @todo Implement testDisconnect(). */ public function testDisconnect() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $this->object->disconnect(); + + $this->assertFalse($this->object->isConnected()); + } // testDisconnect /** * @covers ezSQL_postgresql::getDBHost - * @todo Implement testGetDBHost(). */ public function testGetDBHost() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $this->assertEquals(self::TEST_DB_HOST, $this->object->getDBHost()); + } // testGetDBHost /** * @covers ezSQL_postgresql::getPort - * @todo Implement testGetPort(). */ public function testGetPort() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } - -} + $this->object->connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD, self::TEST_DB_NAME, self::TEST_DB_HOST, self::TEST_DB_PORT); + + $this->assertEquals(self::TEST_DB_PORT, $this->object->getPort()); + } // testGetPort -?> +} // ezSQL_postgresqlTest \ No newline at end of file diff --git a/postgresql/ez_sql_postgresql.php b/postgresql/ez_sql_postgresql.php index ca129a8a..b2ee5a44 100755 --- a/postgresql/ez_sql_postgresql.php +++ b/postgresql/ez_sql_postgresql.php @@ -54,7 +54,7 @@ class ezSQL_postgresql extends ezSQLcore * TCP/IP port of PostgreSQL * @var string Default is PostgreSQL default port 5432 */ - private $port = '5432'; + private $dbport = '5432'; /** * Show errors @@ -71,10 +71,10 @@ class ezSQL_postgresql extends ezSQLcore * @param string $dbname The name of the database * @param string $dbhost The host name or IP address of the database server. * Default is localhost - * @param string $port The database TCP/IP port - * Default is PostgreSQL default port 5432 + * @param string $dbport The database TCP/IP port + * Default is PostgreSQL default port 5432 */ - public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') { + public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $dbport='5432') { if ( ! function_exists ('pg_connect') ) { throw new Exception('Fatal Error: ezSQL_postgresql requires PostgreSQL Lib to be compiled and or linked in to the PHP engine'); } @@ -88,7 +88,7 @@ public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='loc $this->dbpassword = $dbpassword; $this->dbname = $dbname; $this->dbhost = $dbhost; - $this->port = $port; + $this->dbport = $dbport; } // __construct /** @@ -101,12 +101,12 @@ public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='loc * @param string $dbname The name of the database * @param string $dbhost The host name or IP address of the database server. * Default is localhost - * @param string $port The database TCP/IP port + * @param string $dbport The database TCP/IP port * Default is PostgreSQL default port 5432 * @return boolean */ - function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') { - if ( ! $this->connect($dbuser, $dbpassword, $dbname, $dbhost, $port, true) ) ; + function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $dbport='5432') { + if ( ! $this->connect($dbuser, $dbpassword, $dbname, $dbhost, $dbport, true) ) ; else if ( ! $this->select($dbname) ); return $this->connected; @@ -124,28 +124,28 @@ function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhos * @param string $dbname The name of the database * @param string $dbhost The host name or IP address of the database server. * Default is localhost - * @param string $port The database TCP/IP port + * @param string $dbport The database TCP/IP port * Default is PostgreSQL default port 5432 * @return boolean */ - public function connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') { + public function connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $dbport='5432') { $this->connected = false; + + $this->dbuser = empty($dbuser) ? $this->dbuser : $dbuser; + $this->dbpassword = empty($dbpassword) ? $this->dbpassword : $dbpassword; + $this->dbname = empty($dbname) ? $this->dbname : $dbname; + $this->dbhost = $dbhost!='localhost' ? $this->dbhost : $dbhost; + $this->dbport = $dbport!='5432' ? $dbport : $this->dbport; - if ( ! $dbuser ) { + if ( !$this->dbuser ) { // Must have a user and a password $this->register_error($this->ezsql_postgresql_str[1] . ' in ' . __FILE__ . ' on line ' . __LINE__); $this->show_errors ? trigger_error($this->ezsql_postgresql_str[1], E_USER_WARNING) : null; - } else if ( ! $this->dbh = pg_connect("host=$dbhost port=$port dbname=$dbname user=$dbuser password=$dbpassword", true) ) { + } else if ( ! $this->dbh = pg_connect("host=$this->dbhost port=$this->dbport dbname=$this->dbname user=$this->dbuser password=$this->dbpassword", true) ) { // Try to establish the server database handle $this->register_error($this->ezsql_postgresql_str[2] . ' in ' . __FILE__ . ' on line ' . __LINE__); $this->show_errors ? trigger_error($this->ezsql_postgresql_str[2], E_USER_WARNING) : null; } else { - $this->dbuser = $dbuser; - $this->dbpassword = $dbpassword; - $this->dbhost = $dbhost; - $this->dbname = $dbname; - $this->port = $port; - $this->connected = true; } @@ -161,13 +161,14 @@ public function connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localho * @param string $dbname The name of the database * @param string $dbhost The host name or IP address of the database server. * Default is localhost - * @param string $port The database TCP/IP port + * @param string $dbport The database TCP/IP port * Default is PostgreSQL default port 5432 * @return boolean */ - public function select($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $port='5432') { - if ( ! $this->connect($dbuser, $dbpassword, $dbname, $dbhost, $port, true) ) ; - else if ( ! $this->select($dbname) ); + public function select($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $dbport='5432') { + $this->disconnect(); + + $this->connect($dbuser, $dbpassword, $dbname, $dbhost, $dbport); return $this->connected; } // select @@ -200,7 +201,7 @@ public function sysdate() { * @return string */ public function showTables() { - return "table_name FROM information_schema.tables WHERE table_schema = '$this->dbname' and table_type='BASE TABLE'"; + return "SELECT table_name FROM information_schema.tables WHERE table_schema = '$this->dbname' AND table_type='BASE TABLE'"; } // showTables /** @@ -210,7 +211,7 @@ public function showTables() { * @return string */ public function descTable($tbl_name) { - return "ordinal_position, column_name, data_type, column_default, is_nullable, character_maximum_length, numeric_precision FROM information_schema.columns WHERE table_name = '$tbl_name' AND table_schema='$this->dbname' ORDER BY ordinal_position"; + return "SELECT ordinal_position, column_name, data_type, column_default, is_nullable, character_maximum_length, numeric_precision FROM information_schema.columns WHERE table_name = '$tbl_name' AND table_schema='$this->dbname' ORDER BY ordinal_position"; } // descTable /** @@ -219,7 +220,7 @@ public function descTable($tbl_name) { * @return string */ public function showDatabases() { - return "datname from pg_database WHERE datname NOT IN ('template0', 'template1') ORDER BY 1"; + return "SELECT datname FROM pg_database WHERE datname NOT IN ('template0', 'template1') ORDER BY 1"; } // showDatabases /** @@ -253,8 +254,8 @@ public function query($query) { } // If there is no existing database connection then try to connect - if ( ! isset($this->dbh) || ! $this->dbh ) { - $this->connect($this->dbuser, $this->dbpassword, $this->dbname, $this->dbhost, $this->port); + if ( ! isset($this->dbh) || ! $this->dbh ) { + $this->connect($this->dbuser, $this->dbpassword, $this->dbname, $this->dbhost, $this->dbport); } // Perform the query via std postgresql_query function.. @@ -359,7 +360,7 @@ public function getDBHost() { * @return string */ public function getPort() { - return $this->port; + return $this->dbport; } // getPort } // ezSQL_postgresql \ No newline at end of file From fe1da4823b0f3b4c61716bb6a27133782dc7ae7c Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Thu, 5 Apr 2012 23:54:27 +0200 Subject: [PATCH 079/126] Changed the port constant from my local port to the default port of PostgreSQL --- _Test/unit_tests/postgresql/ezSQL_postgresqlTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_Test/unit_tests/postgresql/ezSQL_postgresqlTest.php b/_Test/unit_tests/postgresql/ezSQL_postgresqlTest.php index 77dd2421..9ee9c5e8 100644 --- a/_Test/unit_tests/postgresql/ezSQL_postgresqlTest.php +++ b/_Test/unit_tests/postgresql/ezSQL_postgresqlTest.php @@ -44,7 +44,7 @@ class ezSQL_postgresqlTest extends PHPUnit_Framework_TestCase { /** * constant database port */ - const TEST_DB_PORT = '5434'; + const TEST_DB_PORT = '5432'; /** * @var ezSQL_postgresql From 0ed362ca231f3c26089a9f7450a4698c55cc2f66 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Fri, 6 Apr 2012 01:24:35 +0200 Subject: [PATCH 080/126] Completed unit tests for PDO with PostgreSQL and correted failures in the PDO class --- _Test/unit_tests/pdo/ezSQL_pdoTest.php | 134 +++++++++++++++---------- pdo/ez_sql_pdo.php | 31 +++--- 2 files changed, 100 insertions(+), 65 deletions(-) diff --git a/_Test/unit_tests/pdo/ezSQL_pdoTest.php b/_Test/unit_tests/pdo/ezSQL_pdoTest.php index 528b4831..845072a8 100644 --- a/_Test/unit_tests/pdo/ezSQL_pdoTest.php +++ b/_Test/unit_tests/pdo/ezSQL_pdoTest.php @@ -1,13 +1,62 @@ object = new ezSQL_pdo; - } + } // setUp /** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. */ protected function tearDown() { - - } + $this->object = null; + } // tearDown /** * @covers ezSQL_pdo::connect - * @todo Implement testConnect(). */ public function testConnect() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $this->assertTrue($this->object->connect('pgsql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD)); + } // testConnect /** * @covers ezSQL_pdo::quick_connect - * @todo Implement testQuick_connect(). */ public function testQuick_connect() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $this->assertTrue($this->object->quick_connect('pgsql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD)); + } // testQuick_connect /** * @covers ezSQL_pdo::select - * @todo Implement testSelect(). */ public function testSelect() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $this->assertTrue($this->object->select('pgsql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD)); + } // testSelect /** * @covers ezSQL_pdo::escape - * @todo Implement testEscape(). */ public function testEscape() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $this->assertTrue($this->object->connect('pgsql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD)); + + $result = $this->object->escape("This is'nt escaped."); + + $this->assertEquals("This is''nt escaped.", $result); + } // testEscape /** * @covers ezSQL_pdo::sysdate - * @todo Implement testSysdate(). */ public function testSysdate() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $this->assertEquals("datetime('now')", $this->object->sysdate()); + } // testSysdate /** * @covers ezSQL_pdo::catch_error - * @todo Implement testCatch_error(). */ public function testCatch_error() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $this->assertTrue($this->object->connect('pgsql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD)); + + $this->assertNull($this->object->catch_error()); + } // testCatch_error /** * @covers ezSQL_pdo::query * @todo Implement testQuery(). */ public function testQuery() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $this->assertTrue($this->object->connect('pgsql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD)); + + $this->assertEquals(0, $this->object->query('CREATE TABLE unit_test(id integer, test_key varchar(50), PRIMARY KEY (ID))')); + + $this->assertEquals(0, $this->object->query('DROP TABLE unit_test')); + } // testQuery /** * @covers ezSQL_pdo::disconnect - * @todo Implement testDisconnect(). */ public function testDisconnect() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' - ); - } + $this->assertTrue($this->object->connect('pgsql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD)); + + $this->object->disconnect(); -} + $this->assertTrue(true); + } // testDisconnect -?> +} // ezSQL_pdoTest \ No newline at end of file diff --git a/pdo/ez_sql_pdo.php b/pdo/ez_sql_pdo.php index 59203e51..a1b32d39 100755 --- a/pdo/ez_sql_pdo.php +++ b/pdo/ez_sql_pdo.php @@ -32,13 +32,13 @@ class ezSQL_pdo extends ezSQLcore * The database user name * @var string */ - private $user; + private $dbuser; /** * The database password * @var string */ - private $password; + private $dbpassword; /** * Show errors @@ -70,7 +70,8 @@ public function __construct($dsn='', $user='', $password='') { // Turn on track errors ini_set('track_errors', 1); - if ( $dsn && $user && $password ) { + if ( !empty($dsn) && !empty($user) && !empty($password) ) { + print "

constructor: $dsn

"; $this->connect($dsn, $user, $password); } } // __construct @@ -80,24 +81,28 @@ public function __construct($dsn='', $user='', $password='') { * * @param string $dsn The connection parameter string * Default is empty string - * @param string $user The database user name - * Default is empty string - * @param string $password The database password - * Default is empty string + * @param string $dbuser The database user name + * Default is empty string + * @param string $dbpassword The database password + * Default is empty string * @return boolean */ - public function connect($dsn='', $user='', $password='') { + public function connect($dsn='', $dbuser='', $dbpassword='') { $this->connected = false; + $this->dbuser = empty($dbuser) ? $this->dbuser : $dbuser; + $this->dbpassword = empty($dbpassword) ? $this->dbpassword : $dbpassword; + $this->dsn = empty($dsn) ? $this->dsn : $dsn; + // Must have a user and a password - if ( ! $dsn || ! $user || ! $password ) { + if ( empty($this->dsn) || empty($this->dbuser) || empty($this->dbpassword) ) { $this->register_error($this->ezsql_pdo_str[1] . ' in ' . __FILE__ . ' on line ' . __LINE__); $this->show_errors ? trigger_error($this->ezsql_pdo_str[1], E_USER_WARNING) : null; } // Establish PDO connection try { - $this->dbh = new PDO($dsn, $user, $password); + $this->dbh = new PDO($this->dsn, $this->dbuser, $this->dbpassword); $this->connected = true; } catch (PDOException $e) { @@ -158,12 +163,12 @@ public function select($dsn='', $user='', $password='') { */ public function escape($str) { // If there is no existing database connection then try to connect - if ( ! isset($this->dbh) || ! $this->dbh ) - { + if ( ! isset($this->dbh) || ! $this->dbh ) { $this->connect($this->dsn, $this->user, $this->password); } - $return_val = $this->dbh->quote($str); + // pdo quote adds ' at the beginning and at the end, remove them for standard behavior + $return_val = substr($this->dbh->quote($str), 1, -1); return $return_val; } // escape From f43ee511c40bf2f1bf48aacf2b79fc8f059bcfe6 Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Fri, 6 Apr 2012 01:25:20 +0200 Subject: [PATCH 081/126] Changed the port constant from my local port to the default port of PostgreSQL --- _Test/unit_tests/pdo/ezSQL_pdoTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_Test/unit_tests/pdo/ezSQL_pdoTest.php b/_Test/unit_tests/pdo/ezSQL_pdoTest.php index 845072a8..e560d263 100644 --- a/_Test/unit_tests/pdo/ezSQL_pdoTest.php +++ b/_Test/unit_tests/pdo/ezSQL_pdoTest.php @@ -55,7 +55,7 @@ class ezSQL_pdoTest extends PHPUnit_Framework_TestCase { /** * constant database port */ - const TEST_DB_PORT = '5434'; + const TEST_DB_PORT = '5432'; /** * @var ezSQL_pdo From 05f7802a641e410c1e7b00cab49c5a807283df9e Mon Sep 17 00:00:00 2001 From: sjstoelting Date: Fri, 6 Apr 2012 01:27:36 +0200 Subject: [PATCH 082/126] Updated the PHPDoc documentation --- _Documentation/phpDocumentator/blank.html | 4 +- .../phpDocumentator/classtrees_default.html | 6 +- .../phpDocumentator/classtrees_ezSQL.html | 6 +- ...deigniter---ezSQL_codeigniterTest.php.html | 101 ++ ...t_tests---mssql---ezSQL_mssqlTest.php.html | 101 ++ ...--oracle8_9---ezSQL_oracle8_9Test.php.html | 101 ++ ...it_tests---shared---ezSQLcoreTest.php.html | 87 ++ ...tests---sqlite---ezSQL_sqliteTest.php.html | 101 ++ ...tests---sybase---ezSQL_sybaseTest.php.html | 101 ++ .../_mysql---disk_cache_example.php.html | 2 +- .../_oracle8_9---disk_cache_example.php.html | 2 +- ...z_sql_core_2.1_debughack_0.2alpha.php.html | 2 +- .../_shared---ez_sql_core_202console.php.html | 2 +- .../default/ezSQL_codeigniterTest.html | 255 ++++ .../default/ezSQL_mssqlTest.html | 458 +++++++ .../default/ezSQL_oracle8_9Test.html | 545 ++++++++ .../default/ezSQL_sqliteTest.html | 400 ++++++ .../default/ezSQL_sybaseTest.html | 458 +++++++ .../phpDocumentator/default/ezSQLcore.html | 76 +- .../default/ezSQLcoreTest.html | 777 +++++++++++ .../phpDocumentator/elementindex.html | 1197 +++++++++++++++-- .../phpDocumentator/elementindex_default.html | 562 ++++++++ .../phpDocumentator/elementindex_ezSQL.html | 523 ++++++- _Documentation/phpDocumentator/errors.html | 156 ++- .../_codeigniter---Ezsql_codeigniter.php.html | 2 +- .../ezSQL/_mssql---ez_sql_mssql.php.html | 2 +- .../ezSQL/_mysql---ez_sql_mysql.php.html | 2 +- .../_oracle8_9---ez_sql_oracle8_9.php.html | 2 +- .../ezSQL/_pdo---ez_sql_pdo.php.html | 2 +- .../_postgresql---ez_sql_postgresql.php.html | 2 +- .../ezSQL/_shared---ez_sql_core.php.html | 2 +- .../ezSQL/_sqlite---ez_sql_sqlite.php.html | 2 +- .../ezSQL/_sybase---ez_sql_sybase.php.html | 2 +- .../ezSQL/ezSQL_codeigniter.html | 56 +- .../phpDocumentator/ezSQL/ezSQL_mssql.html | 83 +- .../phpDocumentator/ezSQL/ezSQL_mysql.html | 101 +- .../ezSQL/ezSQL_oracle8_9.html | 115 +- .../phpDocumentator/ezSQL/ezSQL_pdo.html | 107 +- .../ezSQL/ezSQL_postgresql.html | 139 +- .../phpDocumentator/ezSQL/ezSQL_sqlite.html | 79 +- .../phpDocumentator/ezSQL/ezSQL_sybase.html | 103 +- .../phpDocumentator/ezSQL/ezSQLcore.html | 207 ++- ...t_tests---mysql---ezSQL_mysqlTest.php.html | 101 ++ ...-unit_tests---pdo---ezSQL_pdoTest.php.html | 101 ++ ...postgresql---ezSQL_postgresqlTest.php.html | 101 ++ .../ezSQL/unitTests/ezSQL_mysqlTest.html | 602 +++++++++ .../ezSQL/unitTests/ezSQL_pdoTest.html | 594 ++++++++ .../ezSQL/unitTests/ezSQL_postgresqlTest.html | 685 ++++++++++ _Documentation/phpDocumentator/index.html | 4 +- .../phpDocumentator/li_default.html | 13 + _Documentation/phpDocumentator/li_ezSQL.html | 18 + _Documentation/phpDocumentator/todolist.html | 262 ++++ 52 files changed, 9073 insertions(+), 439 deletions(-) create mode 100644 _Documentation/phpDocumentator/default/__Test---unit_tests---codeigniter---ezSQL_codeigniterTest.php.html create mode 100644 _Documentation/phpDocumentator/default/__Test---unit_tests---mssql---ezSQL_mssqlTest.php.html create mode 100644 _Documentation/phpDocumentator/default/__Test---unit_tests---oracle8_9---ezSQL_oracle8_9Test.php.html create mode 100644 _Documentation/phpDocumentator/default/__Test---unit_tests---shared---ezSQLcoreTest.php.html create mode 100644 _Documentation/phpDocumentator/default/__Test---unit_tests---sqlite---ezSQL_sqliteTest.php.html create mode 100644 _Documentation/phpDocumentator/default/__Test---unit_tests---sybase---ezSQL_sybaseTest.php.html create mode 100644 _Documentation/phpDocumentator/default/ezSQL_codeigniterTest.html create mode 100644 _Documentation/phpDocumentator/default/ezSQL_mssqlTest.html create mode 100644 _Documentation/phpDocumentator/default/ezSQL_oracle8_9Test.html create mode 100644 _Documentation/phpDocumentator/default/ezSQL_sqliteTest.html create mode 100644 _Documentation/phpDocumentator/default/ezSQL_sybaseTest.html create mode 100644 _Documentation/phpDocumentator/default/ezSQLcoreTest.html create mode 100644 _Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---mysql---ezSQL_mysqlTest.php.html create mode 100644 _Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---pdo---ezSQL_pdoTest.php.html create mode 100644 _Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---postgresql---ezSQL_postgresqlTest.php.html create mode 100644 _Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_mysqlTest.html create mode 100644 _Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_pdoTest.html create mode 100644 _Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_postgresqlTest.html create mode 100644 _Documentation/phpDocumentator/todolist.html diff --git a/_Documentation/phpDocumentator/blank.html b/_Documentation/phpDocumentator/blank.html index 185f86cb..926bb3ea 100644 --- a/_Documentation/phpDocumentator/blank.html +++ b/_Documentation/phpDocumentator/blank.html @@ -1,11 +1,11 @@ - Generated Documentation + ezSQL -

Generated Documentation

+

ezSQL

Welcome to default!

This documentation was generated by phpDocumentor v1.4.4
diff --git a/_Documentation/phpDocumentator/classtrees_default.html b/_Documentation/phpDocumentator/classtrees_default.html index 019a0761..3794651c 100644 --- a/_Documentation/phpDocumentator/classtrees_default.html +++ b/_Documentation/phpDocumentator/classtrees_default.html @@ -21,8 +21,12 @@

Root class ezSQLcore

+

Root class PHPUnit_Framework_TestCase

+ +

- Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 + Documentation generated on Fri, 06 Apr 2012 01:26:18 +0200 by phpDocumentor 1.4.4

\ No newline at end of file diff --git a/_Documentation/phpDocumentator/classtrees_ezSQL.html b/_Documentation/phpDocumentator/classtrees_ezSQL.html index 445398c5..cc61492f 100644 --- a/_Documentation/phpDocumentator/classtrees_ezSQL.html +++ b/_Documentation/phpDocumentator/classtrees_ezSQL.html @@ -19,8 +19,12 @@

Root class ezSQLcore

  • ezSQL_codeigniter
  • ezSQL_mssql
  • ezSQL_mysql
  • ezSQL_oracle8_9
  • ezSQL_pdo
  • ezSQL_postgresql
  • ezSQL_sqlite
  • ezSQL_sybase
  • +

    Root class PHPUnit_Framework_TestCase

    + +

    - Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 + Documentation generated on Fri, 06 Apr 2012 01:26:18 +0200 by phpDocumentor 1.4.4

    \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/__Test---unit_tests---codeigniter---ezSQL_codeigniterTest.php.html b/_Documentation/phpDocumentator/default/__Test---unit_tests---codeigniter---ezSQL_codeigniterTest.php.html new file mode 100644 index 00000000..603d29c0 --- /dev/null +++ b/_Documentation/phpDocumentator/default/__Test---unit_tests---codeigniter---ezSQL_codeigniterTest.php.html @@ -0,0 +1,101 @@ + + + + + + Docs for page ezSQL_codeigniterTest.php + + + + +
    +

    /_Test/unit_tests/codeigniter/ezSQL_codeigniterTest.php

    + + +
    +
    Description
    + +
    + + +
    +
    + + +
    +
    Classes
    + +
    + + + + + + + + + +
    ClassDescription
    + ezSQL_codeigniterTest + + Test class for ezSQL_codeigniter. +
    +
    +
    + + +
    +
    Includes
    + +
    + +
    + +
    + + require_once + (dirname(__FILE__).'/../../../shared/ez_sql_core.php') + (line 3) + +
    + + + +
    + +
    + +
    + + require_once + (dirname(__FILE__).'/../../../codeigniter/Ezsql_codeigniter.php') + (line 4) + +
    + + + +
    +
    +
    + + + + +

    + Documentation generated on Fri, 06 Apr 2012 01:26:19 +0200 by phpDocumentor 1.4.4 +

    +
    + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/__Test---unit_tests---mssql---ezSQL_mssqlTest.php.html b/_Documentation/phpDocumentator/default/__Test---unit_tests---mssql---ezSQL_mssqlTest.php.html new file mode 100644 index 00000000..5253cbbd --- /dev/null +++ b/_Documentation/phpDocumentator/default/__Test---unit_tests---mssql---ezSQL_mssqlTest.php.html @@ -0,0 +1,101 @@ + + + + + + Docs for page ezSQL_mssqlTest.php + + + + +
    +

    /_Test/unit_tests/mssql/ezSQL_mssqlTest.php

    + + +
    +
    Description
    + +
    + + +
    +
    + + +
    +
    Classes
    + +
    + + + + + + + + + +
    ClassDescription
    + ezSQL_mssqlTest + + Test class for ezSQL_mssql. +
    +
    +
    + + +
    +
    Includes
    + +
    + +
    + +
    + + require_once + (dirname(__FILE__).'/../../../shared/ez_sql_core.php') + (line 3) + +
    + + + +
    + +
    + +
    + + require_once + (dirname(__FILE__).'/../../../mssql/ez_sql_mssql.php') + (line 4) + +
    + + + +
    +
    +
    + + + + +

    + Documentation generated on Fri, 06 Apr 2012 01:26:19 +0200 by phpDocumentor 1.4.4 +

    +
    + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/__Test---unit_tests---oracle8_9---ezSQL_oracle8_9Test.php.html b/_Documentation/phpDocumentator/default/__Test---unit_tests---oracle8_9---ezSQL_oracle8_9Test.php.html new file mode 100644 index 00000000..5e94bf04 --- /dev/null +++ b/_Documentation/phpDocumentator/default/__Test---unit_tests---oracle8_9---ezSQL_oracle8_9Test.php.html @@ -0,0 +1,101 @@ + + + + + + Docs for page ezSQL_oracle8_9Test.php + + + + +
    +

    /_Test/unit_tests/oracle8_9/ezSQL_oracle8_9Test.php

    + + +
    +
    Description
    + +
    + + +
    +
    + + +
    +
    Classes
    + +
    + + + + + + + + + +
    ClassDescription
    + ezSQL_oracle8_9Test + + Test class for ezSQL_oracle8_9. +
    +
    +
    + + +
    +
    Includes
    + +
    + +
    + +
    + + require_once + (dirname(__FILE__).'/../../../shared/ez_sql_core.php') + (line 3) + +
    + + + +
    + +
    + +
    + + require_once + (dirname(__FILE__).'/../../../oracle8_9/ez_sql_oracle8_9.php') + (line 4) + +
    + + + +
    +
    +
    + + + + +

    + Documentation generated on Fri, 06 Apr 2012 01:26:19 +0200 by phpDocumentor 1.4.4 +

    +
    + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/__Test---unit_tests---shared---ezSQLcoreTest.php.html b/_Documentation/phpDocumentator/default/__Test---unit_tests---shared---ezSQLcoreTest.php.html new file mode 100644 index 00000000..0e3666d7 --- /dev/null +++ b/_Documentation/phpDocumentator/default/__Test---unit_tests---shared---ezSQLcoreTest.php.html @@ -0,0 +1,87 @@ + + + + + + Docs for page ezSQLcoreTest.php + + + + +
    +

    /_Test/unit_tests/shared/ezSQLcoreTest.php

    + + +
    +
    Description
    + +
    + + +
    +
    + + +
    +
    Classes
    + +
    + + + + + + + + + +
    ClassDescription
    + ezSQLcoreTest + + Test class for ezSQLcore. +
    +
    +
    + + +
    +
    Includes
    + +
    + +
    + +
    + + require_once + (dirname(__FILE__).'/../../../shared/ez_sql_core.php') + (line 3) + +
    + + + +
    +
    +
    + + + + +

    + Documentation generated on Fri, 06 Apr 2012 01:26:18 +0200 by phpDocumentor 1.4.4 +

    +
    + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/__Test---unit_tests---sqlite---ezSQL_sqliteTest.php.html b/_Documentation/phpDocumentator/default/__Test---unit_tests---sqlite---ezSQL_sqliteTest.php.html new file mode 100644 index 00000000..95208a5a --- /dev/null +++ b/_Documentation/phpDocumentator/default/__Test---unit_tests---sqlite---ezSQL_sqliteTest.php.html @@ -0,0 +1,101 @@ + + + + + + Docs for page ezSQL_sqliteTest.php + + + + +
    +

    /_Test/unit_tests/sqlite/ezSQL_sqliteTest.php

    + + +
    +
    Description
    + +
    + + +
    +
    + + +
    +
    Classes
    + +
    + + + + + + + + + +
    ClassDescription
    + ezSQL_sqliteTest + + Test class for ezSQL_sqlite. +
    +
    +
    + + +
    +
    Includes
    + +
    + +
    + +
    + + require_once + (dirname(__FILE__).'/../../../shared/ez_sql_core.php') + (line 3) + +
    + + + +
    + +
    + +
    + + require_once + (dirname(__FILE__).'/../../../sqlite/ez_sql_sqlite.php') + (line 4) + +
    + + + +
    +
    +
    + + + + +

    + Documentation generated on Fri, 06 Apr 2012 01:26:20 +0200 by phpDocumentor 1.4.4 +

    +
    + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/__Test---unit_tests---sybase---ezSQL_sybaseTest.php.html b/_Documentation/phpDocumentator/default/__Test---unit_tests---sybase---ezSQL_sybaseTest.php.html new file mode 100644 index 00000000..233fb8ad --- /dev/null +++ b/_Documentation/phpDocumentator/default/__Test---unit_tests---sybase---ezSQL_sybaseTest.php.html @@ -0,0 +1,101 @@ + + + + + + Docs for page ezSQL_sybaseTest.php + + + + +
    +

    /_Test/unit_tests/sybase/ezSQL_sybaseTest.php

    + + +
    +
    Description
    + +
    + + +
    +
    + + +
    +
    Classes
    + +
    + + + + + + + + + +
    ClassDescription
    + ezSQL_sybaseTest + + Test class for ezSQL_sybase. +
    +
    +
    + + +
    +
    Includes
    + +
    + +
    + +
    + + require_once + (dirname(__FILE__).'/../../../shared/ez_sql_core.php') + (line 3) + +
    + + + +
    + +
    + +
    + + require_once + (dirname(__FILE__).'/../../../sybase/ez_sql_sybase.php') + (line 4) + +
    + + + +
    +
    +
    + + + + +

    + Documentation generated on Fri, 06 Apr 2012 01:26:20 +0200 by phpDocumentor 1.4.4 +

    +
    + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/_mysql---disk_cache_example.php.html b/_Documentation/phpDocumentator/default/_mysql---disk_cache_example.php.html index d0908ae0..e5fce7fc 100644 --- a/_Documentation/phpDocumentator/default/_mysql---disk_cache_example.php.html +++ b/_Documentation/phpDocumentator/default/_mysql---disk_cache_example.php.html @@ -54,7 +54,7 @@

    /mysql/disk_cache_example.php

    - Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 + Documentation generated on Fri, 06 Apr 2012 01:26:18 +0200 by phpDocumentor 1.4.4

    \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/_oracle8_9---disk_cache_example.php.html b/_Documentation/phpDocumentator/default/_oracle8_9---disk_cache_example.php.html index d37a3758..422991d6 100644 --- a/_Documentation/phpDocumentator/default/_oracle8_9---disk_cache_example.php.html +++ b/_Documentation/phpDocumentator/default/_oracle8_9---disk_cache_example.php.html @@ -54,7 +54,7 @@

    /oracle8_9/disk_cache_example.php

    - Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 + Documentation generated on Fri, 06 Apr 2012 01:26:18 +0200 by phpDocumentor 1.4.4

    \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/_shared---ez_sql_core_2.1_debughack_0.2alpha.php.html b/_Documentation/phpDocumentator/default/_shared---ez_sql_core_2.1_debughack_0.2alpha.php.html index 11ef541b..6eee6d1c 100644 --- a/_Documentation/phpDocumentator/default/_shared---ez_sql_core_2.1_debughack_0.2alpha.php.html +++ b/_Documentation/phpDocumentator/default/_shared---ez_sql_core_2.1_debughack_0.2alpha.php.html @@ -54,7 +54,7 @@

    /shared/ez_sql_core_2.1_debughack_0.2alpha.php

    - Documentation generated on Sun, 01 Apr 2012 23:51:55 +0200 by phpDocumentor 1.4.4 + Documentation generated on Fri, 06 Apr 2012 01:26:20 +0200 by phpDocumentor 1.4.4

    \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/_shared---ez_sql_core_202console.php.html b/_Documentation/phpDocumentator/default/_shared---ez_sql_core_202console.php.html index 1e234fb6..45864809 100644 --- a/_Documentation/phpDocumentator/default/_shared---ez_sql_core_202console.php.html +++ b/_Documentation/phpDocumentator/default/_shared---ez_sql_core_202console.php.html @@ -54,7 +54,7 @@

    /shared/ez_sql_core_202console.php

    - Documentation generated on Sun, 01 Apr 2012 23:51:55 +0200 by phpDocumentor 1.4.4 + Documentation generated on Fri, 06 Apr 2012 01:26:20 +0200 by phpDocumentor 1.4.4

    \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/ezSQL_codeigniterTest.html b/_Documentation/phpDocumentator/default/ezSQL_codeigniterTest.html new file mode 100644 index 00000000..b3258454 --- /dev/null +++ b/_Documentation/phpDocumentator/default/ezSQL_codeigniterTest.html @@ -0,0 +1,255 @@ + + + + + + Docs For Class ezSQL_codeigniterTest + + + + +
    +

    Class ezSQL_codeigniterTest

    + + +
    +
    Description
    + +
    + +

    Test class for ezSQL_codeigniter.

    +

    Generated by PHPUnit on 2012-04-02 at 00:25:20.

    +

    + Located in /_Test/unit_tests/codeigniter/ezSQL_codeigniterTest.php (line 10) +

    + + +
    PHPUnit_Framework_TestCase
    +   |
    +   --ezSQL_codeigniterTest
    + +
    +
    + + + + +
    +
    Variable Summary
    + +
    + +
    +
    + + +
    +
    Method Summary
    + +
    +
    + +
    + void + setUp + () +
    +
    + void + tearDown + () +
    +
    + void + testEscape + () +
    +
    + void + testQuery + () +
    +
    +
    +
    + + +
    +
    Variables
    + +
    + +
    + +
    + + ezSQL_codeigniter + $object + (line 15) + +
    + + +
      +
    • access: protected
    • +
    + + + + + +
    + +
    +
    + + +
    +
    Methods
    + +
    + + + +
    + +
    + setUp (line 21) +
    + + +

    Sets up the fixture, for example, opens a network connection.

    +

    This method is called before a test is executed.

    +
      +
    • access: protected
    • +
    + +
    + void + + setUp + + () +
    + + + +
    + +
    + +
    + tearDown (line 29) +
    + + +

    Tears down the fixture, for example, closes a network connection.

    +

    This method is called after a test is executed.

    +
      +
    • access: protected
    • +
    + +
    + void + + tearDown + + () +
    + + + +
    + +
    + +
    + testEscape (line 48) +
    + + +
      +
    • todo: Implement testEscape().
    • +
    • access: public
    • +
    + +
    + void + + testEscape + + () +
    + + + +
    + +
    + +
    + testQuery (line 37) +
    + + +
      +
    • todo: Implement testQuery().
    • +
    • access: public
    • +
    + +
    + void + + testQuery + + () +
    + + + +
    + +
    +
    + + +

    + Documentation generated on Fri, 06 Apr 2012 01:26:19 +0200 by phpDocumentor 1.4.4 +

    +
    + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/ezSQL_mssqlTest.html b/_Documentation/phpDocumentator/default/ezSQL_mssqlTest.html new file mode 100644 index 00000000..ad7e056d --- /dev/null +++ b/_Documentation/phpDocumentator/default/ezSQL_mssqlTest.html @@ -0,0 +1,458 @@ + + + + + + Docs For Class ezSQL_mssqlTest + + + + +
    +

    Class ezSQL_mssqlTest

    + + +
    +
    Description
    + +
    + +

    Test class for ezSQL_mssql.

    +

    Generated by PHPUnit on 2012-04-02 at 00:23:05.

    +

    + Located in /_Test/unit_tests/mssql/ezSQL_mssqlTest.php (line 10) +

    + + +
    PHPUnit_Framework_TestCase
    +   |
    +   --ezSQL_mssqlTest
    + +
    +
    + + + + +
    +
    Variable Summary
    + +
    +
    + +
    +
    +
    + + +
    +
    Method Summary
    + +
    +
    + +
    + void + setUp + () +
    +
    + void + tearDown + () +
    +
    + void + testConnect + () +
    +
    + void + testConvertMySqlToMSSql + () +
    +
    + void + testDisconnect + () +
    +
    + void + testEscape + () +
    +
    + void + testGetDBHost + () +
    +
    + void + testQuery + () +
    +
    + void + testQuick_connect + () +
    +
    + void + testSelect + () +
    +
    + void + testSysdate + () +
    +
    +
    +
    + + +
    +
    Variables
    + +
    + +
    + +
    + + ezSQL_mssql + $object + (line 15) + +
    + + +
      +
    • access: protected
    • +
    + + + + + +
    + +
    +
    + + +
    +
    Methods
    + +
    + + + +
    + +
    + setUp (line 21) +
    + + +

    Sets up the fixture, for example, opens a network connection.

    +

    This method is called before a test is executed.

    +
      +
    • access: protected
    • +
    + +
    + void + + setUp + + () +
    + + + +
    + +
    + +
    + tearDown (line 29) +
    + + +

    Tears down the fixture, for example, closes a network connection.

    +

    This method is called after a test is executed.

    +
      +
    • access: protected
    • +
    + +
    + void + + tearDown + + () +
    + + + +
    + +
    + +
    + testConnect (line 48) +
    + + +
      +
    • todo: Implement testConnect().
    • +
    • access: public
    • +
    + +
    + void + + testConnect + + () +
    + + + +
    + +
    + +
    + testConvertMySqlToMSSql (line 103) +
    + + +
      +
    • todo: Implement testConvertMySqlToMSSql().
    • +
    • access: public
    • +
    + +
    + void + + testConvertMySqlToMSSql + + () +
    + + + +
    + +
    + +
    + testDisconnect (line 114) +
    + + +
      +
    • todo: Implement testDisconnect().
    • +
    • access: public
    • +
    + +
    + void + + testDisconnect + + () +
    + + + +
    + +
    + +
    + testEscape (line 70) +
    + + +
      +
    • todo: Implement testEscape().
    • +
    • access: public
    • +
    + +
    + void + + testEscape + + () +
    + + + +
    + +
    + +
    + testGetDBHost (line 125) +
    + + +
      +
    • todo: Implement testGetDBHost().
    • +
    • access: public
    • +
    + +
    + void + + testGetDBHost + + () +
    + + + +
    + +
    + +
    + testQuery (line 92) +
    + + +
      +
    • todo: Implement testQuery().
    • +
    • access: public
    • +
    + +
    + void + + testQuery + + () +
    + + + +
    + +
    + +
    + testQuick_connect (line 37) +
    + + +
      +
    • todo: Implement testQuick_connect().
    • +
    • access: public
    • +
    + +
    + void + + testQuick_connect + + () +
    + + + +
    + +
    + +
    + testSelect (line 59) +
    + + +
      +
    • todo: Implement testSelect().
    • +
    • access: public
    • +
    + +
    + void + + testSelect + + () +
    + + + +
    + +
    + +
    + testSysdate (line 81) +
    + + +
      +
    • todo: Implement testSysdate().
    • +
    • access: public
    • +
    + +
    + void + + testSysdate + + () +
    + + + +
    + +
    +
    + + +

    + Documentation generated on Fri, 06 Apr 2012 01:26:19 +0200 by phpDocumentor 1.4.4 +

    +
    + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/ezSQL_oracle8_9Test.html b/_Documentation/phpDocumentator/default/ezSQL_oracle8_9Test.html new file mode 100644 index 00000000..2046e574 --- /dev/null +++ b/_Documentation/phpDocumentator/default/ezSQL_oracle8_9Test.html @@ -0,0 +1,545 @@ + + + + + + Docs For Class ezSQL_oracle8_9Test + + + + +
    +

    Class ezSQL_oracle8_9Test

    + + +
    +
    Description
    + +
    + +

    Test class for ezSQL_oracle8_9.

    +

    Generated by PHPUnit on 2012-04-02 at 00:24:07.

    +

    + Located in /_Test/unit_tests/oracle8_9/ezSQL_oracle8_9Test.php (line 10) +

    + + +
    PHPUnit_Framework_TestCase
    +   |
    +   --ezSQL_oracle8_9Test
    + +
    +
    + + + + +
    +
    Variable Summary
    + +
    + +
    +
    + + +
    +
    Method Summary
    + +
    +
    + +
    + void + setUp + () +
    +
    + void + tearDown + () +
    +
    + void + testConnect + () +
    +
    + void + testDisconnect + () +
    +
    + void + testEscape + () +
    +
    + void + testGetDBName + () +
    +
    + void + testInsert_id + () +
    +
    + void + testIs_equal_int + () +
    +
    + void + testIs_equal_str + () +
    +
    + void + testNextVal + () +
    +
    + void + testQuery + () +
    +
    + void + testQuick_connect + () +
    +
    + void + testSelect + () +
    +
    + void + testSysdate + () +
    +
    +
    +
    + + +
    +
    Variables
    + +
    + +
    + +
    + + ezSQL_oracle8_9 + $object + (line 15) + +
    + + +
      +
    • access: protected
    • +
    + + + + + +
    + +
    +
    + + +
    +
    Methods
    + +
    + + + +
    + +
    + setUp (line 21) +
    + + +

    Sets up the fixture, for example, opens a network connection.

    +

    This method is called before a test is executed.

    +
      +
    • access: protected
    • +
    + +
    + void + + setUp + + () +
    + + + +
    + +
    + +
    + tearDown (line 29) +
    + + +

    Tears down the fixture, for example, closes a network connection.

    +

    This method is called after a test is executed.

    +
      +
    • access: protected
    • +
    + +
    + void + + tearDown + + () +
    + + + +
    + +
    + +
    + testConnect (line 37) +
    + + +
      +
    • todo: Implement testConnect().
    • +
    • access: public
    • +
    + +
    + void + + testConnect + + () +
    + + + +
    + +
    + +
    + testDisconnect (line 147) +
    + + +
      +
    • todo: Implement testDisconnect().
    • +
    • access: public
    • +
    + +
    + void + + testDisconnect + + () +
    + + + +
    + +
    + +
    + testEscape (line 70) +
    + + +
      +
    • todo: Implement testEscape().
    • +
    • access: public
    • +
    + +
    + void + + testEscape + + () +
    + + + +
    + +
    + +
    + testGetDBName (line 158) +
    + + +
      +
    • todo: Implement testGetDBName().
    • +
    • access: public
    • +
    + +
    + void + + testGetDBName + + () +
    + + + +
    + +
    + +
    + testInsert_id (line 114) +
    + + +
      +
    • todo: Implement testInsert_id().
    • +
    • access: public
    • +
    + +
    + void + + testInsert_id + + () +
    + + + +
    + +
    + +
    + testIs_equal_int (line 103) +
    + + +
      +
    • todo: Implement testIs_equal_int().
    • +
    • access: public
    • +
    + +
    + void + + testIs_equal_int + + () +
    + + + +
    + +
    + +
    + testIs_equal_str (line 92) +
    + + +
      +
    • todo: Implement testIs_equal_str().
    • +
    • access: public
    • +
    + +
    + void + + testIs_equal_str + + () +
    + + + +
    + +
    + +
    + testNextVal (line 125) +
    + + +
      +
    • todo: Implement testNextVal().
    • +
    • access: public
    • +
    + +
    + void + + testNextVal + + () +
    + + + +
    + +
    + +
    + testQuery (line 136) +
    + + +
      +
    • todo: Implement testQuery().
    • +
    • access: public
    • +
    + +
    + void + + testQuery + + () +
    + + + +
    + +
    + +
    + testQuick_connect (line 48) +
    + + +
      +
    • todo: Implement testQuick_connect().
    • +
    • access: public
    • +
    + +
    + void + + testQuick_connect + + () +
    + + + +
    + +
    + +
    + testSelect (line 59) +
    + + +
      +
    • todo: Implement testSelect().
    • +
    • access: public
    • +
    + +
    + void + + testSelect + + () +
    + + + +
    + +
    + +
    + testSysdate (line 81) +
    + + +
      +
    • todo: Implement testSysdate().
    • +
    • access: public
    • +
    + +
    + void + + testSysdate + + () +
    + + + +
    + +
    +
    + + +

    + Documentation generated on Fri, 06 Apr 2012 01:26:19 +0200 by phpDocumentor 1.4.4 +

    +
    + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/ezSQL_sqliteTest.html b/_Documentation/phpDocumentator/default/ezSQL_sqliteTest.html new file mode 100644 index 00000000..5f4be2a1 --- /dev/null +++ b/_Documentation/phpDocumentator/default/ezSQL_sqliteTest.html @@ -0,0 +1,400 @@ + + + + + + Docs For Class ezSQL_sqliteTest + + + + +
    +

    Class ezSQL_sqliteTest

    + + +
    +
    Description
    + +
    + +

    Test class for ezSQL_sqlite.

    +

    Generated by PHPUnit on 2012-04-02 at 00:23:35.

    +

    + Located in /_Test/unit_tests/sqlite/ezSQL_sqliteTest.php (line 10) +

    + + +
    PHPUnit_Framework_TestCase
    +   |
    +   --ezSQL_sqliteTest
    + +
    +
    + + + + +
    +
    Variable Summary
    + +
    +
    + +
    +
    +
    + + +
    +
    Method Summary
    + +
    +
    + +
    + void + setUp + () +
    +
    + void + tearDown + () +
    +
    + void + testConnect + () +
    +
    + void + testDisconnect + () +
    +
    + void + testEscape + () +
    +
    + void + testQuery + () +
    +
    + void + testQuick_connect + () +
    +
    + void + testSelect + () +
    +
    + void + testSysdate + () +
    +
    +
    +
    + + +
    +
    Variables
    + +
    + +
    + +
    + + ezSQL_sqlite + $object + (line 15) + +
    + + +
      +
    • access: protected
    • +
    + + + + + +
    + +
    +
    + + +
    +
    Methods
    + +
    + + + +
    + +
    + setUp (line 21) +
    + + +

    Sets up the fixture, for example, opens a network connection.

    +

    This method is called before a test is executed.

    +
      +
    • access: protected
    • +
    + +
    + void + + setUp + + () +
    + + + +
    + +
    + +
    + tearDown (line 29) +
    + + +

    Tears down the fixture, for example, closes a network connection.

    +

    This method is called after a test is executed.

    +
      +
    • access: protected
    • +
    + +
    + void + + tearDown + + () +
    + + + +
    + +
    + +
    + testConnect (line 37) +
    + + +
      +
    • todo: Implement testConnect().
    • +
    • access: public
    • +
    + +
    + void + + testConnect + + () +
    + + + +
    + +
    + +
    + testDisconnect (line 103) +
    + + +
      +
    • todo: Implement testDisconnect().
    • +
    • access: public
    • +
    + +
    + void + + testDisconnect + + () +
    + + + +
    + +
    + +
    + testEscape (line 70) +
    + + +
      +
    • todo: Implement testEscape().
    • +
    • access: public
    • +
    + +
    + void + + testEscape + + () +
    + + + +
    + +
    + +
    + testQuery (line 92) +
    + + +
      +
    • todo: Implement testQuery().
    • +
    • access: public
    • +
    + +
    + void + + testQuery + + () +
    + + + +
    + +
    + +
    + testQuick_connect (line 48) +
    + + +
      +
    • todo: Implement testQuick_connect().
    • +
    • access: public
    • +
    + +
    + void + + testQuick_connect + + () +
    + + + +
    + +
    + +
    + testSelect (line 59) +
    + + +
      +
    • todo: Implement testSelect().
    • +
    • access: public
    • +
    + +
    + void + + testSelect + + () +
    + + + +
    + +
    + +
    + testSysdate (line 81) +
    + + +
      +
    • todo: Implement testSysdate().
    • +
    • access: public
    • +
    + +
    + void + + testSysdate + + () +
    + + + +
    + +
    +
    + + +

    + Documentation generated on Fri, 06 Apr 2012 01:26:20 +0200 by phpDocumentor 1.4.4 +

    +
    + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/ezSQL_sybaseTest.html b/_Documentation/phpDocumentator/default/ezSQL_sybaseTest.html new file mode 100644 index 00000000..90cae5a1 --- /dev/null +++ b/_Documentation/phpDocumentator/default/ezSQL_sybaseTest.html @@ -0,0 +1,458 @@ + + + + + + Docs For Class ezSQL_sybaseTest + + + + +
    +

    Class ezSQL_sybaseTest

    + + +
    +
    Description
    + +
    + +

    Test class for ezSQL_sybase.

    +

    Generated by PHPUnit on 2012-04-02 at 00:23:50.

    +

    + Located in /_Test/unit_tests/sybase/ezSQL_sybaseTest.php (line 10) +

    + + +
    PHPUnit_Framework_TestCase
    +   |
    +   --ezSQL_sybaseTest
    + +
    +
    + + + + +
    +
    Variable Summary
    + +
    +
    + +
    +
    +
    + + +
    +
    Method Summary
    + +
    +
    + +
    + void + setUp + () +
    +
    + void + tearDown + () +
    +
    + void + testConnect + () +
    +
    + void + testConvertMySqlTosybase + () +
    +
    + void + testDisconnect + () +
    +
    + void + testEscape + () +
    +
    + void + testGetDBHost + () +
    +
    + void + testQuery + () +
    +
    + void + testQuick_connect + () +
    +
    + void + testSelect + () +
    +
    + void + testSysdate + () +
    +
    +
    +
    + + +
    +
    Variables
    + +
    + +
    + +
    + + ezSQL_sybase + $object + (line 15) + +
    + + +
      +
    • access: protected
    • +
    + + + + + +
    + +
    +
    + + +
    +
    Methods
    + +
    + + + +
    + +
    + setUp (line 21) +
    + + +

    Sets up the fixture, for example, opens a network connection.

    +

    This method is called before a test is executed.

    +
      +
    • access: protected
    • +
    + +
    + void + + setUp + + () +
    + + + +
    + +
    + +
    + tearDown (line 29) +
    + + +

    Tears down the fixture, for example, closes a network connection.

    +

    This method is called after a test is executed.

    +
      +
    • access: protected
    • +
    + +
    + void + + tearDown + + () +
    + + + +
    + +
    + +
    + testConnect (line 48) +
    + + +
      +
    • todo: Implement testConnect().
    • +
    • access: public
    • +
    + +
    + void + + testConnect + + () +
    + + + +
    + +
    + +
    + testConvertMySqlTosybase (line 103) +
    + + +
      +
    • todo: Implement testConvertMySqlTosybase().
    • +
    • access: public
    • +
    + +
    + void + + testConvertMySqlTosybase + + () +
    + + + +
    + +
    + +
    + testDisconnect (line 114) +
    + + +
      +
    • todo: Implement testDisconnect().
    • +
    • access: public
    • +
    + +
    + void + + testDisconnect + + () +
    + + + +
    + +
    + +
    + testEscape (line 70) +
    + + +
      +
    • todo: Implement testEscape().
    • +
    • access: public
    • +
    + +
    + void + + testEscape + + () +
    + + + +
    + +
    + +
    + testGetDBHost (line 125) +
    + + +
      +
    • todo: Implement testGetDBHost().
    • +
    • access: public
    • +
    + +
    + void + + testGetDBHost + + () +
    + + + +
    + +
    + +
    + testQuery (line 92) +
    + + +
      +
    • todo: Implement testQuery().
    • +
    • access: public
    • +
    + +
    + void + + testQuery + + () +
    + + + +
    + +
    + +
    + testQuick_connect (line 37) +
    + + +
      +
    • todo: Implement testQuick_connect().
    • +
    • access: public
    • +
    + +
    + void + + testQuick_connect + + () +
    + + + +
    + +
    + +
    + testSelect (line 59) +
    + + +
      +
    • todo: Implement testSelect().
    • +
    • access: public
    • +
    + +
    + void + + testSelect + + () +
    + + + +
    + +
    + +
    + testSysdate (line 81) +
    + + +
      +
    • todo: Implement testSysdate().
    • +
    • access: public
    • +
    + +
    + void + + testSysdate + + () +
    + + + +
    + +
    +
    + + +

    + Documentation generated on Fri, 06 Apr 2012 01:26:20 +0200 by phpDocumentor 1.4.4 +

    +
    + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/ezSQLcore.html b/_Documentation/phpDocumentator/default/ezSQLcore.html index 03451286..abeb247a 100644 --- a/_Documentation/phpDocumentator/default/ezSQLcore.html +++ b/_Documentation/phpDocumentator/default/ezSQLcore.html @@ -252,7 +252,7 @@

    Class ezSQLcore

    -
    +
    @@ -270,7 +270,7 @@

    Class ezSQLcore

    -
    +
    @@ -288,7 +288,7 @@

    Class ezSQLcore

    -
    +
    @@ -306,7 +306,7 @@

    Class ezSQLcore

    -
    +
    @@ -324,7 +324,7 @@

    Class ezSQLcore

    -
    +
    @@ -342,7 +342,7 @@

    Class ezSQLcore

    -
    +
    @@ -360,7 +360,7 @@

    Class ezSQLcore

    -
    +
    @@ -378,7 +378,7 @@

    Class ezSQLcore

    -
    +
    @@ -396,7 +396,7 @@

    Class ezSQLcore

    -
    +
    @@ -414,7 +414,7 @@

    Class ezSQLcore

    -
    +
    @@ -432,7 +432,7 @@

    Class ezSQLcore

    -
    +
    @@ -450,7 +450,7 @@

    Class ezSQLcore

    -
    +
    @@ -468,7 +468,7 @@

    Class ezSQLcore

    -
    +
    @@ -486,7 +486,7 @@

    Class ezSQLcore

    -
    +
    @@ -504,7 +504,7 @@

    Class ezSQLcore

    -
    +
    @@ -522,7 +522,7 @@

    Class ezSQLcore

    -
    +
    @@ -556,7 +556,7 @@

    Class ezSQLcore

    -
    +
    Constructor ezSQLcore (line 70) @@ -578,7 +578,7 @@

    Class ezSQLcore

    -
    +
    connect (line 78) @@ -600,7 +600,7 @@

    Class ezSQLcore

    -
    +
    debug (line 460) @@ -627,7 +627,7 @@

    Class ezSQLcore

    -
    +
    donation (line 556) @@ -649,7 +649,7 @@

    Class ezSQLcore

    -
    +
    dumpvar (line 444) @@ -676,7 +676,7 @@

    Class ezSQLcore

    -
    +
    escape (line 106) @@ -698,7 +698,7 @@

    Class ezSQLcore

    -
    +
    flush (line 156) @@ -720,7 +720,7 @@

    Class ezSQLcore

    -
    +
    get_cache (line 370) @@ -747,7 +747,7 @@

    Class ezSQLcore

    -
    +
    get_col (line 235) @@ -777,7 +777,7 @@

    Class ezSQLcore

    -
    +
    get_col_info (line 308) @@ -807,7 +807,7 @@

    Class ezSQLcore

    -
    +
    get_results (line 258) @@ -837,7 +837,7 @@

    Class ezSQLcore

    -
    +
    get_row (line 195) @@ -870,7 +870,7 @@

    Class ezSQLcore

    -
    +
    get_var (line 169) @@ -903,7 +903,7 @@

    Class ezSQLcore

    -
    +
    hide_errors (line 147) @@ -923,7 +923,7 @@

    Class ezSQLcore

    -
    +
    query (line 96) @@ -945,7 +945,7 @@

    Class ezSQLcore

    -
    +
    register_error (line 125) @@ -972,7 +972,7 @@

    Class ezSQLcore

    -
    +
    select (line 87) @@ -994,7 +994,7 @@

    Class ezSQLcore

    -
    +
    show_errors (line 142) @@ -1015,7 +1015,7 @@

    Class ezSQLcore

    -
    +
    store_cache (line 336) @@ -1045,7 +1045,7 @@

    Class ezSQLcore

    -
    +
    sysdate (line 116) @@ -1067,7 +1067,7 @@

    Class ezSQLcore

    -
    +
    vardump (line 413) @@ -1099,7 +1099,7 @@

    Class ezSQLcore

    - Documentation generated on Sun, 01 Apr 2012 23:51:55 +0200 by phpDocumentor 1.4.4 + Documentation generated on Fri, 06 Apr 2012 01:26:20 +0200 by phpDocumentor 1.4.4

    \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/ezSQLcoreTest.html b/_Documentation/phpDocumentator/default/ezSQLcoreTest.html new file mode 100644 index 00000000..7a03f914 --- /dev/null +++ b/_Documentation/phpDocumentator/default/ezSQLcoreTest.html @@ -0,0 +1,777 @@ + + + + + + Docs For Class ezSQLcoreTest + + + + +
    +

    Class ezSQLcoreTest

    + + +
    +
    Description
    + +
    + +

    Test class for ezSQLcore.

    +

    Generated by PHPUnit on 2012-04-02 at 00:15:51.

    +

    + Located in /_Test/unit_tests/shared/ezSQLcoreTest.php (line 9) +

    + + +
    PHPUnit_Framework_TestCase
    +   |
    +   --ezSQLcoreTest
    + +
    +
    + + + + +
    +
    Variable Summary
    + +
    +
    + +
    +
    +
    + + +
    +
    Method Summary
    + +
    +
    + +
    + void + setUp + () +
    +
    + void + tearDown + () +
    +
    + void + testDebug + () +
    +
    + void + testDonation + () +
    +
    + void + testDumpvar + () +
    +
    + void + testFlush + () +
    +
    + void + testGet_cache + () +
    +
    + void + testGet_col + () +
    +
    + void + testGet_col_info + () +
    +
    + void + testGet_results + () +
    +
    + void + testGet_row + () +
    +
    + void + testGet_set + () +
    +
    + void + testGet_var + () +
    +
    + void + testHide_errors + () +
    +
    + void + testRegister_error + () +
    +
    + void + testShow_errors + () +
    +
    + void + testStore_cache + () +
    +
    + void + testTimer_elapsed + () +
    +
    + void + testTimer_get_cur + () +
    +
    + void + testTimer_start + () +
    +
    + void + testTimer_update_global + () +
    +
    + void + testVardump + () +
    +
    +
    +
    + + +
    +
    Variables
    + +
    + +
    + +
    + + ezSQLcore + $object + (line 14) + +
    + + +
      +
    • access: protected
    • +
    + + + + + +
    + +
    +
    + + +
    +
    Methods
    + +
    + + + +
    + +
    + setUp (line 20) +
    + + +

    Sets up the fixture, for example, opens a network connection.

    +

    This method is called before a test is executed.

    +
      +
    • access: protected
    • +
    + +
    + void + + setUp + + () +
    + + + +
    + +
    + +
    + tearDown (line 28) +
    + + +

    Tears down the fixture, for example, closes a network connection.

    +

    This method is called after a test is executed.

    +
      +
    • access: protected
    • +
    + +
    + void + + tearDown + + () +
    + + + +
    + +
    + +
    + testDebug (line 179) +
    + + +
      +
    • todo: Implement testDebug().
    • +
    • access: public
    • +
    + +
    + void + + testDebug + + () +
    + + + +
    + +
    + +
    + testDonation (line 190) +
    + + +
      +
    • todo: Implement testDonation().
    • +
    • access: public
    • +
    + +
    + void + + testDonation + + () +
    + + + +
    + +
    + +
    + testDumpvar (line 168) +
    + + +
      +
    • todo: Implement testDumpvar().
    • +
    • access: public
    • +
    + +
    + void + + testDumpvar + + () +
    + + + +
    + +
    + +
    + testFlush (line 69) +
    + + +
      +
    • todo: Implement testFlush().
    • +
    • access: public
    • +
    + +
    + void + + testFlush + + () +
    + + + +
    + +
    + +
    + testGet_cache (line 146) +
    + + +
      +
    • todo: Implement testGet_cache().
    • +
    • access: public
    • +
    + +
    + void + + testGet_cache + + () +
    + + + +
    + +
    + +
    + testGet_col (line 102) +
    + + +
      +
    • todo: Implement testGet_col().
    • +
    • access: public
    • +
    + +
    + void + + testGet_col + + () +
    + + + +
    + +
    + +
    + testGet_col_info (line 124) +
    + + +
      +
    • todo: Implement testGet_col_info().
    • +
    • access: public
    • +
    + +
    + void + + testGet_col_info + + () +
    + + + +
    + +
    + +
    + testGet_results (line 113) +
    + + +
      +
    • todo: Implement testGet_results().
    • +
    • access: public
    • +
    + +
    + void + + testGet_results + + () +
    + + + +
    + +
    + +
    + testGet_row (line 91) +
    + + +
      +
    • todo: Implement testGet_row().
    • +
    • access: public
    • +
    + +
    + void + + testGet_row + + () +
    + + + +
    + +
    + +
    + testGet_set (line 245) +
    + + +
      +
    • todo: Implement testGet_set().
    • +
    • access: public
    • +
    + +
    + void + + testGet_set + + () +
    + + + +
    + +
    + +
    + testGet_var (line 80) +
    + + +
      +
    • todo: Implement testGet_var().
    • +
    • access: public
    • +
    + +
    + void + + testGet_var + + () +
    + + + +
    + +
    + +
    + testHide_errors (line 58) +
    + + +
      +
    • todo: Implement testHide_errors().
    • +
    • access: public
    • +
    + +
    + void + + testHide_errors + + () +
    + + + +
    + +
    + +
    + testRegister_error (line 36) +
    + + +
      +
    • todo: Implement testRegister_error().
    • +
    • access: public
    • +
    + +
    + void + + testRegister_error + + () +
    + + + +
    + +
    + +
    + testShow_errors (line 47) +
    + + +
      +
    • todo: Implement testShow_errors().
    • +
    • access: public
    • +
    + +
    + void + + testShow_errors + + () +
    + + + +
    + +
    + +
    + testStore_cache (line 135) +
    + + +
      +
    • todo: Implement testStore_cache().
    • +
    • access: public
    • +
    + +
    + void + + testStore_cache + + () +
    + + + +
    + +
    + +
    + testTimer_elapsed (line 223) +
    + + +
      +
    • todo: Implement testTimer_elapsed().
    • +
    • access: public
    • +
    + +
    + void + + testTimer_elapsed + + () +
    + + + +
    + +
    + +
    + testTimer_get_cur (line 201) +
    + + +
      +
    • todo: Implement testTimer_get_cur().
    • +
    • access: public
    • +
    + +
    + void + + testTimer_get_cur + + () +
    + + + +
    + +
    + +
    + testTimer_start (line 212) +
    + + +
      +
    • todo: Implement testTimer_start().
    • +
    • access: public
    • +
    + +
    + void + + testTimer_start + + () +
    + + + +
    + +
    + +
    + testTimer_update_global (line 234) +
    + + +
      +
    • todo: Implement testTimer_update_global().
    • +
    • access: public
    • +
    + +
    + void + + testTimer_update_global + + () +
    + + + +
    + +
    + +
    + testVardump (line 157) +
    + + +
      +
    • todo: Implement testVardump().
    • +
    • access: public
    • +
    + +
    + void + + testVardump + + () +
    + + + +
    + +
    +
    + + +

    + Documentation generated on Fri, 06 Apr 2012 01:26:18 +0200 by phpDocumentor 1.4.4 +

    +
    + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/elementindex.html b/_Documentation/phpDocumentator/elementindex.html index 3d7ea822..ebcea5e9 100644 --- a/_Documentation/phpDocumentator/elementindex.html +++ b/_Documentation/phpDocumentator/elementindex.html @@ -110,14 +110,14 @@

    Package indexes

    $cache_timeout
    -
    ezSQLcore::$cache_timeout in ez_sql_core_202console.php
    + +
    The cache timeout in hours
    $cache_timeout
    - -
    The cache timeout in hours
    +
    ezSQLcore::$cache_timeout in ez_sql_core_202console.php
    $captured_errors @@ -136,14 +136,21 @@

    Package indexes

    $col_info
    -
    ezSQLcore::$col_info in ez_sql_core_202console.php
    + +
    The last column info
    $col_info
    - -
    The last column info
    +
    ezSQLcore::$col_info in ez_sql_core_202console.php
    +
    +
    + $connected +
    +
    + +
    Whether the database connection is established, or not
    catch_error @@ -156,57 +163,57 @@

    Package indexes

    connect
    -
    ezSQLcore::connect() in ez_sql_core_202console.php
    -
    ********************************************************************
    +
    ezSQL_mysql::connect() in ezSQL_mysql
    +
    Try to connect to mySQL database server
    connect
    - -
    Try to connect to the database server in the DSN parameters
    +
    ezSQL_mssql::connect() in ezSQL_mssql
    +
    Try to connect to mssql database server
    connect
    -
    ezSQL_mysql::connect() in ezSQL_mysql
    -
    Try to connect to mySQL database server
    +
    ezSQLcore::connect() in ez_sql_core_202console.php
    +
    ********************************************************************
    connect
    -
    ezSQL_mssql::connect() in ezSQL_mssql
    -
    Try to connect to mssql database server
    +
    ezSQL_oracle8_9::connect() in ezSQL_oracle8_9
    +
    Try to connect to Oracle database server
    connect
    -
    ezSQL_oracle8_9::connect() in ezSQL_oracle8_9
    -
    Try to connect to Oracle database server
    + +
    Try to connect to the database server in the DSN parameters
    connect
    -
    ezSQL_postgresql::connect() in ezSQL_postgresql
    -
    Try to connect to PostgreSQL database server
    +
    ezSQL_sqlite::connect() in ezSQL_sqlite
    +
    Try to connect to SQLite database server
    connect
    -
    ezSQL_sybase::connect() in ezSQL_sybase
    -
    Try to connect to sybase database server
    +
    ezSQL_postgresql::connect() in ezSQL_postgresql
    +
    Try to connect to PostgreSQL database server
    connect
    -
    ezSQL_sqlite::connect() in ezSQL_sqlite
    -
    Try to connect to SQLite database server
    +
    ezSQL_sybase::connect() in ezSQL_sybase
    +
    Try to connect to sybase database server
    ConvertMySqlToMSSql @@ -232,6 +239,13 @@

    Package indexes

    +
    + $dbh +
    +
    + +
    The database connection object
    +
    $db_connect_time
    @@ -244,6 +258,7 @@

    Package indexes

    ezSQL_codeigniter::$debug in ezSQL_codeigniter
    +
    Run in debug mode
    $debug_all @@ -337,7 +352,7 @@

    Package indexes

    disconnect
    - +
    Close the database connection
    @@ -351,14 +366,14 @@

    Package indexes

    disconnect
    - +
    Close the database connection
    disconnect
    - +
    Close the database connection
    @@ -419,36 +434,36 @@

    Package indexes

    escape
    -
    ezSQL_oracle8_9::escape() in ezSQL_oracle8_9
    -
    Format a Oracle string correctly for safe Oracle insert
    +
    ezSQL_sqlite::escape() in ezSQL_sqlite
    +
    Format a SQLite string correctly for safe SQLite insert (no matter if magic quotes are on or not)
    escape
    -
    ezSQL_sybase::escape() in ezSQL_sybase
    -
    Format a sybase string correctly for safe sybase insert
    +
    ezSQL_postgresql::escape() in ezSQL_postgresql
    +
    Format a mySQL string correctly for safe mySQL insert (no matter if magic quotes are on or not)
    escape
    -
    ezSQLcore::escape() in ez_sql_core_202console.php
    -
    ********************************************************************
    +
    ezSQL_mysql::escape() in ezSQL_mysql
    +
    Format a mySQL string correctly for safe mySQL insert (no matter if magic quotes are on or not)
    escape
    -
    ezSQL_pdo::escape() in ezSQL_pdo
    -
    Escape a string with the PDO method
    +
    ezSQL_oracle8_9::escape() in ezSQL_oracle8_9
    +
    Format a Oracle string correctly for safe Oracle insert
    escape
    -
    ezSQL_postgresql::escape() in ezSQL_postgresql
    -
    Format a mySQL string correctly for safe mySQL insert (no matter if magic quotes are on or not)
    +
    ezSQL_pdo::escape() in ezSQL_pdo
    +
    Escape a string with the PDO method
    escape @@ -461,15 +476,15 @@

    Package indexes

    escape
    -
    ezSQL_sqlite::escape() in ezSQL_sqlite
    -
    Format a SQLite string correctly for safe SQLite insert (no matter if magic quotes are on or not)
    +
    ezSQL_sybase::escape() in ezSQL_sybase
    +
    Format a sybase string correctly for safe sybase insert
    escape
    -
    ezSQL_mysql::escape() in ezSQL_mysql
    -
    Format a mySQL string correctly for safe mySQL insert (no matter if magic quotes are on or not)
    +
    ezSQLcore::escape() in ez_sql_core_202console.php
    +
    ********************************************************************
    escape @@ -499,6 +514,13 @@

    Package indexes

    ezSQLcore in ezSQL
    ezSQL Core module - database abstraction library to make it very easy to deal with databases. ezSQLcore can not be used by itself (it is designed for use by database specific modules).
    +
    + ezSQLcoreTest +
    +
    +
    ezSQLcoreTest in ezSQLcoreTest.php
    +
    Test class for ezSQLcore.
    +
    ezSQL_codeigniter
    @@ -506,6 +528,13 @@

    Package indexes

    ezSQL_codeigniter in ezSQL_codeigniter
    ezSQL Database specific class - codeigniter Desc..: codeigniter component (part of ezSQL databse abstraction library)
    +
    + ezSQL_codeigniterTest +
    +
    +
    ezSQL_codeigniterTest in ezSQL_codeigniterTest.php
    +
    Test class for ezSQL_codeigniter.
    +
    ezSQL_mssql
    @@ -513,6 +542,13 @@

    Package indexes

    ezSQL_mssql in ezSQL_mssql
    ezSQL Database specific class - mssql Microsoft Sql Server component (part of ezSQL databse abstraction library) - based on ezSql_mySql library class.
    +
    + ezSQL_mssqlTest +
    +
    +
    ezSQL_mssqlTest in ezSQL_mssqlTest.php
    +
    Test class for ezSQL_mssql.
    +
    ezSQL_mysql
    @@ -520,6 +556,13 @@

    Package indexes

    ezSQL_mysql in ezSQL_mysql
    ezSQL Database specific class - mySQL Desc..: mySQL component (part of ezSQL databse abstraction library)
    +
    + ezSQL_mysqlTest +
    +
    +
    ezSQL_mysqlTest in ezSQL_mysqlTest.php
    +
    Test class for ezSQL_mysql.
    +
    ezSQL_oracle8_9
    @@ -527,6 +570,13 @@

    Package indexes

    ezSQL_oracle8_9 in ezSQL_oracle8_9
    ezSQL Database specific class - Oracle 8 and 9 Desc..: Oracle 8i/9i component (part of ezSQL databse abstraction library)
    +
    + ezSQL_oracle8_9Test +
    +
    +
    ezSQL_oracle8_9Test in ezSQL_oracle8_9Test.php
    +
    Test class for ezSQL_oracle8_9.
    +
    ezSQL_pdo
    @@ -534,6 +584,13 @@

    Package indexes

    ezSQL_pdo in ezSQL_pdo
    ezSQL class - PDO Desc..: PDO component (part of ezSQL databse abstraction library)
    +
    + ezSQL_pdoTest +
    +
    +
    ezSQL_pdoTest in ezSQL_pdoTest.php
    +
    Test class for ezSQL_pdo.
    +
    ezSQL_postgresql
    @@ -541,6 +598,13 @@

    Package indexes

    ezSQL_postgresql in ezSQL_postgresql
    ezSQL Database specific class - PostgreSQL Desc..: PostgreSQL component (part of ezSQL databse abstraction library)
    +
    + ezSQL_postgresqlTest +
    +
    +
    ezSQL_postgresqlTest in ezSQL_postgresqlTest.php
    +
    Test class for ezSQL_postgresql.
    +
    ezSQL_sqlite
    @@ -548,6 +612,13 @@

    Package indexes

    ezSQL_sqlite in ezSQL_sqlite
    ezSQL class - SQLite Desc..: SQLite component (part of ezSQL databse abstraction library)
    +
    + ezSQL_sqliteTest +
    +
    +
    ezSQL_sqliteTest in ezSQL_sqliteTest.php
    +
    Test class for ezSQL_sqlite.
    +
    ezSQL_sybase
    @@ -555,6 +626,13 @@

    Package indexes

    ezSQL_sybase in ezSQL_sybase
    ezSQL class - Sybase ASE Desc..: Sybase ASE component (part of ezSQL database abstraction library) - based on ezSql_mssql library class.
    +
    + ezSQL_sybaseTest +
    +
    +
    ezSQL_sybaseTest in ezSQL_sybaseTest.php
    +
    Test class for ezSQL_sybase.
    +
    EZSQL_VERSION
    @@ -622,6 +700,60 @@

    Package indexes

    ezSQL_sybase in ezSQL_sybase
    +
    + ezSQL_codeigniterTest.php +
    +
    +
    ezSQL_codeigniterTest.php in ezSQL_codeigniterTest.php
    +
    +
    + ezSQL_mssqlTest.php +
    +
    +
    ezSQL_mssqlTest.php in ezSQL_mssqlTest.php
    +
    +
    + ezSQL_mysqlTest.php +
    +
    +
    ezSQL_mysqlTest.php in ezSQL_mysqlTest.php
    +
    +
    + ezSQL_oracle8_9Test.php +
    +
    +
    ezSQL_oracle8_9Test.php in ezSQL_oracle8_9Test.php
    +
    +
    + ezSQL_pdoTest.php +
    +
    +
    ezSQL_pdoTest.php in ezSQL_pdoTest.php
    +
    +
    + ezSQL_postgresqlTest.php +
    +
    +
    ezSQL_postgresqlTest.php in ezSQL_postgresqlTest.php
    +
    +
    + ezSQLcoreTest.php +
    +
    +
    ezSQLcoreTest.php in ezSQLcoreTest.php
    +
    +
    + ezSQL_sqliteTest.php +
    +
    +
    ezSQL_sqliteTest.php in ezSQL_sqliteTest.php
    +
    +
    + ezSQL_sybaseTest.php +
    +
    +
    ezSQL_sybaseTest.php in ezSQL_sybaseTest.php
    +
    @@ -828,6 +960,13 @@

    Package indexes

    ezSQL_oracle8_9::insert_id() in ezSQL_oracle8_9
    Another oracle specific function - if you have set up a sequence this function returns the next ID from that sequence If the sequence is not defined, the sequence is created by this method.
    +
    + isConnected +
    +
    + +
    Returns, whether a database connection is established, or not
    +
    is_equal_int
    @@ -912,6 +1051,60 @@

    Package indexes

    +
    + $object +
    +
    +
    ezSQL_pdoTest::$object in ezSQL_pdoTest.php
    +
    +
    + $object +
    +
    +
    ezSQL_postgresqlTest::$object in ezSQL_postgresqlTest.php
    +
    +
    + $object +
    +
    +
    ezSQL_sqliteTest::$object in ezSQL_sqliteTest.php
    +
    +
    + $object +
    +
    +
    ezSQL_sybaseTest::$object in ezSQL_sybaseTest.php
    +
    +
    + $object +
    +
    +
    ezSQL_oracle8_9Test::$object in ezSQL_oracle8_9Test.php
    +
    +
    + $object +
    +
    +
    ezSQL_mysqlTest::$object in ezSQL_mysqlTest.php
    +
    +
    + $object +
    +
    +
    ezSQLcoreTest::$object in ezSQLcoreTest.php
    +
    +
    + $object +
    +
    +
    ezSQL_codeigniterTest::$object in ezSQL_codeigniterTest.php
    +
    +
    + $object +
    +
    +
    ezSQL_mssqlTest::$object in ezSQL_mssqlTest.php
    +
    OBJECT
    @@ -1091,96 +1284,215 @@

    Package indexes

    ezSQLcore::$show_errors in ez_sql_core_202console.php
    - $sql_log_file + $show_errors
    - -
    Use a SQL log file
    + +
    Show errors
    - select + $show_errors
    -
    ezSQL_pdo::select() in ezSQL_pdo
    -
    With PDO it is only an alias for the connect method
    + +
    Show errors
    - select + $show_errors
    -
    ezSQL_sqlite::select() in ezSQL_sqlite
    -
    No real equivalent of mySQL select in SQLite once again, function included for the sake of consistency
    +
    ezSQL_postgresql::$show_errors in ezSQL_postgresql
    +
    Show errors
    - select + $show_errors
    -
    ezSQL_sybase::select() in ezSQL_sybase
    -
    Try to select a sybase database
    + +
    Show errors
    - select + $show_errors
    -
    ezSQLcore::select() in ez_sql_core_202console.php
    -
    ********************************************************************
    + +
    Show errors
    - select + $show_errors
    -
    ezSQL_oracle8_9::select() in ezSQL_oracle8_9
    -
    No real equivalent of mySQL select in Oracle, once again, function included for the sake of consistency
    + +
    Show errors
    - select + $show_errors
    -
    ezSQL_postgresql::select() in ezSQL_postgresql
    -
    No real equivalent of mySQL select in PostgreSQL once again, function included for the sake of consistency
    +
    ezSQL_codeigniter::$show_errors in ezSQL_codeigniter
    +
    Show errors
    - select + $show_errors
    -
    ezSQL_mssql::select() in ezSQL_mssql
    -
    Try to select a mssql database
    + +
    Show errors
    - select + $sql_log_file
    -
    ezSQL_mysql::select() in ezSQL_mysql
    -
    Try to select a mySQL database
    + +
    Use a SQL log file
    - showDatabases + select
    - -
    Return all databases of the current server
    +
    ezSQL_pdo::select() in ezSQL_pdo
    +
    With PDO it is only an alias for the connect method
    - showTables + select
    -
    ezSQL_postgresql::showTables() in ezSQL_postgresql
    -
    Return PostgreSQL specific values: Return all tables of the current schema
    +
    ezSQL_oracle8_9::select() in ezSQL_oracle8_9
    +
    No real equivalent of mySQL select in Oracle, once again, function included for the sake of consistency
    - show_errors + select
    - -
    Turn error handling on, by default error handling is on
    +
    ezSQL_sqlite::select() in ezSQL_sqlite
    +
    No real equivalent of mySQL select in SQLite once again, function included for the sake of consistency
    - show_errors + select +
    +
    +
    ezSQL_mssql::select() in ezSQL_mssql
    +
    Try to select a mssql database
    +
    +
    + select +
    +
    +
    ezSQL_postgresql::select() in ezSQL_postgresql
    +
    No real equivalent of mySQL select in PostgreSQL once again, function included for the sake of consistency
    +
    +
    + select +
    +
    +
    ezSQL_mysql::select() in ezSQL_mysql
    +
    Try to select a mySQL database
    +
    +
    + select +
    +
    +
    ezSQLcore::select() in ez_sql_core_202console.php
    +
    ********************************************************************
    +
    +
    + select +
    +
    +
    ezSQL_sybase::select() in ezSQL_sybase
    +
    Try to select a sybase database
    +
    +
    + setUp +
    +
    +
    ezSQL_postgresqlTest::setUp() in ezSQL_postgresqlTest.php
    +
    Sets up the fixture, for example, opens a network connection.
    +
    +
    + setUp +
    +
    +
    ezSQL_pdoTest::setUp() in ezSQL_pdoTest.php
    +
    Sets up the fixture, for example, opens a network connection.
    +
    +
    + setUp +
    +
    +
    ezSQL_oracle8_9Test::setUp() in ezSQL_oracle8_9Test.php
    +
    Sets up the fixture, for example, opens a network connection.
    +
    +
    + setUp +
    +
    +
    ezSQL_sqliteTest::setUp() in ezSQL_sqliteTest.php
    +
    Sets up the fixture, for example, opens a network connection.
    +
    +
    + setUp +
    +
    +
    ezSQL_codeigniterTest::setUp() in ezSQL_codeigniterTest.php
    +
    Sets up the fixture, for example, opens a network connection.
    +
    +
    + setUp +
    +
    +
    ezSQLcoreTest::setUp() in ezSQLcoreTest.php
    +
    Sets up the fixture, for example, opens a network connection.
    +
    +
    + setUp +
    +
    +
    ezSQL_mysqlTest::setUp() in ezSQL_mysqlTest.php
    +
    Sets up the fixture, for example, opens a network connection.
    +
    +
    + setUp +
    +
    +
    ezSQL_sybaseTest::setUp() in ezSQL_sybaseTest.php
    +
    Sets up the fixture, for example, opens a network connection.
    +
    +
    + setUp +
    +
    +
    ezSQL_mssqlTest::setUp() in ezSQL_mssqlTest.php
    +
    Sets up the fixture, for example, opens a network connection.
    +
    +
    + showDatabases +
    +
    + +
    Return all databases of the current server
    +
    +
    + showTables +
    +
    +
    ezSQL_postgresql::showTables() in ezSQL_postgresql
    +
    Return PostgreSQL specific values: Return all tables of the current schema
    +
    +
    + show_errors
    ezSQLcore::show_errors() in ez_sql_core_202console.php
    ******************************************************************** Turn error handling on or off..
    +
    + show_errors +
    +
    + +
    Turn error handling on, by default error handling is on
    +
    store_cache
    @@ -1206,29 +1518,29 @@

    Package indexes

    sysdate
    -
    ezSQL_sybase::sysdate() in ezSQL_sybase
    -
    Return sybase specific system date syntax i.e. Oracle: SYSDATE sybase: getDate()
    + +
    Return SQLite specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
    sysdate
    -
    ezSQL_mssql::sysdate() in ezSQL_mssql
    -
    Return mssql specific system date syntax i.e. Oracle: SYSDATE mssql: NOW(), MS-SQL : getDate()
    +
    ezSQL_mysql::sysdate() in ezSQL_mysql
    +
    Return mySQL specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
    sysdate
    -
    ezSQL_mysql::sysdate() in ezSQL_mysql
    -
    Return mySQL specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
    +
    ezSQL_mssql::sysdate() in ezSQL_mssql
    +
    Return mssql specific system date syntax i.e. Oracle: SYSDATE mssql: NOW(), MS-SQL : getDate()
    sysdate
    - -
    Return SQLite specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
    +
    ezSQL_oracle8_9::sysdate() in ezSQL_oracle8_9
    +
    Return Oracle specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
    sysdate @@ -1241,15 +1553,15 @@

    Package indexes

    sysdate
    -
    ezSQL_oracle8_9::sysdate() in ezSQL_oracle8_9
    -
    Return Oracle specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
    +
    ezSQL_sqlite::sysdate() in ezSQL_sqlite
    +
    Return SQLite specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
    sysdate
    -
    ezSQL_sqlite::sysdate() in ezSQL_sqlite
    -
    Return SQLite specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
    +
    ezSQL_sybase::sysdate() in ezSQL_sybase
    +
    Return sybase specific system date syntax i.e. Oracle: SYSDATE sybase: getDate()
    @@ -1277,14 +1589,14 @@

    Package indexes

    $trace
    - -
    same as $debug_all
    +
    ezSQLcore::$trace in ez_sql_core_202console.php
    $trace
    -
    ezSQLcore::$trace in ez_sql_core_202console.php
    + +
    same as $debug_all
    $trace_log @@ -1293,6 +1605,709 @@

    Package indexes

    The trace log
    +
    + tearDown +
    +
    +
    ezSQL_codeigniterTest::tearDown() in ezSQL_codeigniterTest.php
    +
    Tears down the fixture, for example, closes a network connection.
    +
    +
    + tearDown +
    +
    +
    ezSQL_sqliteTest::tearDown() in ezSQL_sqliteTest.php
    +
    Tears down the fixture, for example, closes a network connection.
    +
    +
    + tearDown +
    +
    +
    ezSQL_mssqlTest::tearDown() in ezSQL_mssqlTest.php
    +
    Tears down the fixture, for example, closes a network connection.
    +
    +
    + tearDown +
    +
    +
    ezSQL_sybaseTest::tearDown() in ezSQL_sybaseTest.php
    +
    Tears down the fixture, for example, closes a network connection.
    +
    +
    + tearDown +
    +
    +
    ezSQL_mysqlTest::tearDown() in ezSQL_mysqlTest.php
    +
    Tears down the fixture, for example, closes a network connection.
    +
    +
    + tearDown +
    +
    +
    ezSQL_oracle8_9Test::tearDown() in ezSQL_oracle8_9Test.php
    +
    Tears down the fixture, for example, closes a network connection.
    +
    +
    + tearDown +
    +
    +
    ezSQL_postgresqlTest::tearDown() in ezSQL_postgresqlTest.php
    +
    Tears down the fixture, for example, closes a network connection.
    +
    +
    + tearDown +
    +
    +
    ezSQLcoreTest::tearDown() in ezSQLcoreTest.php
    +
    Tears down the fixture, for example, closes a network connection.
    +
    +
    + tearDown +
    +
    +
    ezSQL_pdoTest::tearDown() in ezSQL_pdoTest.php
    +
    Tears down the fixture, for example, closes a network connection.
    +
    +
    + testCatch_error +
    +
    + +
    +
    + testConnect +
    +
    +
    ezSQL_postgresqlTest::testConnect() in ezSQL_postgresqlTest.php
    +
    +
    + testConnect +
    +
    +
    ezSQL_mysqlTest::testConnect() in ezSQL_mysqlTest.php
    +
    +
    + testConnect +
    +
    +
    ezSQL_oracle8_9Test::testConnect() in ezSQL_oracle8_9Test.php
    +
    +
    + testConnect +
    +
    +
    ezSQL_sqliteTest::testConnect() in ezSQL_sqliteTest.php
    +
    +
    + testConnect +
    +
    +
    ezSQL_sybaseTest::testConnect() in ezSQL_sybaseTest.php
    +
    +
    + testConnect +
    +
    +
    ezSQL_mssqlTest::testConnect() in ezSQL_mssqlTest.php
    +
    +
    + testConnect +
    +
    +
    ezSQL_pdoTest::testConnect() in ezSQL_pdoTest.php
    +
    +
    + testConvertMySqlToMSSql +
    +
    + +
    +
    + testConvertMySqlTosybase +
    +
    + +
    +
    + testDebug +
    +
    +
    ezSQLcoreTest::testDebug() in ezSQLcoreTest.php
    +
    +
    + testDescTable +
    +
    +
    ezSQL_postgresqlTest::testDescTable() in ezSQL_postgresqlTest.php
    +
    +
    + testDisconnect +
    +
    +
    ezSQL_mysqlTest::testDisconnect() in ezSQL_mysqlTest.php
    +
    +
    + testDisconnect +
    +
    +
    ezSQL_mssqlTest::testDisconnect() in ezSQL_mssqlTest.php
    +
    +
    + testDisconnect +
    +
    +
    ezSQL_oracle8_9Test::testDisconnect() in ezSQL_oracle8_9Test.php
    +
    +
    + testDisconnect +
    +
    +
    ezSQL_postgresqlTest::testDisconnect() in ezSQL_postgresqlTest.php
    +
    +
    + testDisconnect +
    +
    +
    ezSQL_pdoTest::testDisconnect() in ezSQL_pdoTest.php
    +
    +
    + testDisconnect +
    +
    +
    ezSQL_sybaseTest::testDisconnect() in ezSQL_sybaseTest.php
    +
    +
    + testDisconnect +
    +
    +
    ezSQL_sqliteTest::testDisconnect() in ezSQL_sqliteTest.php
    +
    +
    + testDonation +
    +
    +
    ezSQLcoreTest::testDonation() in ezSQLcoreTest.php
    +
    +
    + testDumpvar +
    +
    +
    ezSQLcoreTest::testDumpvar() in ezSQLcoreTest.php
    +
    +
    + testEscape +
    +
    +
    ezSQL_sybaseTest::testEscape() in ezSQL_sybaseTest.php
    +
    +
    + testEscape +
    +
    +
    ezSQL_mysqlTest::testEscape() in ezSQL_mysqlTest.php
    +
    +
    + testEscape +
    +
    +
    ezSQL_sqliteTest::testEscape() in ezSQL_sqliteTest.php
    +
    +
    + testEscape +
    +
    +
    ezSQL_pdoTest::testEscape() in ezSQL_pdoTest.php
    +
    +
    + testEscape +
    +
    +
    ezSQL_postgresqlTest::testEscape() in ezSQL_postgresqlTest.php
    +
    +
    + testEscape +
    +
    +
    ezSQL_oracle8_9Test::testEscape() in ezSQL_oracle8_9Test.php
    +
    +
    + testEscape +
    +
    +
    ezSQL_codeigniterTest::testEscape() in ezSQL_codeigniterTest.php
    +
    +
    + testEscape +
    +
    +
    ezSQL_mssqlTest::testEscape() in ezSQL_mssqlTest.php
    +
    +
    + testFlush +
    +
    +
    ezSQLcoreTest::testFlush() in ezSQLcoreTest.php
    +
    +
    + testGetCharset +
    +
    +
    ezSQL_mysqlTest::testGetCharset() in ezSQL_mysqlTest.php
    +
    +
    + testGetDBHost +
    +
    +
    ezSQL_postgresqlTest::testGetDBHost() in ezSQL_postgresqlTest.php
    +
    +
    + testGetDBHost +
    +
    +
    ezSQL_mysqlTest::testGetDBHost() in ezSQL_mysqlTest.php
    +
    +
    + testGetDBHost +
    +
    +
    ezSQL_sybaseTest::testGetDBHost() in ezSQL_sybaseTest.php
    +
    +
    + testGetDBHost +
    +
    +
    ezSQL_mssqlTest::testGetDBHost() in ezSQL_mssqlTest.php
    +
    +
    + testGetDBName +
    +
    +
    ezSQL_oracle8_9Test::testGetDBName() in ezSQL_oracle8_9Test.php
    +
    +
    + testGetPort +
    +
    +
    ezSQL_postgresqlTest::testGetPort() in ezSQL_postgresqlTest.php
    +
    +
    + testGet_cache +
    +
    +
    ezSQLcoreTest::testGet_cache() in ezSQLcoreTest.php
    +
    +
    + testGet_col +
    +
    +
    ezSQLcoreTest::testGet_col() in ezSQLcoreTest.php
    +
    +
    + testGet_col_info +
    +
    + +
    +
    + testGet_results +
    +
    + +
    +
    + testGet_row +
    +
    +
    ezSQLcoreTest::testGet_row() in ezSQLcoreTest.php
    +
    +
    + testGet_set +
    +
    +
    ezSQLcoreTest::testGet_set() in ezSQLcoreTest.php
    +
    +
    + testGet_var +
    +
    +
    ezSQLcoreTest::testGet_var() in ezSQLcoreTest.php
    +
    +
    + testHide_errors +
    +
    + +
    +
    + testInsert_id +
    +
    +
    ezSQL_oracle8_9Test::testInsert_id() in ezSQL_oracle8_9Test.php
    +
    +
    + testIs_equal_int +
    +
    +
    ezSQL_oracle8_9Test::testIs_equal_int() in ezSQL_oracle8_9Test.php
    +
    +
    + testIs_equal_str +
    +
    +
    ezSQL_oracle8_9Test::testIs_equal_str() in ezSQL_oracle8_9Test.php
    +
    +
    + testNextVal +
    +
    +
    ezSQL_oracle8_9Test::testNextVal() in ezSQL_oracle8_9Test.php
    +
    +
    + testQuery +
    +
    +
    ezSQL_codeigniterTest::testQuery() in ezSQL_codeigniterTest.php
    +
    +
    + testQuery +
    +
    +
    ezSQL_pdoTest::testQuery() in ezSQL_pdoTest.php
    +
    +
    + testQuery +
    +
    +
    ezSQL_sybaseTest::testQuery() in ezSQL_sybaseTest.php
    +
    +
    + testQuery +
    +
    +
    ezSQL_postgresqlTest::testQuery() in ezSQL_postgresqlTest.php
    +
    +
    + testQuery +
    +
    +
    ezSQL_oracle8_9Test::testQuery() in ezSQL_oracle8_9Test.php
    +
    +
    + testQuery +
    +
    +
    ezSQL_mysqlTest::testQuery() in ezSQL_mysqlTest.php
    +
    +
    + testQuery +
    +
    +
    ezSQL_mssqlTest::testQuery() in ezSQL_mssqlTest.php
    +
    +
    + testQuery +
    +
    +
    ezSQL_sqliteTest::testQuery() in ezSQL_sqliteTest.php
    +
    +
    + testQuick_connect +
    +
    + +
    +
    + testQuick_connect +
    +
    + +
    +
    + testQuick_connect +
    +
    +
    ezSQL_oracle8_9Test::testQuick_connect() in ezSQL_oracle8_9Test.php
    +
    +
    + testQuick_connect +
    +
    + +
    +
    + testQuick_connect +
    +
    +
    ezSQL_postgresqlTest::testQuick_connect() in ezSQL_postgresqlTest.php
    +
    +
    + testQuick_connect +
    +
    + +
    +
    + testQuick_connect +
    +
    + +
    +
    + testRegister_error +
    +
    + +
    +
    + testSelect +
    +
    +
    ezSQL_postgresqlTest::testSelect() in ezSQL_postgresqlTest.php
    +
    +
    + testSelect +
    +
    +
    ezSQL_oracle8_9Test::testSelect() in ezSQL_oracle8_9Test.php
    +
    +
    + testSelect +
    +
    +
    ezSQL_mysqlTest::testSelect() in ezSQL_mysqlTest.php
    +
    +
    + testSelect +
    +
    +
    ezSQL_sqliteTest::testSelect() in ezSQL_sqliteTest.php
    +
    +
    + testSelect +
    +
    +
    ezSQL_sybaseTest::testSelect() in ezSQL_sybaseTest.php
    +
    +
    + testSelect +
    +
    +
    ezSQL_pdoTest::testSelect() in ezSQL_pdoTest.php
    +
    +
    + testSelect +
    +
    +
    ezSQL_mssqlTest::testSelect() in ezSQL_mssqlTest.php
    +
    +
    + testShowDatabases +
    +
    +
    ezSQL_postgresqlTest::testShowDatabases() in ezSQL_postgresqlTest.php
    +
    +
    + testShowTables +
    +
    +
    ezSQL_postgresqlTest::testShowTables() in ezSQL_postgresqlTest.php
    +
    +
    + testShow_errors +
    +
    + +
    +
    + testStore_cache +
    +
    + +
    +
    + testSysdate +
    +
    +
    ezSQL_mysqlTest::testSysdate() in ezSQL_mysqlTest.php
    +
    +
    + testSysdate +
    +
    +
    ezSQL_oracle8_9Test::testSysdate() in ezSQL_oracle8_9Test.php
    +
    +
    + testSysdate +
    +
    +
    ezSQL_sqliteTest::testSysdate() in ezSQL_sqliteTest.php
    +
    +
    + testSysdate +
    +
    +
    ezSQL_pdoTest::testSysdate() in ezSQL_pdoTest.php
    +
    +
    + testSysdate +
    +
    +
    ezSQL_mssqlTest::testSysdate() in ezSQL_mssqlTest.php
    +
    +
    + testSysdate +
    +
    +
    ezSQL_postgresqlTest::testSysdate() in ezSQL_postgresqlTest.php
    +
    +
    + testSysdate +
    +
    +
    ezSQL_sybaseTest::testSysdate() in ezSQL_sybaseTest.php
    +
    +
    + testTimer_elapsed +
    +
    + +
    +
    + testTimer_get_cur +
    +
    + +
    +
    + testTimer_start +
    +
    + +
    +
    + testTimer_update_global +
    +
    + +
    +
    + testVardump +
    +
    +
    ezSQLcoreTest::testVardump() in ezSQLcoreTest.php
    +
    +
    + TEST_DB_CHARSET +
    +
    +
    ezSQL_mysqlTest::TEST_DB_CHARSET in ezSQL_mysqlTest.php
    +
    constant database connection charset
    +
    +
    + TEST_DB_CHARSET +
    +
    +
    ezSQL_pdoTest::TEST_DB_CHARSET in ezSQL_pdoTest.php
    +
    constant database connection charset
    +
    +
    + TEST_DB_HOST +
    +
    +
    ezSQL_postgresqlTest::TEST_DB_HOST in ezSQL_postgresqlTest.php
    +
    constant database host
    +
    +
    + TEST_DB_HOST +
    +
    +
    ezSQL_mysqlTest::TEST_DB_HOST in ezSQL_mysqlTest.php
    +
    constant database host
    +
    +
    + TEST_DB_HOST +
    +
    +
    ezSQL_pdoTest::TEST_DB_HOST in ezSQL_pdoTest.php
    +
    constant database host
    +
    +
    + TEST_DB_NAME +
    +
    +
    ezSQL_pdoTest::TEST_DB_NAME in ezSQL_pdoTest.php
    +
    constant database name
    +
    +
    + TEST_DB_NAME +
    +
    +
    ezSQL_mysqlTest::TEST_DB_NAME in ezSQL_mysqlTest.php
    +
    constant database name
    +
    +
    + TEST_DB_NAME +
    +
    +
    ezSQL_postgresqlTest::TEST_DB_NAME in ezSQL_postgresqlTest.php
    +
    constant database name
    +
    +
    + TEST_DB_PASSWORD +
    +
    +
    ezSQL_postgresqlTest::TEST_DB_PASSWORD in ezSQL_postgresqlTest.php
    +
    constant string password
    +
    +
    + TEST_DB_PASSWORD +
    +
    +
    ezSQL_pdoTest::TEST_DB_PASSWORD in ezSQL_pdoTest.php
    +
    constant string password
    +
    +
    + TEST_DB_PASSWORD +
    +
    +
    ezSQL_mysqlTest::TEST_DB_PASSWORD in ezSQL_mysqlTest.php
    +
    constant string password
    +
    +
    + TEST_DB_PORT +
    +
    +
    ezSQL_pdoTest::TEST_DB_PORT in ezSQL_pdoTest.php
    +
    constant database port
    +
    +
    + TEST_DB_PORT +
    +
    +
    ezSQL_postgresqlTest::TEST_DB_PORT in ezSQL_postgresqlTest.php
    +
    constant database port
    +
    +
    + TEST_DB_USER +
    +
    +
    ezSQL_pdoTest::TEST_DB_USER in ezSQL_pdoTest.php
    +
    constant string user name
    +
    +
    + TEST_DB_USER +
    +
    +
    ezSQL_mysqlTest::TEST_DB_USER in ezSQL_mysqlTest.php
    +
    constant string user name
    +
    +
    + TEST_DB_USER +
    +
    +
    ezSQL_postgresqlTest::TEST_DB_USER in ezSQL_postgresqlTest.php
    +
    constant string user name
    +
    timer_elapsed
    diff --git a/_Documentation/phpDocumentator/elementindex_default.html b/_Documentation/phpDocumentator/elementindex_default.html index 9ab62577..7f450245 100644 --- a/_Documentation/phpDocumentator/elementindex_default.html +++ b/_Documentation/phpDocumentator/elementindex_default.html @@ -25,6 +25,7 @@

    Package indexes

    h l n + o q r s @@ -171,6 +172,48 @@

    Package indexes

    ezSQLcore in ez_sql_core_202console.php
    ********************************************************************
    +
    + ezSQLcoreTest +
    +
    +
    ezSQLcoreTest in ezSQLcoreTest.php
    +
    Test class for ezSQLcore.
    +
    +
    + ezSQL_codeigniterTest +
    +
    +
    ezSQL_codeigniterTest in ezSQL_codeigniterTest.php
    +
    Test class for ezSQL_codeigniter.
    +
    +
    + ezSQL_mssqlTest +
    +
    +
    ezSQL_mssqlTest in ezSQL_mssqlTest.php
    +
    Test class for ezSQL_mssql.
    +
    +
    + ezSQL_oracle8_9Test +
    +
    +
    ezSQL_oracle8_9Test in ezSQL_oracle8_9Test.php
    +
    Test class for ezSQL_oracle8_9.
    +
    +
    + ezSQL_sqliteTest +
    +
    +
    ezSQL_sqliteTest in ezSQL_sqliteTest.php
    +
    Test class for ezSQL_sqlite.
    +
    +
    + ezSQL_sybaseTest +
    +
    +
    ezSQL_sybaseTest in ezSQL_sybaseTest.php
    +
    Test class for ezSQL_sybase.
    +
    ez_sql_core_2.1_debughack_0.2alpha.php
    @@ -183,6 +226,42 @@

    Package indexes

    ez_sql_core_202console.php in ez_sql_core_202console.php
    +
    + ezSQL_codeigniterTest.php +
    +
    +
    ezSQL_codeigniterTest.php in ezSQL_codeigniterTest.php
    +
    +
    + ezSQL_mssqlTest.php +
    +
    +
    ezSQL_mssqlTest.php in ezSQL_mssqlTest.php
    +
    +
    + ezSQL_oracle8_9Test.php +
    +
    +
    ezSQL_oracle8_9Test.php in ezSQL_oracle8_9Test.php
    +
    +
    + ezSQLcoreTest.php +
    +
    +
    ezSQLcoreTest.php in ezSQLcoreTest.php
    +
    +
    + ezSQL_sqliteTest.php +
    +
    +
    ezSQL_sqliteTest.php in ezSQL_sqliteTest.php
    +
    +
    + ezSQL_sybaseTest.php +
    +
    +
    ezSQL_sybaseTest.php in ezSQL_sybaseTest.php
    +
    @@ -297,6 +376,50 @@

    Package indexes

    ezSQLcore::$num_queries in ez_sql_core_202console.php
    + +
    +
    o
    + +
    +
    +
    +
    + $object +
    +
    +
    ezSQL_sqliteTest::$object in ezSQL_sqliteTest.php
    +
    +
    + $object +
    +
    +
    ezSQL_sybaseTest::$object in ezSQL_sybaseTest.php
    +
    +
    + $object +
    +
    +
    ezSQL_oracle8_9Test::$object in ezSQL_oracle8_9Test.php
    +
    +
    + $object +
    +
    +
    ezSQL_mssqlTest::$object in ezSQL_mssqlTest.php
    +
    +
    + $object +
    +
    +
    ezSQL_codeigniterTest::$object in ezSQL_codeigniterTest.php
    +
    +
    + $object +
    +
    +
    ezSQLcoreTest::$object in ezSQLcoreTest.php
    +
    +
    q
    @@ -347,6 +470,48 @@

    Package indexes

    ezSQLcore::select() in ez_sql_core_202console.php
    ********************************************************************
    +
    + setUp +
    +
    +
    ezSQLcoreTest::setUp() in ezSQLcoreTest.php
    +
    Sets up the fixture, for example, opens a network connection.
    +
    +
    + setUp +
    +
    +
    ezSQL_sqliteTest::setUp() in ezSQL_sqliteTest.php
    +
    Sets up the fixture, for example, opens a network connection.
    +
    +
    + setUp +
    +
    +
    ezSQL_sybaseTest::setUp() in ezSQL_sybaseTest.php
    +
    Sets up the fixture, for example, opens a network connection.
    +
    +
    + setUp +
    +
    +
    ezSQL_oracle8_9Test::setUp() in ezSQL_oracle8_9Test.php
    +
    Sets up the fixture, for example, opens a network connection.
    +
    +
    + setUp +
    +
    +
    ezSQL_codeigniterTest::setUp() in ezSQL_codeigniterTest.php
    +
    Sets up the fixture, for example, opens a network connection.
    +
    +
    + setUp +
    +
    +
    ezSQL_mssqlTest::setUp() in ezSQL_mssqlTest.php
    +
    Sets up the fixture, for example, opens a network connection.
    +
    show_errors
    @@ -382,6 +547,402 @@

    Package indexes

    ezSQLcore::$trace in ez_sql_core_202console.php
    +
    + tearDown +
    +
    +
    ezSQL_oracle8_9Test::tearDown() in ezSQL_oracle8_9Test.php
    +
    Tears down the fixture, for example, closes a network connection.
    +
    +
    + tearDown +
    +
    +
    ezSQLcoreTest::tearDown() in ezSQLcoreTest.php
    +
    Tears down the fixture, for example, closes a network connection.
    +
    +
    + tearDown +
    +
    +
    ezSQL_mssqlTest::tearDown() in ezSQL_mssqlTest.php
    +
    Tears down the fixture, for example, closes a network connection.
    +
    +
    + tearDown +
    +
    +
    ezSQL_sybaseTest::tearDown() in ezSQL_sybaseTest.php
    +
    Tears down the fixture, for example, closes a network connection.
    +
    +
    + tearDown +
    +
    +
    ezSQL_codeigniterTest::tearDown() in ezSQL_codeigniterTest.php
    +
    Tears down the fixture, for example, closes a network connection.
    +
    +
    + tearDown +
    +
    +
    ezSQL_sqliteTest::tearDown() in ezSQL_sqliteTest.php
    +
    Tears down the fixture, for example, closes a network connection.
    +
    +
    + testConnect +
    +
    +
    ezSQL_mssqlTest::testConnect() in ezSQL_mssqlTest.php
    +
    +
    + testConnect +
    +
    +
    ezSQL_oracle8_9Test::testConnect() in ezSQL_oracle8_9Test.php
    +
    +
    + testConnect +
    +
    +
    ezSQL_sqliteTest::testConnect() in ezSQL_sqliteTest.php
    +
    +
    + testConnect +
    +
    +
    ezSQL_sybaseTest::testConnect() in ezSQL_sybaseTest.php
    +
    +
    + testConvertMySqlToMSSql +
    +
    + +
    +
    + testConvertMySqlTosybase +
    +
    + +
    +
    + testDebug +
    +
    +
    ezSQLcoreTest::testDebug() in ezSQLcoreTest.php
    +
    +
    + testDisconnect +
    +
    +
    ezSQL_mssqlTest::testDisconnect() in ezSQL_mssqlTest.php
    +
    +
    + testDisconnect +
    +
    +
    ezSQL_sybaseTest::testDisconnect() in ezSQL_sybaseTest.php
    +
    +
    + testDisconnect +
    +
    +
    ezSQL_sqliteTest::testDisconnect() in ezSQL_sqliteTest.php
    +
    +
    + testDisconnect +
    +
    +
    ezSQL_oracle8_9Test::testDisconnect() in ezSQL_oracle8_9Test.php
    +
    +
    + testDonation +
    +
    +
    ezSQLcoreTest::testDonation() in ezSQLcoreTest.php
    +
    +
    + testDumpvar +
    +
    +
    ezSQLcoreTest::testDumpvar() in ezSQLcoreTest.php
    +
    +
    + testEscape +
    +
    +
    ezSQL_oracle8_9Test::testEscape() in ezSQL_oracle8_9Test.php
    +
    +
    + testEscape +
    +
    +
    ezSQL_codeigniterTest::testEscape() in ezSQL_codeigniterTest.php
    +
    +
    + testEscape +
    +
    +
    ezSQL_mssqlTest::testEscape() in ezSQL_mssqlTest.php
    +
    +
    + testEscape +
    +
    +
    ezSQL_sqliteTest::testEscape() in ezSQL_sqliteTest.php
    +
    +
    + testEscape +
    +
    +
    ezSQL_sybaseTest::testEscape() in ezSQL_sybaseTest.php
    +
    +
    + testFlush +
    +
    +
    ezSQLcoreTest::testFlush() in ezSQLcoreTest.php
    +
    +
    + testGetDBHost +
    +
    +
    ezSQL_mssqlTest::testGetDBHost() in ezSQL_mssqlTest.php
    +
    +
    + testGetDBHost +
    +
    +
    ezSQL_sybaseTest::testGetDBHost() in ezSQL_sybaseTest.php
    +
    +
    + testGetDBName +
    +
    +
    ezSQL_oracle8_9Test::testGetDBName() in ezSQL_oracle8_9Test.php
    +
    +
    + testGet_cache +
    +
    +
    ezSQLcoreTest::testGet_cache() in ezSQLcoreTest.php
    +
    +
    + testGet_col +
    +
    +
    ezSQLcoreTest::testGet_col() in ezSQLcoreTest.php
    +
    +
    + testGet_col_info +
    +
    + +
    +
    + testGet_results +
    +
    + +
    +
    + testGet_row +
    +
    +
    ezSQLcoreTest::testGet_row() in ezSQLcoreTest.php
    +
    +
    + testGet_set +
    +
    +
    ezSQLcoreTest::testGet_set() in ezSQLcoreTest.php
    +
    +
    + testGet_var +
    +
    +
    ezSQLcoreTest::testGet_var() in ezSQLcoreTest.php
    +
    +
    + testHide_errors +
    +
    + +
    +
    + testInsert_id +
    +
    +
    ezSQL_oracle8_9Test::testInsert_id() in ezSQL_oracle8_9Test.php
    +
    +
    + testIs_equal_int +
    +
    +
    ezSQL_oracle8_9Test::testIs_equal_int() in ezSQL_oracle8_9Test.php
    +
    +
    + testIs_equal_str +
    +
    +
    ezSQL_oracle8_9Test::testIs_equal_str() in ezSQL_oracle8_9Test.php
    +
    +
    + testNextVal +
    +
    +
    ezSQL_oracle8_9Test::testNextVal() in ezSQL_oracle8_9Test.php
    +
    +
    + testQuery +
    +
    +
    ezSQL_codeigniterTest::testQuery() in ezSQL_codeigniterTest.php
    +
    +
    + testQuery +
    +
    +
    ezSQL_sqliteTest::testQuery() in ezSQL_sqliteTest.php
    +
    +
    + testQuery +
    +
    +
    ezSQL_mssqlTest::testQuery() in ezSQL_mssqlTest.php
    +
    +
    + testQuery +
    +
    +
    ezSQL_sybaseTest::testQuery() in ezSQL_sybaseTest.php
    +
    +
    + testQuery +
    +
    +
    ezSQL_oracle8_9Test::testQuery() in ezSQL_oracle8_9Test.php
    +
    +
    + testQuick_connect +
    +
    + +
    +
    + testQuick_connect +
    +
    +
    ezSQL_oracle8_9Test::testQuick_connect() in ezSQL_oracle8_9Test.php
    +
    +
    + testQuick_connect +
    +
    + +
    +
    + testQuick_connect +
    +
    + +
    +
    + testRegister_error +
    +
    + +
    +
    + testSelect +
    +
    +
    ezSQL_sybaseTest::testSelect() in ezSQL_sybaseTest.php
    +
    +
    + testSelect +
    +
    +
    ezSQL_sqliteTest::testSelect() in ezSQL_sqliteTest.php
    +
    +
    + testSelect +
    +
    +
    ezSQL_mssqlTest::testSelect() in ezSQL_mssqlTest.php
    +
    +
    + testSelect +
    +
    +
    ezSQL_oracle8_9Test::testSelect() in ezSQL_oracle8_9Test.php
    +
    +
    + testShow_errors +
    +
    + +
    +
    + testStore_cache +
    +
    + +
    +
    + testSysdate +
    +
    +
    ezSQL_oracle8_9Test::testSysdate() in ezSQL_oracle8_9Test.php
    +
    +
    + testSysdate +
    +
    +
    ezSQL_sqliteTest::testSysdate() in ezSQL_sqliteTest.php
    +
    +
    + testSysdate +
    +
    +
    ezSQL_sybaseTest::testSysdate() in ezSQL_sybaseTest.php
    +
    +
    + testSysdate +
    +
    +
    ezSQL_mssqlTest::testSysdate() in ezSQL_mssqlTest.php
    +
    +
    + testTimer_elapsed +
    +
    + +
    +
    + testTimer_get_cur +
    +
    + +
    +
    + testTimer_start +
    +
    + +
    +
    + testTimer_update_global +
    +
    + +
    +
    + testVardump +
    +
    +
    ezSQLcoreTest::testVardump() in ezSQLcoreTest.php
    +
    @@ -428,6 +989,7 @@

    Package indexes

    h l n + o q r s diff --git a/_Documentation/phpDocumentator/elementindex_ezSQL.html b/_Documentation/phpDocumentator/elementindex_ezSQL.html index 5681e416..1c12df6b 100644 --- a/_Documentation/phpDocumentator/elementindex_ezSQL.html +++ b/_Documentation/phpDocumentator/elementindex_ezSQL.html @@ -178,6 +178,13 @@

    Package indexes

    The last column info
    +
    + $connected +
    +
    + +
    Whether the database connection is established, or not
    +
    catch_error
    @@ -258,6 +265,13 @@

    Package indexes

    +
    + $dbh +
    +
    + +
    The database connection object
    +
    $db_connect_time
    @@ -270,6 +284,7 @@

    Package indexes

    ezSQL_codeigniter::$debug in ezSQL_codeigniter
    +
    Run in debug mode
    $debug_all @@ -324,21 +339,21 @@

    Package indexes

    disconnect
    - +
    Close the database connection
    disconnect
    - +
    Close the database connection
    disconnect
    - +
    Close the database connection
    @@ -352,14 +367,14 @@

    Package indexes

    disconnect
    - +
    Close the database connection
    disconnect
    - +
    Close the database connection
    @@ -564,6 +579,45 @@

    Package indexes

    ezSQL_sybase in ezSQL_sybase
    +
    + ezSQL_mysqlTest +
    +
    +
    ezSQL_mysqlTest in ezSQL_mysqlTest.php
    +
    Test class for ezSQL_mysql.
    +
    +
    + ezSQL_pdoTest +
    +
    +
    ezSQL_pdoTest in ezSQL_pdoTest.php
    +
    Test class for ezSQL_pdo.
    +
    +
    + ezSQL_postgresqlTest +
    +
    +
    ezSQL_postgresqlTest in ezSQL_postgresqlTest.php
    +
    Test class for ezSQL_postgresql.
    +
    +
    + ezSQL_mysqlTest.php +
    +
    +
    ezSQL_mysqlTest.php in ezSQL_mysqlTest.php
    +
    +
    + ezSQL_pdoTest.php +
    +
    +
    ezSQL_pdoTest.php in ezSQL_pdoTest.php
    +
    +
    + ezSQL_postgresqlTest.php +
    +
    +
    ezSQL_postgresqlTest.php in ezSQL_postgresqlTest.php
    +
    @@ -715,6 +769,13 @@

    Package indexes

    ezSQL_oracle8_9::insert_id() in ezSQL_oracle8_9
    Another oracle specific function - if you have set up a sequence this function returns the next ID from that sequence If the sequence is not defined, the sequence is created by this method.
    +
    + isConnected +
    +
    + +
    Returns, whether a database connection is established, or not
    +
    is_equal_int
    @@ -788,6 +849,24 @@

    Package indexes

    Constant boolean Object
    +
    + $object +
    +
    +
    ezSQL_postgresqlTest::$object in ezSQL_postgresqlTest.php
    +
    +
    + $object +
    +
    +
    ezSQL_pdoTest::$object in ezSQL_pdoTest.php
    +
    +
    + $object +
    +
    +
    ezSQL_mysqlTest::$object in ezSQL_mysqlTest.php
    +
    @@ -939,6 +1018,62 @@

    Package indexes

    +
    + $show_errors +
    +
    + +
    Show errors
    +
    +
    + $show_errors +
    +
    +
    ezSQL_postgresql::$show_errors in ezSQL_postgresql
    +
    Show errors
    +
    +
    + $show_errors +
    +
    + +
    Show errors
    +
    +
    + $show_errors +
    +
    + +
    Show errors
    +
    +
    + $show_errors +
    +
    + +
    Show errors
    +
    +
    + $show_errors +
    +
    + +
    Show errors
    +
    +
    + $show_errors +
    +
    + +
    Show errors
    +
    +
    + $show_errors +
    +
    +
    ezSQL_codeigniter::$show_errors in ezSQL_codeigniter
    +
    Show errors
    +
    $sql_log_file
    @@ -950,50 +1085,50 @@

    Package indexes

    select
    -
    ezSQL_postgresql::select() in ezSQL_postgresql
    -
    No real equivalent of mySQL select in PostgreSQL once again, function included for the sake of consistency
    +
    ezSQL_pdo::select() in ezSQL_pdo
    +
    With PDO it is only an alias for the connect method
    select
    -
    ezSQL_sqlite::select() in ezSQL_sqlite
    -
    No real equivalent of mySQL select in SQLite once again, function included for the sake of consistency
    +
    ezSQL_mysql::select() in ezSQL_mysql
    +
    Try to select a mySQL database
    select
    -
    ezSQL_sybase::select() in ezSQL_sybase
    -
    Try to select a sybase database
    +
    ezSQL_sqlite::select() in ezSQL_sqlite
    +
    No real equivalent of mySQL select in SQLite once again, function included for the sake of consistency
    select
    -
    ezSQL_oracle8_9::select() in ezSQL_oracle8_9
    -
    No real equivalent of mySQL select in Oracle, once again, function included for the sake of consistency
    +
    ezSQL_sybase::select() in ezSQL_sybase
    +
    Try to select a sybase database
    select
    -
    ezSQL_pdo::select() in ezSQL_pdo
    -
    With PDO it is only an alias for the connect method
    +
    ezSQL_postgresql::select() in ezSQL_postgresql
    +
    No real equivalent of mySQL select in PostgreSQL once again, function included for the sake of consistency
    select
    -
    ezSQL_mysql::select() in ezSQL_mysql
    -
    Try to select a mySQL database
    +
    ezSQL_mssql::select() in ezSQL_mssql
    +
    Try to select a mssql database
    select
    -
    ezSQL_mssql::select() in ezSQL_mssql
    -
    Try to select a mssql database
    +
    ezSQL_oracle8_9::select() in ezSQL_oracle8_9
    +
    No real equivalent of mySQL select in Oracle, once again, function included for the sake of consistency
    showDatabases @@ -1026,6 +1161,13 @@

    Package indexes

    sysdate
    +
    +
    ezSQL_sybase::sysdate() in ezSQL_sybase
    +
    Return sybase specific system date syntax i.e. Oracle: SYSDATE sybase: getDate()
    +
    +
    + sysdate +
    ezSQL_sqlite::sysdate() in ezSQL_sqlite
    Return SQLite specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
    @@ -1034,8 +1176,8 @@

    Package indexes

    sysdate
    -
    ezSQL_sybase::sysdate() in ezSQL_sybase
    -
    Return sybase specific system date syntax i.e. Oracle: SYSDATE sybase: getDate()
    +
    ezSQL_mysql::sysdate() in ezSQL_mysql
    +
    Return mySQL specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
    sysdate @@ -1048,29 +1190,43 @@

    Package indexes

    sysdate
    -
    ezSQL_oracle8_9::sysdate() in ezSQL_oracle8_9
    -
    Return Oracle specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
    + +
    Return SQLite specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
    sysdate
    -
    ezSQL_mysql::sysdate() in ezSQL_mysql
    -
    Return mySQL specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
    +
    ezSQL_mssql::sysdate() in ezSQL_mssql
    +
    Return mssql specific system date syntax i.e. Oracle: SYSDATE mssql: NOW(), MS-SQL : getDate()
    sysdate
    -
    ezSQL_mssql::sysdate() in ezSQL_mssql
    -
    Return mssql specific system date syntax i.e. Oracle: SYSDATE mssql: NOW(), MS-SQL : getDate()
    +
    ezSQL_oracle8_9::sysdate() in ezSQL_oracle8_9
    +
    Return Oracle specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
    - sysdate + setUp
    - -
    Return SQLite specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
    +
    ezSQL_postgresqlTest::setUp() in ezSQL_postgresqlTest.php
    +
    Sets up the fixture, for example, opens a network connection.
    +
    +
    + setUp +
    +
    +
    ezSQL_pdoTest::setUp() in ezSQL_pdoTest.php
    +
    Sets up the fixture, for example, opens a network connection.
    +
    +
    + setUp +
    +
    +
    ezSQL_mysqlTest::setUp() in ezSQL_mysqlTest.php
    +
    Sets up the fixture, for example, opens a network connection.
    @@ -1136,6 +1292,313 @@

    Package indexes

    Update the global timer with an existing timer
    +
    + tearDown +
    +
    +
    ezSQL_pdoTest::tearDown() in ezSQL_pdoTest.php
    +
    Tears down the fixture, for example, closes a network connection.
    +
    +
    + tearDown +
    +
    +
    ezSQL_postgresqlTest::tearDown() in ezSQL_postgresqlTest.php
    +
    Tears down the fixture, for example, closes a network connection.
    +
    +
    + tearDown +
    +
    +
    ezSQL_mysqlTest::tearDown() in ezSQL_mysqlTest.php
    +
    Tears down the fixture, for example, closes a network connection.
    +
    +
    + testCatch_error +
    +
    + +
    +
    + testConnect +
    +
    +
    ezSQL_postgresqlTest::testConnect() in ezSQL_postgresqlTest.php
    +
    +
    + testConnect +
    +
    +
    ezSQL_mysqlTest::testConnect() in ezSQL_mysqlTest.php
    +
    +
    + testConnect +
    +
    +
    ezSQL_pdoTest::testConnect() in ezSQL_pdoTest.php
    +
    +
    + testDescTable +
    +
    +
    ezSQL_postgresqlTest::testDescTable() in ezSQL_postgresqlTest.php
    +
    +
    + testDisconnect +
    +
    +
    ezSQL_pdoTest::testDisconnect() in ezSQL_pdoTest.php
    +
    +
    + testDisconnect +
    +
    +
    ezSQL_mysqlTest::testDisconnect() in ezSQL_mysqlTest.php
    +
    +
    + testDisconnect +
    +
    +
    ezSQL_postgresqlTest::testDisconnect() in ezSQL_postgresqlTest.php
    +
    +
    + testEscape +
    +
    +
    ezSQL_postgresqlTest::testEscape() in ezSQL_postgresqlTest.php
    +
    +
    + testEscape +
    +
    +
    ezSQL_mysqlTest::testEscape() in ezSQL_mysqlTest.php
    +
    +
    + testEscape +
    +
    +
    ezSQL_pdoTest::testEscape() in ezSQL_pdoTest.php
    +
    +
    + testGetCharset +
    +
    +
    ezSQL_mysqlTest::testGetCharset() in ezSQL_mysqlTest.php
    +
    +
    + testGetDBHost +
    +
    +
    ezSQL_postgresqlTest::testGetDBHost() in ezSQL_postgresqlTest.php
    +
    +
    + testGetDBHost +
    +
    +
    ezSQL_mysqlTest::testGetDBHost() in ezSQL_mysqlTest.php
    +
    +
    + testGetPort +
    +
    +
    ezSQL_postgresqlTest::testGetPort() in ezSQL_postgresqlTest.php
    +
    +
    + testQuery +
    +
    +
    ezSQL_pdoTest::testQuery() in ezSQL_pdoTest.php
    +
    +
    + testQuery +
    +
    +
    ezSQL_postgresqlTest::testQuery() in ezSQL_postgresqlTest.php
    +
    +
    + testQuery +
    +
    +
    ezSQL_mysqlTest::testQuery() in ezSQL_mysqlTest.php
    +
    +
    + testQuick_connect +
    +
    + +
    +
    + testQuick_connect +
    +
    + +
    +
    + testQuick_connect +
    +
    +
    ezSQL_postgresqlTest::testQuick_connect() in ezSQL_postgresqlTest.php
    +
    +
    + testSelect +
    +
    +
    ezSQL_postgresqlTest::testSelect() in ezSQL_postgresqlTest.php
    +
    +
    + testSelect +
    +
    +
    ezSQL_pdoTest::testSelect() in ezSQL_pdoTest.php
    +
    +
    + testSelect +
    +
    +
    ezSQL_mysqlTest::testSelect() in ezSQL_mysqlTest.php
    +
    +
    + testShowDatabases +
    +
    +
    ezSQL_postgresqlTest::testShowDatabases() in ezSQL_postgresqlTest.php
    +
    +
    + testShowTables +
    +
    +
    ezSQL_postgresqlTest::testShowTables() in ezSQL_postgresqlTest.php
    +
    +
    + testSysdate +
    +
    +
    ezSQL_postgresqlTest::testSysdate() in ezSQL_postgresqlTest.php
    +
    +
    + testSysdate +
    +
    +
    ezSQL_pdoTest::testSysdate() in ezSQL_pdoTest.php
    +
    +
    + testSysdate +
    +
    +
    ezSQL_mysqlTest::testSysdate() in ezSQL_mysqlTest.php
    +
    +
    + TEST_DB_CHARSET +
    +
    +
    ezSQL_pdoTest::TEST_DB_CHARSET in ezSQL_pdoTest.php
    +
    constant database connection charset
    +
    +
    + TEST_DB_CHARSET +
    +
    +
    ezSQL_mysqlTest::TEST_DB_CHARSET in ezSQL_mysqlTest.php
    +
    constant database connection charset
    +
    +
    + TEST_DB_HOST +
    +
    +
    ezSQL_pdoTest::TEST_DB_HOST in ezSQL_pdoTest.php
    +
    constant database host
    +
    +
    + TEST_DB_HOST +
    +
    +
    ezSQL_mysqlTest::TEST_DB_HOST in ezSQL_mysqlTest.php
    +
    constant database host
    +
    +
    + TEST_DB_HOST +
    +
    +
    ezSQL_postgresqlTest::TEST_DB_HOST in ezSQL_postgresqlTest.php
    +
    constant database host
    +
    +
    + TEST_DB_NAME +
    +
    +
    ezSQL_postgresqlTest::TEST_DB_NAME in ezSQL_postgresqlTest.php
    +
    constant database name
    +
    +
    + TEST_DB_NAME +
    +
    +
    ezSQL_mysqlTest::TEST_DB_NAME in ezSQL_mysqlTest.php
    +
    constant database name
    +
    +
    + TEST_DB_NAME +
    +
    +
    ezSQL_pdoTest::TEST_DB_NAME in ezSQL_pdoTest.php
    +
    constant database name
    +
    +
    + TEST_DB_PASSWORD +
    +
    +
    ezSQL_postgresqlTest::TEST_DB_PASSWORD in ezSQL_postgresqlTest.php
    +
    constant string password
    +
    +
    + TEST_DB_PASSWORD +
    +
    +
    ezSQL_pdoTest::TEST_DB_PASSWORD in ezSQL_pdoTest.php
    +
    constant string password
    +
    +
    + TEST_DB_PASSWORD +
    +
    +
    ezSQL_mysqlTest::TEST_DB_PASSWORD in ezSQL_mysqlTest.php
    +
    constant string password
    +
    +
    + TEST_DB_PORT +
    +
    +
    ezSQL_postgresqlTest::TEST_DB_PORT in ezSQL_postgresqlTest.php
    +
    constant database port
    +
    +
    + TEST_DB_PORT +
    +
    +
    ezSQL_pdoTest::TEST_DB_PORT in ezSQL_pdoTest.php
    +
    constant database port
    +
    +
    + TEST_DB_USER +
    +
    +
    ezSQL_postgresqlTest::TEST_DB_USER in ezSQL_postgresqlTest.php
    +
    constant string user name
    +
    +
    + TEST_DB_USER +
    +
    +
    ezSQL_pdoTest::TEST_DB_USER in ezSQL_pdoTest.php
    +
    constant string user name
    +
    +
    + TEST_DB_USER +
    +
    +
    ezSQL_mysqlTest::TEST_DB_USER in ezSQL_mysqlTest.php
    +
    constant string user name
    +
    diff --git a/_Documentation/phpDocumentator/errors.html b/_Documentation/phpDocumentator/errors.html index a700195e..e9fd6eb7 100644 --- a/_Documentation/phpDocumentator/errors.html +++ b/_Documentation/phpDocumentator/errors.html @@ -10,28 +10,176 @@ Post-parsing
    disk_cache_example.php
    +ezSQLcoreTest.php
    +ezSQL_codeigniterTest.php
    +ezSQL_mssqlTest.php
    +ezSQL_mysqlTest.php
    +ezSQL_oracle8_9Test.php
    +ezSQL_pdoTest.php
    +ezSQL_postgresqlTest.php
    +ezSQL_sqliteTest.php
    +ezSQL_sybaseTest.php
    ez_sql_core_2.1_debughack_0.2alpha.php
    ez_sql_core_202console.php

    Post-parsing

    Warnings:


    +Warning - Class ezSQLcoreTest parent PHPUnit_Framework_TestCase not found
    +Warning - Class ezSQL_pdoTest parent PHPUnit_Framework_TestCase not found
    +Warning - Class ezSQL_mssqlTest parent PHPUnit_Framework_TestCase not found
    +Warning - Class ezSQL_sybaseTest parent PHPUnit_Framework_TestCase not found
    +Warning - Class ezSQL_oracle8_9Test parent PHPUnit_Framework_TestCase not found
    Warning - duplicate class element "ezSQLcore" in file /home/stefanie/Projects/ezSQL/ezSQL/shared/ez_sql_core_2.1_debughack_0.2alpha.php will be ignored. Use an @ignore tag on the original if you want this case to be documented.
    +Warning - Class ezSQL_sqliteTest parent PHPUnit_Framework_TestCase not found
    +Warning - Class ezSQL_codeigniterTest parent PHPUnit_Framework_TestCase not found
    +Warning - Class ezSQL_mysqlTest parent PHPUnit_Framework_TestCase not found
    +Warning - Class ezSQL_postgresqlTest parent PHPUnit_Framework_TestCase not found

    demo.php

    Warnings:


    -Warning on line 10 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/oracle8_9/demo.php
    Warning on line 10 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/pdo/demo.php
    -Warning on line 10 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/postgresql/demo.php
    Warning on line 10 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/mssql/demo.php
    -Warning on line 10 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/mysql/demo.php
    +Warning on line 10 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/oracle8_9/demo.php
    Warning on line 10 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/sqlite/demo.php
    +Warning on line 10 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/postgresql/demo.php
    +Warning on line 10 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/mysql/demo.php

    disk_cache_example.php

    Warnings:


    Warning on line 55 - File "/home/stefanie/Projects/ezSQL/ezSQL/mysql/disk_cache_example.php" has no page-level DocBlock, use @package in the first DocBlock to create one
    Warning on line 58 - File "/home/stefanie/Projects/ezSQL/ezSQL/oracle8_9/disk_cache_example.php" has no page-level DocBlock, use @package in the first DocBlock to create one
    + +

    ezSQLcoreTest.php

    +

    Warnings:


    +Warning on line 8 - no @package tag was used in a DocBlock for class ezSQLcoreTest
    +Warning on line 35 - Unknown tag "@covers" used
    +Warning on line 46 - Unknown tag "@covers" used
    +Warning on line 57 - Unknown tag "@covers" used
    +Warning on line 68 - Unknown tag "@covers" used
    +Warning on line 79 - Unknown tag "@covers" used
    +Warning on line 90 - Unknown tag "@covers" used
    +Warning on line 101 - Unknown tag "@covers" used
    +Warning on line 112 - Unknown tag "@covers" used
    +Warning on line 123 - Unknown tag "@covers" used
    +Warning on line 134 - Unknown tag "@covers" used
    +Warning on line 145 - Unknown tag "@covers" used
    +Warning on line 156 - Unknown tag "@covers" used
    +Warning on line 167 - Unknown tag "@covers" used
    +Warning on line 178 - Unknown tag "@covers" used
    +Warning on line 189 - Unknown tag "@covers" used
    +Warning on line 200 - Unknown tag "@covers" used
    +Warning on line 211 - Unknown tag "@covers" used
    +Warning on line 222 - Unknown tag "@covers" used
    +Warning on line 233 - Unknown tag "@covers" used
    +Warning on line 244 - Unknown tag "@covers" used
    +Warning on line 253 - File "/home/stefanie/Projects/ezSQL/ezSQL/_Test/unit_tests/shared/ezSQLcoreTest.php" has no page-level DocBlock, use @package in the first DocBlock to create one
    + +

    ezSQL_codeigniterTest.php

    +

    Warnings:


    +Warning on line 9 - no @package tag was used in a DocBlock for class ezSQL_codeigniterTest
    +Warning on line 36 - Unknown tag "@covers" used
    +Warning on line 47 - Unknown tag "@covers" used
    +Warning on line 56 - File "/home/stefanie/Projects/ezSQL/ezSQL/_Test/unit_tests/codeigniter/ezSQL_codeigniterTest.php" has no page-level DocBlock, use @package in the first DocBlock to create one
    + +

    ezSQL_mssqlTest.php

    +

    Warnings:


    +Warning on line 9 - no @package tag was used in a DocBlock for class ezSQL_mssqlTest
    +Warning on line 36 - Unknown tag "@covers" used
    +Warning on line 47 - Unknown tag "@covers" used
    +Warning on line 58 - Unknown tag "@covers" used
    +Warning on line 69 - Unknown tag "@covers" used
    +Warning on line 80 - Unknown tag "@covers" used
    +Warning on line 91 - Unknown tag "@covers" used
    +Warning on line 102 - Unknown tag "@covers" used
    +Warning on line 113 - Unknown tag "@covers" used
    +Warning on line 124 - Unknown tag "@covers" used
    +Warning on line 133 - File "/home/stefanie/Projects/ezSQL/ezSQL/_Test/unit_tests/mssql/ezSQL_mssqlTest.php" has no page-level DocBlock, use @package in the first DocBlock to create one
    + +

    ezSQL_mysqlTest.php

    +

    Warnings:


    +Warning on line 72 - Unknown tag "@covers" used
    +Warning on line 81 - Unknown tag "@covers" used
    +Warning on line 90 - Unknown tag "@covers" used
    +Warning on line 102 - Unknown tag "@covers" used
    +Warning on line 111 - Unknown tag "@covers" used
    +Warning on line 119 - Unknown tag "@covers" used
    +Warning on line 133 - Unknown tag "@covers" used
    +Warning on line 140 - Unknown tag "@covers" used
    +Warning on line 147 - Unknown tag "@covers" used
    +Warning on line 153 - File "/home/stefanie/Projects/ezSQL/ezSQL/_Test/unit_tests/mysql/ezSQL_mysqlTest.php" has no page-level DocBlock, use @package in the first DocBlock to create one
    + +

    ezSQL_oracle8_9Test.php

    +

    Warnings:


    +Warning on line 9 - no @package tag was used in a DocBlock for class ezSQL_oracle8_9Test
    +Warning on line 36 - Unknown tag "@covers" used
    +Warning on line 47 - Unknown tag "@covers" used
    +Warning on line 58 - Unknown tag "@covers" used
    +Warning on line 69 - Unknown tag "@covers" used
    +Warning on line 80 - Unknown tag "@covers" used
    +Warning on line 91 - Unknown tag "@covers" used
    +Warning on line 102 - Unknown tag "@covers" used
    +Warning on line 113 - Unknown tag "@covers" used
    +Warning on line 124 - Unknown tag "@covers" used
    +Warning on line 135 - Unknown tag "@covers" used
    +Warning on line 146 - Unknown tag "@covers" used
    +Warning on line 157 - Unknown tag "@covers" used
    +Warning on line 166 - File "/home/stefanie/Projects/ezSQL/ezSQL/_Test/unit_tests/oracle8_9/ezSQL_oracle8_9Test.php" has no page-level DocBlock, use @package in the first DocBlock to create one
    + +

    ezSQL_pdoTest.php

    +

    Warnings:


    +Warning on line 83 - Unknown tag "@covers" used
    +Warning on line 90 - Unknown tag "@covers" used
    +Warning on line 97 - Unknown tag "@covers" used
    +Warning on line 104 - Unknown tag "@covers" used
    +Warning on line 115 - Unknown tag "@covers" used
    +Warning on line 122 - Unknown tag "@covers" used
    +Warning on line 132 - Unknown tag "@covers" used
    +Warning on line 143 - Unknown tag "@covers" used
    +Warning on line 151 - File "/home/stefanie/Projects/ezSQL/ezSQL/_Test/unit_tests/pdo/ezSQL_pdoTest.php" has no page-level DocBlock, use @package in the first DocBlock to create one
    + +

    ezSQL_postgresqlTest.php

    +

    Warnings:


    +Warning on line 72 - Unknown tag "@covers" used
    +Warning on line 80 - Unknown tag "@covers" used
    +Warning on line 87 - Unknown tag "@covers" used
    +Warning on line 96 - Unknown tag "@covers" used
    +Warning on line 105 - Unknown tag "@covers" used
    +Warning on line 112 - Unknown tag "@covers" used
    +Warning on line 123 - Unknown tag "@covers" used
    +Warning on line 139 - Unknown tag "@covers" used
    +Warning on line 151 - Unknown tag "@covers" used
    +Warning on line 162 - Unknown tag "@covers" used
    +Warning on line 171 - Unknown tag "@covers" used
    +Warning on line 178 - Unknown tag "@covers" used
    +Warning on line 184 - File "/home/stefanie/Projects/ezSQL/ezSQL/_Test/unit_tests/postgresql/ezSQL_postgresqlTest.php" has no page-level DocBlock, use @package in the first DocBlock to create one
    + +

    ezSQL_sqliteTest.php

    +

    Warnings:


    +Warning on line 9 - no @package tag was used in a DocBlock for class ezSQL_sqliteTest
    +Warning on line 36 - Unknown tag "@covers" used
    +Warning on line 47 - Unknown tag "@covers" used
    +Warning on line 58 - Unknown tag "@covers" used
    +Warning on line 69 - Unknown tag "@covers" used
    +Warning on line 80 - Unknown tag "@covers" used
    +Warning on line 91 - Unknown tag "@covers" used
    +Warning on line 102 - Unknown tag "@covers" used
    +Warning on line 111 - File "/home/stefanie/Projects/ezSQL/ezSQL/_Test/unit_tests/sqlite/ezSQL_sqliteTest.php" has no page-level DocBlock, use @package in the first DocBlock to create one
    + +

    ezSQL_sybaseTest.php

    +

    Warnings:


    +Warning on line 9 - no @package tag was used in a DocBlock for class ezSQL_sybaseTest
    +Warning on line 36 - Unknown tag "@covers" used
    +Warning on line 47 - Unknown tag "@covers" used
    +Warning on line 58 - Unknown tag "@covers" used
    +Warning on line 69 - Unknown tag "@covers" used
    +Warning on line 80 - Unknown tag "@covers" used
    +Warning on line 91 - Unknown tag "@covers" used
    +Warning on line 102 - Unknown tag "@covers" used
    +Warning on line 113 - Unknown tag "@covers" used
    +Warning on line 124 - Unknown tag "@covers" used
    +Warning on line 133 - File "/home/stefanie/Projects/ezSQL/ezSQL/_Test/unit_tests/sybase/ezSQL_sybaseTest.php" has no page-level DocBlock, use @package in the first DocBlock to create one

    ez_sql_core_2.1_debughack_0.2alpha.php

    Warnings:


    @@ -43,7 +191,7 @@

    Warnings:


    Warning on line 30 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/shared/ez_sql_core_202console.php
    Warning on line 45 - no @package tag was used in a DocBlock for class ezSQLcore

    - Documentation generated on Sun, 01 Apr 2012 23:51:55 +0200 by phpDocumentor 1.4.4 + Documentation generated on Fri, 06 Apr 2012 01:26:21 +0200 by phpDocumentor 1.4.4

    \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_codeigniter---Ezsql_codeigniter.php.html b/_Documentation/phpDocumentator/ezSQL/_codeigniter---Ezsql_codeigniter.php.html index 16f1abef..19affd4f 100644 --- a/_Documentation/phpDocumentator/ezSQL/_codeigniter---Ezsql_codeigniter.php.html +++ b/_Documentation/phpDocumentator/ezSQL/_codeigniter---Ezsql_codeigniter.php.html @@ -62,7 +62,7 @@

    /codeigniter/Ezsql_codeigniter.php

    - Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 + Documentation generated on Fri, 06 Apr 2012 01:26:19 +0200 by phpDocumentor 1.4.4

    \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_mssql---ez_sql_mssql.php.html b/_Documentation/phpDocumentator/ezSQL/_mssql---ez_sql_mssql.php.html index 958fb176..a57a1c73 100644 --- a/_Documentation/phpDocumentator/ezSQL/_mssql---ez_sql_mssql.php.html +++ b/_Documentation/phpDocumentator/ezSQL/_mssql---ez_sql_mssql.php.html @@ -62,7 +62,7 @@

    /mssql/ez_sql_mssql.php

    - Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 + Documentation generated on Fri, 06 Apr 2012 01:26:19 +0200 by phpDocumentor 1.4.4

    \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_mysql---ez_sql_mysql.php.html b/_Documentation/phpDocumentator/ezSQL/_mysql---ez_sql_mysql.php.html index adf30f45..0604d7c4 100644 --- a/_Documentation/phpDocumentator/ezSQL/_mysql---ez_sql_mysql.php.html +++ b/_Documentation/phpDocumentator/ezSQL/_mysql---ez_sql_mysql.php.html @@ -62,7 +62,7 @@

    /mysql/ez_sql_mysql.php

    - Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 + Documentation generated on Fri, 06 Apr 2012 01:26:19 +0200 by phpDocumentor 1.4.4

    \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_oracle8_9---ez_sql_oracle8_9.php.html b/_Documentation/phpDocumentator/ezSQL/_oracle8_9---ez_sql_oracle8_9.php.html index 86cb40bd..1ba944f0 100644 --- a/_Documentation/phpDocumentator/ezSQL/_oracle8_9---ez_sql_oracle8_9.php.html +++ b/_Documentation/phpDocumentator/ezSQL/_oracle8_9---ez_sql_oracle8_9.php.html @@ -62,7 +62,7 @@

    /oracle8_9/ez_sql_oracle8_9.php

    - Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 + Documentation generated on Fri, 06 Apr 2012 01:26:19 +0200 by phpDocumentor 1.4.4

    \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_pdo---ez_sql_pdo.php.html b/_Documentation/phpDocumentator/ezSQL/_pdo---ez_sql_pdo.php.html index 033b94f0..5661057d 100644 --- a/_Documentation/phpDocumentator/ezSQL/_pdo---ez_sql_pdo.php.html +++ b/_Documentation/phpDocumentator/ezSQL/_pdo---ez_sql_pdo.php.html @@ -62,7 +62,7 @@

    /pdo/ez_sql_pdo.php

    - Documentation generated on Sun, 01 Apr 2012 23:51:55 +0200 by phpDocumentor 1.4.4 + Documentation generated on Fri, 06 Apr 2012 01:26:19 +0200 by phpDocumentor 1.4.4

    \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_postgresql---ez_sql_postgresql.php.html b/_Documentation/phpDocumentator/ezSQL/_postgresql---ez_sql_postgresql.php.html index 27068364..693982d8 100644 --- a/_Documentation/phpDocumentator/ezSQL/_postgresql---ez_sql_postgresql.php.html +++ b/_Documentation/phpDocumentator/ezSQL/_postgresql---ez_sql_postgresql.php.html @@ -62,7 +62,7 @@

    /postgresql/ez_sql_postgresql.php

    - Documentation generated on Sun, 01 Apr 2012 23:51:55 +0200 by phpDocumentor 1.4.4 + Documentation generated on Fri, 06 Apr 2012 01:26:20 +0200 by phpDocumentor 1.4.4

    \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_shared---ez_sql_core.php.html b/_Documentation/phpDocumentator/ezSQL/_shared---ez_sql_core.php.html index 51d88d58..4b552efc 100644 --- a/_Documentation/phpDocumentator/ezSQL/_shared---ez_sql_core.php.html +++ b/_Documentation/phpDocumentator/ezSQL/_shared---ez_sql_core.php.html @@ -62,7 +62,7 @@

    /shared/ez_sql_core.php

    - Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 + Documentation generated on Fri, 06 Apr 2012 01:26:18 +0200 by phpDocumentor 1.4.4

    \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_sqlite---ez_sql_sqlite.php.html b/_Documentation/phpDocumentator/ezSQL/_sqlite---ez_sql_sqlite.php.html index 6bbe875d..e2808e76 100644 --- a/_Documentation/phpDocumentator/ezSQL/_sqlite---ez_sql_sqlite.php.html +++ b/_Documentation/phpDocumentator/ezSQL/_sqlite---ez_sql_sqlite.php.html @@ -62,7 +62,7 @@

    /sqlite/ez_sql_sqlite.php

    - Documentation generated on Sun, 01 Apr 2012 23:51:55 +0200 by phpDocumentor 1.4.4 + Documentation generated on Fri, 06 Apr 2012 01:26:20 +0200 by phpDocumentor 1.4.4

    \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_sybase---ez_sql_sybase.php.html b/_Documentation/phpDocumentator/ezSQL/_sybase---ez_sql_sybase.php.html index dac8878c..baf3bbea 100644 --- a/_Documentation/phpDocumentator/ezSQL/_sybase---ez_sql_sybase.php.html +++ b/_Documentation/phpDocumentator/ezSQL/_sybase---ez_sql_sybase.php.html @@ -62,7 +62,7 @@

    /sybase/ez_sql_sybase.php

    - Documentation generated on Sun, 01 Apr 2012 23:51:55 +0200 by phpDocumentor 1.4.4 + Documentation generated on Fri, 06 Apr 2012 01:26:20 +0200 by phpDocumentor 1.4.4

    \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/ezSQL_codeigniter.html b/_Documentation/phpDocumentator/ezSQL/ezSQL_codeigniter.html index c08ee61a..a344ed21 100644 --- a/_Documentation/phpDocumentator/ezSQL/ezSQL_codeigniter.html +++ b/_Documentation/phpDocumentator/ezSQL/ezSQL_codeigniter.html @@ -33,7 +33,7 @@

    Class ezSQL_codeigniter

  • license: FREE
  • - Located in /codeigniter/Ezsql_codeigniter.php (line 14) + Located in /codeigniter/Ezsql_codeigniter.php (line 15)

    @@ -60,9 +60,13 @@

    Class ezSQL_codeigniter

    -
    - mixed +
    + boolean $debug +
    +
    + boolean + $show_errors
    @@ -118,18 +122,43 @@

    Class ezSQL_codeigniter

    -
    +
    - mixed + boolean $debug - = true (line 17) + = true (line 21) + +
    + + +

    Run in debug mode

    +
      +
    • var: Default is true
    • +
    • access: public
    • +
    + + + + + +
    + +
    + +
    + + boolean + $show_errors + = true (line 27)
    +

    Show errors

      +
    • var: Default is true
    • access: public
    @@ -159,6 +188,12 @@

    Inherited Variables

    ezSQLcore::$col_info
    +
    + + ezSQLcore::$connected
    +
    + + ezSQLcore::$dbh
    ezSQLcore::$db_connect_time
    @@ -234,7 +269,7 @@

    Inherited Variables

    - Constructor __construct (line 23) + Constructor __construct (line 33)
    @@ -263,7 +298,7 @@

    Inherited Variables

    - escape (line 154) + escape (line 164)
    @@ -295,7 +330,7 @@

    Inherited Variables

    - query (line 39) + query (line 49)
    @@ -338,6 +373,7 @@

    Inherited Methods

    ezSQLcore::get_set()
    ezSQLcore::get_var()
    ezSQLcore::hide_errors()
    + ezSQLcore::isConnected()
    ezSQLcore::register_error()
    ezSQLcore::show_errors()
    ezSQLcore::store_cache()
    @@ -387,7 +423,7 @@

    Inherited Constants

    - Documentation generated on Sun, 01 Apr 2012 23:51:54 +0200 by phpDocumentor 1.4.4 + Documentation generated on Fri, 06 Apr 2012 01:26:19 +0200 by phpDocumentor 1.4.4

    \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/ezSQL_mssql.html b/_Documentation/phpDocumentator/ezSQL/ezSQL_mssql.html index 3c5e2cb5..4ab024d5 100644 --- a/_Documentation/phpDocumentator/ezSQL/ezSQL_mssql.html +++ b/_Documentation/phpDocumentator/ezSQL/ezSQL_mssql.html @@ -16,7 +16,7 @@

    Class ezSQL_mssql

    Description