PHP Class ezSQLcore

ファイルを表示 Open project: jv2222/ezsql Class Usage Examples

Public Properties

Property Type Description
$cache_dir
$cache_inserts
$cache_queries
$cache_timeout
$captured_errors
$col_info
$conn_queries
$db_connect_time
$debug_all same as $debug_all
$debug_called same as $trace
$debug_echo_is_on == TJH == default now needed for echo of debug function
$do_profile
$last_error
$last_query
$num_queries
$profile_times
$show_errors
$sql_log_file
$timers hours
$total_query_time
$trace
$trace_log
$use_disk_cache
$use_trace_log
$vardump_called

Public Methods

Method Description
__construct ( ) ******************************************************************** Constructor
count ( boolean $all = true, boolean $increase = false ) : integer Function for operating query count
debug ( $print_to_screen = true ) ******************************************************************** Displays the last query string that was sent to the database & a table listing results (if there were any).
donation ( ) ******************************************************************** Naughty little function to ask for some remuniration!
dumpvar ( $mixed ) ******************************************************************** Alias for the above function
flush ( ) ******************************************************************** Kill cached query results
get_cache ( $query ) ******************************************************************** get_cache
get_col ( $query = null, $x ) ******************************************************************** Function to get 1 column from the cached result set based in X index see docs for usage and info
get_col_info ( $info_type = "name", $col_offset ) ******************************************************************** Function to get column meta data info pertaining to the last query see docs for more info and usage
get_host_port ( $host, $default = false ) ******************************************************************** Get host and port from an "host:port" notation.
get_results ( $query = null, $output = OBJECT ) ******************************************************************** Return the the query as a result set - see docs for more details
get_row ( $query = null, $output = OBJECT, $y ) ******************************************************************** Get one row from the DB - see docs for more detail
get_set ( $params ) ******************************************************************** Creates a SET nvp sql string from an associative array (and escapes all values)
get_var ( $query = null, $x, $y ) ******************************************************************** Get one variable from the DB - see docs for more detail
hide_errors ( )
register_error ( $err_str ) ******************************************************************** Print SQL/DB error - over-ridden by specific DB class
show_errors ( ) ******************************************************************** Turn error handling on or off.
store_cache ( $query, $is_insert ) ******************************************************************** store_cache
timer_elapsed ( $timer_name )
timer_get_cur ( ) ******************************************************************** Timer related functions
timer_start ( $timer_name )
timer_update_global ( $timer_name )
vardump ( $mixed = '' ) ******************************************************************** Dumps the contents of any input variable to screen in a nicely formatted and easy to understand way - any type: Object, Var or Array

Method Details

__construct() public method

******************************************************************** Constructor
public __construct ( )

count() public method

Function for operating query count
public count ( boolean $all = true, boolean $increase = false ) : integer
$all boolean Set to false for function to return queries only during this connection
$increase boolean Set to true to increase query count (internal usage)
return integer Returns query count base on $all

debug() public method

(abstracted into a seperate file to save server overhead).
public debug ( $print_to_screen = true )

donation() public method

******************************************************************** Naughty little function to ask for some remuniration!
public donation ( )

dumpvar() public method

******************************************************************** Alias for the above function
public dumpvar ( $mixed )

flush() public method

******************************************************************** Kill cached query results
public flush ( )

get_cache() public method

******************************************************************** get_cache
public get_cache ( $query )

get_col() public method

******************************************************************** Function to get 1 column from the cached result set based in X index see docs for usage and info
public get_col ( $query = null, $x )

get_col_info() public method

******************************************************************** Function to get column meta data info pertaining to the last query see docs for more info and usage
public get_col_info ( $info_type = "name", $col_offset )

get_host_port() public method

Returns array of host and port. If port is omitted, returns $default
public get_host_port ( $host, $default = false )

get_results() public method

******************************************************************** Return the the query as a result set - see docs for more details
public get_results ( $query = null, $output = OBJECT )

get_row() public method

******************************************************************** Get one row from the DB - see docs for more detail
public get_row ( $query = null, $output = OBJECT, $y )

get_set() public method

Usage: $db_data = array('login'=>'jv','email'=>'[email protected]', '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 = '[email protected]', user_id = 1, created = NOW()
public get_set ( $params )

get_var() public method

******************************************************************** Get one variable from the DB - see docs for more detail
public get_var ( $query = null, $x, $y )

hide_errors() public method

public hide_errors ( )

register_error() public method

******************************************************************** Print SQL/DB error - over-ridden by specific DB class
public register_error ( $err_str )

show_errors() public method

.
public show_errors ( )

store_cache() public method

******************************************************************** store_cache
public store_cache ( $query, $is_insert )

timer_elapsed() public method

public timer_elapsed ( $timer_name )

timer_get_cur() public method

******************************************************************** Timer related functions
public timer_get_cur ( )

timer_start() public method

public timer_start ( $timer_name )

timer_update_global() public method

public timer_update_global ( $timer_name )

vardump() public method

******************************************************************** Dumps the contents of any input variable to screen in a nicely formatted and easy to understand way - any type: Object, Var or Array
public vardump ( $mixed = '' )

Property Details

$cache_dir public_oe property

public $cache_dir

$cache_inserts public_oe property

public $cache_inserts

$cache_queries public_oe property

public $cache_queries

$cache_timeout public_oe property

public $cache_timeout

$captured_errors public_oe property

public $captured_errors

$col_info public_oe property

public $col_info

$conn_queries public_oe property

public $conn_queries

$db_connect_time public_oe property

public $db_connect_time

$debug_all public_oe property

same as $debug_all
public $debug_all

$debug_called public_oe property

same as $trace
public $debug_called

$debug_echo_is_on public_oe property

== TJH == default now needed for echo of debug function
public $debug_echo_is_on

$do_profile public_oe property

public $do_profile

$last_error public_oe property

public $last_error

$last_query public_oe property

public $last_query

$num_queries public_oe property

public $num_queries

$profile_times public_oe property

public $profile_times

$show_errors public_oe property

public $show_errors

$sql_log_file public_oe property

public $sql_log_file

$timers public_oe property

hours
public $timers

$total_query_time public_oe property

public $total_query_time

$trace public_oe property

public $trace

$trace_log public_oe property

public $trace_log

$use_disk_cache public_oe property

public $use_disk_cache

$use_trace_log public_oe property

public $use_trace_log

$vardump_called public_oe property

public $vardump_called