SequoiaDB
 All Classes Files Functions Variables Pages
Functions
driver_function.php File Reference

driver function More...

Functions

 sdbInitClient ($config)
 

Detailed Description

driver function

Function Documentation

sdbInitClient (   $config)

Open cache strategy to improve performance

Parameters
$configan array argument. The configuration, the options as below:
enableCacheStrategy : a boolean argument. The flag to open the cache strategy.
cacheTimeInterval : an integer argument. The life cycle of cached object.
Returns
Returns the number of errno.
Return values
integererrno

Example: open cache

$rc = sdbInitClient( array( 'enableCacheStrategy' => true, 'cacheTimeInterval' => 200 ) ) ;
if( $rc != 0 )
{
echo "Failed to open cache, error code: ".$rc ;
return ;
}
$db = new SequoiaDB() ;
$err = $db -> connect( "192.168.1.10:11810" ) ;
if( $err['errno'] != 0 ) {
echo "Failed to connect database, error code: ".$err['errno'] ;
return ;
}
$cs = $db -> selectCS( 'foo' ) ;
if( empty( $cs ) ) {
$err = $db -> getLastErrorMsg() ;
echo "Failed to call selectCS, error code: ".$err['errno'] ;
return ;
}