本文整理汇总了PHP中dba_handlers函数的典型用法代码示例。如果您正苦于以下问题:PHP dba_handlers函数的具体用法?PHP dba_handlers怎么用?PHP dba_handlers使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dba_handlers函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildPathCache
function buildPathCache($paths, $last, $cwd, $zcache)
{
$parentPaths = array();
$populated = array();
$old_db_line = false;
if (file_exists($cwd . '.patchwork.paths.txt')) {
$old_db = @fopen($cwd . '.patchwork.paths.txt', 'rb');
$old_db && ($old_db_line = fgets($old_db));
} else {
$old_db = false;
}
$tmp = $cwd . '.~' . uniqid(mt_rand(), true);
$db = fopen($tmp, 'wb');
$paths = array_flip($paths);
unset($paths[$cwd]);
uksort($paths, array($this, 'dirCmp'));
foreach ($paths as $h => $level) {
$this->populatePathCache($populated, $old_db, $old_db_line, $db, $parentPaths, $paths, substr($h, 0, -1), $level, $last);
}
$db && fclose($db);
$old_db && fclose($old_db);
$h = $cwd . '.patchwork.paths.txt';
'\\' === DIRECTORY_SEPARATOR && file_exists($h) && @unlink($h);
rename($tmp, $h) || unlink($tmp);
if (function_exists('dba_handlers')) {
$h = array('cdb', 'db2', 'db3', 'db4', 'qdbm', 'gdbm', 'ndbm', 'dbm', 'flatfile', 'inifile');
$h = array_intersect($h, dba_handlers());
$h || ($h = dba_handlers());
if ($h) {
foreach ($h as $db) {
if ($h = @dba_open($tmp, 'nd', $db, 0600)) {
break;
}
}
}
} else {
$h = false;
}
if ($h) {
foreach ($parentPaths as $paths => &$level) {
sort($level);
dba_insert($paths, implode(',', $level), $h);
}
dba_close($h);
$h = $cwd . '.patchwork.paths.db';
'\\' === DIRECTORY_SEPARATOR && file_exists($h) && @unlink($h);
rename($tmp, $h) || unlink($tmp);
} else {
$db = false;
foreach ($parentPaths as $paths => &$level) {
sort($level);
$paths = md5($paths) . '.' . substr(md5($cwd), -6) . '.path.txt';
$h = $zcache . $paths[0] . DIRECTORY_SEPARATOR . $paths[1] . DIRECTORY_SEPARATOR;
file_exists($h) || mkdir($h, 0700, true);
file_put_contents($h . $paths, implode(',', $level));
}
}
return $db;
}
示例2: haveExtension
/**
* Returns true if the native extension is available
*
* @return bool
*/
public static function haveExtension()
{
if (!function_exists('dba_handlers')) {
return false;
}
$handlers = dba_handlers();
if (!in_array('cdb', $handlers) || !in_array('cdb_make', $handlers)) {
return false;
}
return true;
}
示例3: __construct
/**
* @param string $file the cache-file.
*
* @param string $handler the dba handler.
*
* You have to install one of this handlers before use.
*
* cdb = Tiny Constant Database - for reading.
* cdb_make = Tiny Constant Database - for writing.
* db4 = Oracle Berkeley DB 4 - for reading and writing.
* qdbm = Quick Database Manager - for reading and writing.
* gdbm = GNU Database Manager - for reading and writing.
* flatfile = default dba extension - for reading and writing.
*
* Use flatfile-handler only when you cannot install one,
* of the libraries required by the other handlers,
* and when you cannot use bundled cdb handler.
*
* @param string $mode For read/write access, database creation if it doesn't currently exist.
*
* @param boolean $persistently
*
* @throws \RuntimeException If no DBA extension or handler installed.
*/
public function __construct($file, $handler = 'flatfile', $mode = 'c', $persistently = true)
{
if (false === extension_loaded('dba')) {
throw new \RuntimeException('The DBA extension is required for this wrapper, but the extension is not loaded');
}
if (false === in_array($handler, dba_handlers(false))) {
throw new \RuntimeException('The ' . $handler . ' handler is required for the DBA extension, but the handler is not installed');
}
$this->dba = true === $persistently ? dba_popen($file, $mode, $handler) : dba_open($file, $mode, $handler);
$this->file = $file;
$this->handler = $handler;
}
示例4: getID3_cached_dbm
public function getID3_cached_dbm($cache_type, $dbm_filename, $lock_filename)
{
// Check for dba extension
if (!extension_loaded('dba')) {
throw new Exception('PHP is not compiled with dba support, required to use DBM style cache.');
}
// Check for specific dba driver
if (!function_exists('dba_handlers') || !in_array($cache_type, dba_handlers())) {
throw new Exception('PHP is not compiled --with ' . $cache_type . ' support, required to use DBM style cache.');
}
// Create lock file if needed
if (!file_exists($lock_filename)) {
if (!touch($lock_filename)) {
throw new Exception('failed to create lock file: ' . $lock_filename);
}
}
// Open lock file for writing
if (!is_writeable($lock_filename)) {
throw new Exception('lock file: ' . $lock_filename . ' is not writable');
}
$this->lock = fopen($lock_filename, 'w');
// Acquire exclusive write lock to lock file
flock($this->lock, LOCK_EX);
flock($this->lock, LOCK_EX);
// Create dbm-file if needed
if (!file_exists($dbm_filename)) {
if (!touch($dbm_filename)) {
throw new Exception('failed to create dbm file: ' . $dbm_filename);
}
}
// Try to open dbm file for writing
$this->dba = dba_open($dbm_filename, 'w', $cache_type);
if (!$this->dba) {
// Failed - create new dbm file
$this->dba = dba_open($dbm_filename, 'n', $cache_type);
if (!$this->dba) {
throw new Exception('failed to create dbm file: ' . $dbm_filename);
}
// Insert getID3 version number
dba_insert(getID3::VERSION, getID3::VERSION, $this->dba);
}
// Init misc values
$this->cache_type = $cache_type;
$this->dbm_filename = $dbm_filename;
// Register destructor
register_shutdown_function(array($this, '__destruct'));
// Check version number and clear cache if changed
if (dba_fetch(getID3::VERSION, $this->dba) != getID3::VERSION) {
$this->clear_cache();
}
parent::__construct();
}
示例5: __construct
/**
* @param string $file the cache-file.
*
* @param string $handler the dba handler.
*
* You have to install one of this handlers before use.
*
* cdb = Tiny Constant Database - for reading.
* cdb_make = Tiny Constant Database - for writing.
* db4 = Oracle Berkeley DB 4 - for reading and writing.
* qdbm = Quick Database Manager - for reading and writing.
* gdbm = GNU Database Manager - for reading and writing.
* inifile = Ini File - for reading and writing.
* flatfile = default dba extension - for reading and writing.
*
* Use "flatfile" only when you cannot install one, of the libraries
* required by the other handlers, and when you cannot use bundled cdb handler.
*
* @param string $mode For read/write access, database creation if it doesn't currently exist.
*
* r = for read access
* w = for read/write access to an already existing database
* c = for read/write access and database creation if it doesn't currently exist
* n = for create, truncate and read/write access
*
* When you are absolutely sure that you do not require database locking you can use "-" as suffix.
*
* @param boolean $persistently
*
* @throws \RuntimeException If no DBA extension or handler installed.
*/
public function __construct($file, $handler = 'flatfile', $mode = 'c', $persistently = true)
{
if (!extension_loaded('dba')) {
throw new \RuntimeException('missing ext/dba');
}
if (!function_exists('dba_handlers') || !in_array($handler, dba_handlers(false))) {
throw new \RuntimeException("dba-handler '{$handler}' not supported");
}
$this->dba = true === $persistently ? @dba_popen($file, $mode, $handler) : @dba_open($file, $mode, $handler);
if ($this->dba === false) {
$err = error_get_last();
throw new \RuntimeException($err['message']);
}
$this->storage = $file;
$this->handler = $handler;
}
示例6: DbaDatabase
function DbaDatabase($filename, $mode = false, $handler = 'gdbm')
{
$this->_file = $filename;
$this->_handler = $handler;
$this->_timeout = DBA_DATABASE_DEFAULT_TIMEOUT;
$this->_dbh = false;
if (function_exists("dba_handlers")) {
// since 4.3.0
if (!in_array($handler, dba_handlers())) {
$this->_error(sprintf(_("The DBA handler %s is unsupported!") . "\n" . _("Supported handlers are: %s"), $handler, join(",", dba_handlers())));
}
}
if ($mode) {
$this->open($mode);
}
}
示例7: _on_initialize
/**
* This handler completes the configuration.
*/
public function _on_initialize()
{
// We need to serialize data
$this->_auto_serialize = true;
if (array_key_exists('handler', $this->_config)) {
$this->_handler = $this->_config['handler'];
} else {
$handlers = dba_handlers();
if (in_array('db4', $handlers)) {
$this->_handler = 'db4';
} else {
if (in_array('db3', $handlers)) {
$this->_handler = 'db3';
} else {
if (in_array('db2', $handlers)) {
$this->_handler = 'db2';
} else {
if (in_array('gdbm', $handlers)) {
$this->_handler = 'gdbm';
} else {
if (in_array('flatfile', $handlers)) {
$this->_handler = 'flatfile';
} else {
debug_print_r("Failed autodetection of a usable DBA handler. Found handlers were: {$handlers}");
throw new midcom_error('Failed autodetection of a usable DBA handler');
}
}
}
}
}
}
$this->_filename = "{$this->_cache_dir}{$this->_name}.{$this->_handler}";
// Check for file existence by opening it once for write access.
if (!file_exists($this->_filename)) {
$handle = dba_open($this->_filename, 'c', $this->_handler);
if ($handle === false) {
throw new midcom_error("Failed to open the database {$this->_filename} for creation.");
}
dba_close($handle);
}
debug_add("DBA Cache backend '{$this->_name}' initialized to file: {$this->_filename}");
}
示例8: setUp
public function setUp()
{
if (!extension_loaded('dba')) {
try {
new Cache\Storage\Adapter\Dba();
$this->fail("Expected exception Zend\\Cache\\Exception\\ExtensionNotLoadedException");
} catch (Cache\Exception\ExtensionNotLoadedException $e) {
$this->markTestSkipped("Missing ext/dba");
}
}
if (!in_array($this->handler, dba_handlers())) {
try {
new Cache\Storage\Adapter\DbaOptions(array('handler' => $this->handler));
$this->fail("Expected exception Zend\\Cache\\Exception\\ExtensionNotLoadedException");
} catch (Cache\Exception\ExtensionNotLoadedException $e) {
$this->markTestSkipped("Missing ext/dba handler '{$this->handler}'");
}
}
$this->temporaryDbaFile = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid('zfcache_dba_');
$this->_options = new Cache\Storage\Adapter\DbaOptions(array('pathname' => $this->temporaryDbaFile, 'handler' => $this->handler));
$this->_storage = new Cache\Storage\Adapter\Dba();
$this->_storage->setOptions($this->_options);
parent::setUp();
}
示例9: _php2cdb
/**
* Создает из PHP-словаря словарь в формате CDB (файл с расширением .cdb в той же директории).
* Yoficator.dic.php (UTF-8) => Yoficator.dic.cdb (UTF-8)
*
* @link http://ru2.php.net/dba
* @return bool TRUE, если словарь создан, FALSE в противном случае (CDB не поддерживается или файл уже существует).
*/
private function _php2cdb()
{
if (!function_exists('dba_open') || !array_key_exists('cdb_make', dba_handlers(true))) {
return false;
}
$filename = $this->_filename('cdb');
if (file_exists($filename)) {
return false;
}
if (!is_array($this->dic)) {
include $this->_filename('php');
}
$db = dba_open($filename, 'n', 'cdb_make');
if ($db === false) {
return false;
}
#нет права доступа на запись в папку
foreach ($this->dic as $k => $v) {
dba_insert($k, $v, $db);
}
dba_optimize($db);
dba_close($db);
}
示例10: elseif
echo '<div class="alert alert-success">' . $msg . '</div>';
} elseif (isset($check) && $check === false) {
echo '<div class="alert alert-error"><strong>NO!</strong> ' . $msg . '</div>';
}
}
// retrieve an cache and a cache-sweeper.
try {
list($cache, $sweep) = factory($config);
} catch (Exception $exception) {
die($exception->getMessage());
}
// load the configuration at the global namespace.
extract($config);
// make a list of all the available handlers.
$available_handlers = $handler_in_use = '';
foreach (dba_handlers(true) as $handler_name => $handler_version) {
$handler_version = str_replace('$', '', $handler_version);
if ($handler == $handler_name) {
$handler_in_use = "{$handler_name}: {$handler_version} <br />";
continue;
}
$available_handlers .= "{$handler_name}: {$handler_version} <br />";
}
// compute the user authentication.
$authenticated = false;
if (isset($_POST['login']) || isset($_SERVER['PHP_AUTH_USER'])) {
if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']) || $_SERVER['PHP_AUTH_USER'] != $authentication['username'] || $_SERVER['PHP_AUTH_PW'] != $authentication['password']) {
header("WWW-Authenticate: Basic realm=\"PHP DBA Cache Login\"");
header("HTTP/1.0 401 Unauthorized");
exit;
}
示例11: debug
public function debug()
{
$html = [];
$html[] = "Available DBA handlers:\n<ul>\n";
foreach (dba_handlers(true) as $handler_name => $handler_version) {
// clean the versions
$handler_version = str_replace('$', '', $handler_version);
$html[] = "<li>{$handler_name}: {$handler_version}</li>\n";
}
$html[] = "</ul>\n";
$html[] = "All opened databases:\n<ul>\n";
foreach (dba_list() as $res_id => $db_name) {
// clean the versions
$html[] = "<li>{$res_id} : {$db_name}</li>\n";
}
$html[] = "</ul>\n";
return $html;
}
示例12: _getHostConfig
function _getHostConfig()
{
print '<div class="check">';
if (function_exists("dba_open")) {
print '<h3>' . _t("Check a dba configuration") . '</h3>';
$dbtypes = dba_handlers(true);
$dbtests = array('db4', 'db3', 'db2', 'gdbm', 'flatfile');
foreach ($dbtests as $mydb) {
if (isset($dbtypes[$mydb])) {
$config['dba_type'] = $mydb;
break;
}
}
if (!empty($config['dba_type'])) {
print '<ul><li>' . sprintf(_t("%s is selected."), "<b>{$config['dba_type']}</b>") . '</li></ul>';
} else {
print '<p>' . sprintf(_t("No \$dba_type selected.")) . '</p>';
}
}
// set random seed for security
$config['seed'] = randstr(64);
preg_match("/Apache\\/2\\./", $_SERVER['SERVER_SOFTWARE'], $match);
if (preg_match('/^\\d+\\.\\d+\\.\\d+\\.\\d+$/', $_SERVER['SERVER_ADDR'])) {
$host = $_SERVER['SERVER_ADDR'];
} else {
$host = $_SERVER['SERVER_NAME'];
}
if (empty($match)) {
$config['query_prefix'] = '?';
while (ini_get('allow_url_fopen')) {
print '<h3>' . _t("Check a AcceptPathInfo setting for Apache 2.x.xx") . '</h3>';
print '<ul>';
$fp = @fopen('http://' . $host . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['SCRIPT_NAME'] . '/pathinfo?action=pathinfo', 'r');
$out = '';
if ($fp) {
while (!feof($fp)) {
$out .= fgets($fp, 2048);
}
} else {
print "<li><b><a href='http://moniwiki.kldp.net/wiki.php/AcceptPathInfo'>AcceptPathInfo</a> <font color='red'>" . _t("Off") . "</font></b><li>\n";
print '</ul>';
break;
}
fclose($fp);
if ($out[0] == '*') {
print "<li><b><a href='http://moniwiki.kldp.net/wiki.php/AcceptPathInfo'>AcceptPathInfo</a> <font color='red'>" . _t("Off") . "</font></b></li>\n";
} else {
print "<li><b>AcceptPathInfo <font color='blue'>" . _t("On") . "</font></b></li>\n";
$config['query_prefix'] = '/';
}
print '</ul>';
break;
}
}
$url_prefix = preg_replace("/\\/([^\\/]+)\\.php\$/", "", $_SERVER['SCRIPT_NAME']);
$config['url_prefix'] = $url_prefix;
$user = getenv('LOGNAME');
$user = $user ? $user : 'root';
$config['rcs_user'] = $user;
if (getenv("OS") == "Windows_NT") {
$config['timezone'] = "'-09-09'";
// http://kldp.net/forum/message.php?msg_id=7675
// http://bugs.php.net/bug.php?id=22418
//$config['version_class']="'RcsLite'";
$config['path'] = './bin;';
if (is_dir('../bin')) {
$config['path'] .= '../bin;';
}
// packaging for win32
$config['path'] .= 'c:/program files/vim/vimXX';
$config['vartmp_dir'] = "c:/tmp/";
} else {
$config['rcs_user'] = 'root';
// XXX
}
if (!file_exists('wikilib.php')) {
$checkfile = array('plugin', 'locale');
$dir = '';
foreach ($checkfile as $f) {
if (is_link($f)) {
$dir = dirname(readlink($f));
}
}
$config['include_path'] = ".:{$dir}";
}
print '</div>';
return $config;
}
示例13: _variable
$properties["SQL Database Name"] = new _variable('_dsn_sqldbname', "phpwiki", "\nSQL Database Name:");
$dsn_sqltype = $properties["SQL Type"]->value();
$dsn_sqluser = $properties["SQL User"]->value();
$dsn_sqlpass = $properties["SQL Password"]->value();
$dsn_sqlhostorsock = $properties["SQL Database Host"]->value();
$dsn_sqldbname = $properties["SQL Database Name"]->value();
$dsn_sqlstring = $dsn_sqltype . "://{$dsn_sqluser}:{$dsn_sqlpass}@{$dsn_sqlhostorsock}/{$dsn_sqldbname}";
$properties["SQL dsn"] = new unchangeable_define("DATABASE_DSN", $dsn_sqlstring, "\nCalculated from the settings above:");
$properties["Filename / Table name Prefix"] = new _define_commented("DATABASE_PREFIX", DATABASE_PREFIX, "\nUsed by all DB types:\n\nPrefix for filenames or table names, e.g. \"phpwiki_\"\n\nCurrently <b>you MUST EDIT THE SQL file too!</b> (in the schemas/\ndirectory because we aren't doing on the fly sql generation\nduring the installation.");
$properties["DATABASE_PERSISTENT"] = new boolean_define_commented_optional('DATABASE_PERSISTENT', array('false' => "Disabled", 'true' => "Enabled"));
$properties["DB Session table"] = new _define_optional("DATABASE_SESSION_TABLE", DATABASE_SESSION_TABLE, "\nTablename to store session information. Only supported by SQL backends.\n\nA word of warning - any prefix defined above will be prepended to whatever is given here.\n");
//TODO: $TEMP
$temp = !empty($_ENV['TEMP']) ? $_ENV['TEMP'] : "/tmp";
$properties["dba directory"] = new _define("DATABASE_DIRECTORY", $temp);
// TODO: list the available methods
$properties["dba handler"] = new _define_selection('DATABASE_DBA_HANDLER', array('gdbm' => "gdbm - GNU database manager (not recommended anymore)", 'dbm' => "DBM - Redhat default. On sf.net there's dbm and not gdbm anymore", 'db2' => "DB2 - BerkeleyDB (Sleepycat) DB2", 'db3' => "DB3 - BerkeleyDB (Sleepycat) DB3. Default on Windows but not on every Linux", 'db4' => "DB4 - BerkeleyDB (Sleepycat) DB4."), "\nUse 'gdbm', 'dbm', 'db2', 'db3' or 'db4' depending on your DBA handler methods supported: <br > " . (function_exists("dba_handlers") ? join(", ", dba_handlers()) : "") . "\n\nBetter not use other hacks such as inifile, flatfile or cdb");
$properties["dba timeout"] = new numeric_define("DATABASE_TIMEOUT", DATABASE_TIMEOUT, "\nRecommended values are 10-20 seconds. The more load the server has, the higher the timeout.");
$properties["DBADMIN_USER"] = new _define_optional('DBADMIN_USER', DBADMIN_USER . "\nIf action=upgrade detects mysql problems, but has no ALTER permissions, \ngive here a database username which has the necessary ALTER or CREATE permissions.\nOf course you can fix your database manually. See lib/upgrade.php for known issues.");
$properties["DBADMIN_PASSWD"] = new _define_password_optional('DBADMIN_PASSWD', DBADMIN_PASSWD);
///////////////////
$properties["Page Revisions"] = new unchangeable_variable('_parttworevisions', "", "\n\nSection 2a: Archive Cleanup\nThe next section controls how many old revisions of each page are kept in the database.\n\nThere are two basic classes of revisions: major and minor. Which\nclass a revision belongs in is determined by whether the author\nchecked the \"this is a minor revision\" checkbox when they saved the\npage.\n \nThere is, additionally, a third class of revisions: author\nrevisions. The most recent non-mergable revision from each distinct\nauthor is and author revision.\n\nThe expiry parameters for each of those three classes of revisions\ncan be adjusted seperately. For each class there are five\nparameters (usually, only two or three of the five are actually\nset) which control how long those revisions are kept in the\ndatabase.\n<dl>\n <dt>max_keep:</dt> <dd>If set, this specifies an absolute maximum for the\n number of archived revisions of that class. This is\n meant to be used as a safety cap when a non-zero\n min_age is specified. It should be set relatively high,\n and it's purpose is to prevent malicious or accidental\n database overflow due to someone causing an\n unreasonable number of edits in a short period of time.</dd>\n\n <dt>min_age:</dt> <dd>Revisions younger than this (based upon the supplanted\n date) will be kept unless max_keep is exceeded. The age\n should be specified in days. It should be a\n non-negative, real number,</dd>\n\n <dt>min_keep:</dt> <dd>At least this many revisions will be kept.</dd>\n\n <dt>keep:</dt> <dd>No more than this many revisions will be kept.</dd>\n\n <dt>max_age:</dt> <dd>No revision older than this age will be kept.</dd>\n</dl>\nSupplanted date: Revisions are timestamped at the instant that they\ncease being the current revision. Revision age is computed using\nthis timestamp, not the edit time of the page.\n\nMerging: When a minor revision is deleted, if the preceding\nrevision is by the same author, the minor revision is merged with\nthe preceding revision before it is deleted. Essentially: this\nreplaces the content (and supplanted timestamp) of the previous\nrevision with the content after the merged minor edit, the rest of\nthe page metadata for the preceding version (summary, mtime, ...)\nis not changed.\n");
// For now the expiration parameters are statically inserted as
// an unchangeable property. You'll have to edit the resulting
// config file if you really want to change these from the default.
$properties["Major Edits: keep minimum days"] = new numeric_define("MAJOR_MIN_KEEP", MAJOR_MIN_KEEP, "\nDefault: Keep for unlimited time. \nSet to 0 to enable archive cleanup");
$properties["Minor Edits: keep minumum days"] = new numeric_define("MINOR_MIN_KEEP", MINOR_MIN_KEEP, "\nDefault: Keep for unlimited time. \nSet to 0 to enable archive cleanup");
$properties["Major Edits: how many"] = new numeric_define("MAJOR_KEEP", MAJOR_KEEP, "\nKeep up to 8 major edits");
$properties["Major Edits: how many days"] = new numeric_define("MAJOR_MAX_AGE", MAJOR_MAX_AGE, "\nkeep them no longer than a month");
$properties["Minor Edits: how many"] = new numeric_define("MINOR_KEEP", MINOR_KEEP, "\nKeep up to 4 minor edits");
$properties["Minor Edits: how many days"] = new numeric_define("MINOR_MAX_AGE", "7", "\nkeep them no longer than a week");
$properties["per Author: how many"] = new numeric_define("AUTHOR_KEEP", "8", "\nKeep the latest contributions of the last 8 authors,");
示例14: CONNECT
function CONNECT($dba_file)
{
$avail = array_reverse(dba_handlers());
$try = substr($dba_file, strrpos($dba_file, ".") + 1);
$try = array_merge(array($try, "gdbm", "db7", "db3", "db2", "flatfile", "db6", "db4", "db5", "ndbm", "dbm"), $avail);
$handle = false;
foreach ($try as $dba_handler) {
if (in_array($dba_handler, $avail)) {
foreach (array("w", "c", "n") as $mode) {
if ($handle = dba_open($dba_file, $mode, $dba_handler)) {
#echo "USING($dba_handler), ";
if ($mode != "w") {
dba_close($handle);
$handle = dba_open($dba_file, "w", $dba_handler);
}
break 2;
}
}
}
}
return $handle;
}
示例15: testQdbm
public function testQdbm()
{
$drivers = dba_handlers(FALSE);
$this->assertContains(FlatFileDB::HANDLER, $drivers);
}