当前位置: 首页>>代码示例>>PHP>>正文


PHP dba_delete函数代码示例

本文整理汇总了PHP中dba_delete函数的典型用法代码示例。如果您正苦于以下问题:PHP dba_delete函数的具体用法?PHP dba_delete怎么用?PHP dba_delete使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dba_delete函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 /**
  * Delete cache
  * @param string $id
  * @return boolean
  */
 public function delete($key)
 {
     if (!dba_exists($key, $this->_handler('r'))) {
         return true;
     }
     return dba_delete($key, $this->_handler('w'));
 }
开发者ID:Robert-Xie,项目名称:php-framework-benchmark,代码行数:12,代码来源:Dba.php

示例2: delete

 public function delete($key)
 {
     $rs = dba_open(DATA_DIR . '/kvstore/dba.db', 'wl', $this->handle);
     $ret = dba_delete($this->create_key($key), $rs);
     dba_close($rs);
     return $ret;
 }
开发者ID:syjzwjj,项目名称:quyeba,代码行数:7,代码来源:dba.php

示例3: new_access_token

 function new_access_token($token, $consumer)
 {
     /*{{{*/
     $token = $this->new_token($consumer, 'access');
     dba_delete("request_" . $token->key, $this->dbh);
     return $token;
 }
开发者ID:byjg,项目名称:xmlnuke,代码行数:7,代码来源:SimpleOAuthDataStore.php

示例4: db4_delete

function db4_delete($key)
{
    return dba_delete(bin4($key), $GLOBALS['db']);
}
开发者ID:JasonWoof,项目名称:square,代码行数:4,代码来源:db.php

