Source for file EDB_Common.php
Documentation is available at EDB_Common.php
* Project: EDB_Common :: Common API for EDB class
* File: EDB/EDB_Common.php
* The EDB_Common class is common api that used internally
* @author JoungKyun.Kim <http://oops.org>
* @copyright (c) 2018, JoungKyun.Kim
* @link http://pear.oops.org/package/EDB
* Store sql query in session
* Result marking for free
// {{{ (bool) EDB_Common:: file_exists (void)
* Checks whether a file or directory exists
* If don't find file, and re-search include_path
* @return boolean Returns TRUE if the file or directory specified by filename exists; FALSE otherwise.
* @param string Path to the file or directory.
} catch ( Exception $e ) {
foreach ( $path as $dir ) {
// {{{ (int) EDB_Common:: switch_freemark (void)
// {{{ (int) EDB_Common:: get_param_number ($sql)
* Get number of query parameters
* @return integer The number of parameters
* @param string Bind query string
for ( $i= 0; $i< $r; $i++ )
// for ( $i=0; $i<$r; $i++ )
// $sql = preg_replace ('/\?/', ':param' . ($i + 1), $sql, 1);
// {{{ (bool) EDB_Common::check_param ($parameters)
* Check parameter type and parameters
* @param array The parameter of bind query
if ( count ($param) < 2 )
if ( $len != count ($param) )
for ( $i= 0; $i< $len; $i++ ) {
"The ${no}th parameter type of query is not numeric type",
case 'f' : // float, double
"The ${no}th parameter type of query is not double type",
"The ${no}th parameter type of query is not null type",
case 's' : // string. by pass
"The ${no}th parameter type of query is unsupported type",
// {{{ (string) EDB_Common::bind_param ($sql, $param)
* replace bind parameters to parameter's value
* @param string SQL query statement
* @param array array of parameter values
for ( $i= 0; $i< $c; $i++ ) {
if ( ! strncmp ('unquote:', $params[$i], 8) ) {
$params[$i] = substr ($params[$i], 8);
$sql = sprintf ($buf, $params[$i]);
* vim: set filetype=php noet sw=4 ts=4 fdm=marker:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
|