KjwFakeSql Class Reference

KjwFakeSql is an abstract class to alleviate the construction of fake sql supporting classes. More...

Inheritance diagram for KjwFakeSql:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 KjwFakeSql ($sqltype, $unused_host, $unused_port, $unused_user, $unused_pass, $lockpath=null)
 Construct a KjwFakeSql object.
 destroy ()
 Destructor performing cleanup.
 connect ()
 Connect to the SQL server.
 disconnect ()
 Disconnect from the SQL server.
 _acquireLock ($type= 'RW', $retryCount=3, $waitMs=64)
 _releaseLock ()
 execute ($query)
 Execute a query.
 nameQuote ($name)
 Quote a name for an object (column or table).
 _nameUnquote ($quoted)
 [PRIVATE] Undo what nameQuote does.
 safeQuote ($mixed)
 Makes sure that any variable is quoted like its correct type should be.
 _safeUnquote ($quoted)
 _splitColumns ($string)
 _splitValues ($string)

Public Attributes

 $_lockName = null
 $_lockHandle = null
 $_locked = null


Detailed Description

KjwFakeSql is an abstract class to alleviate the construction of fake sql supporting classes.

It's supposed to be a temporary solution for tiny database needs.

Definition at line 15 of file KjwFakeSql.php.


Member Function Documentation

KjwFakeSql::connect (  ) 

Connect to the SQL server.

Returns:
True.
Todo:
Put timing on connect, so we don't have to wait 60secs on firewalled server.

Reimplemented from KjwSql.

Definition at line 42 of file KjwFakeSql.php.

References $kjw_suppressed_error, and KjwObject::croak().

KjwFakeSql::destroy (  ) 

Destructor performing cleanup.

Don't rely on this being called ever. The user must call it by hand.

Reimplemented from KjwSql.

Definition at line 36 of file KjwFakeSql.php.

References disconnect().

KjwFakeSql::disconnect (  ) 

Disconnect from the SQL server.

Returns:
Success boolean.

Reimplemented from KjwSql.

Definition at line 54 of file KjwFakeSql.php.

Referenced by destroy().

KjwFakeSql::execute ( query  ) 

Execute a query.

Parameters:
$query The query to execute.
Returns:
Returns a boolean specifying success or a KjwResult object on a select/show/describe/explain.

Reimplemented from KjwSql.

Definition at line 90 of file KjwFakeSql.php.

References _nameUnquote(), and KjwObject::croak().

KjwFakeSql::KjwFakeSql ( sqltype,
unused_host,
unused_port,
unused_user,
unused_pass,
lockpath = null 
)

Construct a KjwFakeSql object.

Parameters:
$sqltype SQL type name (e.g. 'xmlsql').
$unused_host Server name (possibly unused).
$unused_port Port number (possibly unused).
$unused_user User name (possibly unused).
$unused_pass Password (possibly unused).
$lockpath Lockfile name. Optional if you do your own locking. (Override _acquireLock/_releaseLock.)

Definition at line 30 of file KjwFakeSql.php.

References KjwSql::KjwSql().

Referenced by KjwXmlSql::KjwXmlSql().

KjwFakeSql::nameQuote ( string  ) 

Quote a name for an object (column or table).

For MySQL this would be by surrounding the name with backticks.

Parameters:
$string An identifier (column or table name) to be quoted.
Returns:
The quoted identifier.

Reimplemented from KjwSql.

Definition at line 150 of file KjwFakeSql.php.

KjwFakeSql::safeQuote ( mixed  ) 

Makes sure that any variable is quoted like its correct type should be.

Integers and booleans are returned as integers. Strings are returned as quoted strings with all quotes escaped. If the escaping mechanism is not known, all <32 and >127 characters REMOVED, otherwise the escaping for the specific database make is used.

Parameters:
$mixed The variable that needs to be returned as a safe entity.
Returns:
A quoted/escaped entity.

Reimplemented from KjwSql.

Definition at line 163 of file KjwFakeSql.php.


The documentation for this class was generated from the following file:

Generated on Wed Apr 8 22:16:35 2009 for KjwLib-php45 by  doxygen 1.5.8