示例5: add

 function add($key, $value, $exptime = 0)
 {
     wfProfileIn(__METHOD__);
     $blob = $this->encode($value, $exptime);
     $handle = $this->getWriter();
     if (!$handle) {
         wfProfileOut(__METHOD__);
         return false;
     }
     $ret = dba_insert($key, $blob, $handle);
     # Insert failed, check to see if it failed due to an expired key
     if (!$ret) {
         list($value, $expiry) = $this->decode(dba_fetch($key, $handle));
         if ($expiry < time()) {
             # Yes expired, delete and try again
             dba_delete($key, $handle);
             $ret = dba_insert($key, $blob, $handle);
             # This time if it failed then it will be handled by the caller like any other race
         }
     }
     dba_close($handle);
     wfProfileOut(__METHOD__);
     return $ret;
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:24,代码来源:DBABagOStuff.php

示例6: HyperCacheRetranslation_clean

function HyperCacheRetranslation_clean($dbfile)
{
    if (!is_file($dbfile)) {
        return;
    }
    $db_con = dba_open($dbfile, "r", "db4");
    if (!$db_con) {
        events("analyze:: FATAL!!!::{$dbfile}, unable to open");
        return null;
    }
    $mainkey = dba_firstkey($db_con);
    $f = array();
    $c = 0;
    while ($mainkey != false) {
        $fetch_content = @dba_fetch($mainkey, $db_con);
        $array = @unserialize($fetch_content);
        $filepath = $array["TARGET"];
        $FullPath = "{$GLOBALS["HyperCacheStoragePath"]}/{$filepath}";
        if (!is_file($FullPath)) {
            $f[$mainkey] = true;
            $mainkey = dba_nextkey($db_con);
            continue;
        }
        $mainkey = dba_nextkey($db_con);
    }
    @dba_close($db_con);
    if (count($f) == 0) {
        return;
    }
    $db_con = dba_open($dbfile, "c", "db4");
    if (!$db_con) {
        events("analyze:: FATAL!!!::{$dbfile}, unable to open");
        return null;
    }
    while (list($mainkey, $filetype) = each($f)) {
        dba_delete($mainkey, $db_con);
    }
    @dba_close($db_con);
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:39,代码来源:exec.squidcache.php

示例7: delete

 public function delete($key)
 {
     unset($this->cache[$key]);
     return dba_delete($key, $this->dbHandler);
 }
开发者ID:schpill,项目名称:thin,代码行数:5,代码来源:Dba.php

示例8: dba_open

// | License as published by the Free Software Foundation; either         |
// | version 2.1 of the License, or (at your option) any later version.   |
// |                                                                      |
// | This library is distributed in the hope that it will be useful,      |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of       |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU    |
// | Lesser General Public License for more details.                      |
// |                                                                      |
// | You should have received a copy of the GNU Lesser General Public     |
// | License along with this library; if not, write to the Free Software  |
// | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA|
// +----------------------------------------------------------------------+
// | Author: Brent Cook <busterb@mail.utexas.edu>                         |
// +----------------------------------------------------------------------+
//
// $Id: test_compatibility.php,v 1.2 2003/01/04 11:54:51 mj Exp $
//
// test functionality of the dba compatibility layer
require_once 'DBA/Compatibility.php';
$id = dba_open("file_test", "n", "db3");
if (!$id) {
    echo "dba_open failed\n";
    exit;
}
dba_insert("key", "This is an example!", $id);
dba_replace("key", "This is another example!", $id);
if (dba_exists("key", $id)) {
    echo dba_fetch("key", $id);
    dba_delete("key", $id);
}
dba_close($id);
开发者ID:laiello,项目名称:coopcrucial,代码行数:31,代码来源:test_compatibility.php

示例9: new_access_token

 function new_access_token($token, $consumer)
 {
     // TODO: check if request token is authorized first
     $token = $this->new_token($consumer, 'access');
     dba_delete("request_" . $token->key, $this->dbh);
     return $token;
 }
开发者ID:hgschmie,项目名称:shindig,代码行数:7,代码来源:OAuth.php

示例10: removeValues

 /**
  * Remove values from the database.
  *
  * @param string $key
  */
 public function removeValues(string $key)
 {
     $key = $this->addNamespaceToKey($key);
     $result = dba_delete($key, $this->getHandle());
     if (!$result) {
         throw new RuntimeException('Remove failed');
     }
 }
开发者ID:blar,项目名称:dba,代码行数:13,代码来源:Dba.php

示例11: set

 function set($key, $val)
 {
     $dbh =& $this->_dbh;
     if ($this->readonly) {
         return;
     }
     if (dba_exists($key, $dbh)) {
         if ($val !== false) {
             if (!dba_replace($key, $val, $dbh)) {
                 return $this->_error("store[replace]({$key})");
             }
         } else {
             if (!dba_delete($key, $dbh)) {
                 return $this->_error("store[delete]({$key})");
             }
         }
     } else {
         if (!dba_insert($key, $val, $dbh)) {
             return $this->_error("store[insert]({$key})");
         }
     }
 }
开发者ID:hugcoday,项目名称:wiki,代码行数:22,代码来源:DbaDatabase.php

示例12: replace

 /**
  * Inserts a new value at key. If the key/value pair
  * already exist, overwrites the value
  *
  * @access public
  * @param   $key    string the key to insert
  * @param   $value  string the value to store
  * @return  object  PEAR_Error on failure
  */
 function replace($key, $value)
 {
     if ($this->isWritable()) {
         if ($this->_hasReplace) {
             return dba_replace($key, $value, $this->_dba);
         } else {
             $r = true;
             if (dba_exists($key, $this->_dba)) {
                 $r = dba_delete($key, $this->_dba);
             }
             return $r && dba_insert($key, $value, $this->_dba);
         }
     } else {
         return $this->raiseError(DBA_ERROR_NOT_WRITEABLE);
     }
 }
开发者ID:Esleelkartea,项目名称:kz-adeada-talleres-electricos-,代码行数:25,代码来源:Builtin.php

示例13: deletePage

 function deletePage($pagename)
 {
     if (dba_exists("" . $pagename, $this->db)) {
         $key = dba_fetch("" . $pagename, $this->db);
         $keyval = unpack($this->type . '1' . $this->type, $key);
         dba_delete("" . $key, $this->db);
         dba_delete("" . $pagename, $this->db);
         return true;
     }
     return false;
 }
开发者ID:ahastudio,项目名称:moniwiki,代码行数:11,代码来源:indexer.DBA.php

示例14: remove

 public function remove($key)
 {
     $db = dba_open($this->filePath, 'wl', 'db4');
     $response = dba_delete($key, $db);
     return $response;
 }
开发者ID:sh9zad,项目名称:BerkeleyDBChecker,代码行数:6,代码来源:BDBConnector.php

示例15: STATS_BuildCurrentWeek_move

function STATS_BuildCurrentWeek_move($key, $newkey)
{
    $path = "/home/artica/postfix/WEEK";
    $dbpath = "{$path}/" . date("YW") . ".db";
    $db_con = dba_open($dbpath, "c", "db4");
    if (!$db_con) {
        echo "DB open {$path} failed\n";
        return false;
    }
    echo "{$key} -> {$newkey}\n";
    $data = dba_fetch($key, $db_con);
    dba_delete($key, $db_con);
    dba_replace($newkey, $data, $db_con);
    @dba_close($db_con);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:15,代码来源:exec.postfix-stats.php


注:本文中的dba_delete函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。