summaryrefslogtreecommitdiff
path: root/ext/spl/examples/dbaarray.inc
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2018-10-01 11:19:36 +0300
committerDmitry Stogov <dmitry@zend.com>2018-10-01 11:19:36 +0300
commit2d87b51ae9dafc4000830bdebd49d7665d0a4f6f (patch)
tree2610a5e2641e17ba8bdbcebc618a73c6dfcb8e13 /ext/spl/examples/dbaarray.inc
parent9d47cb4593972859d7bb8747f1f0b8ae56d7712e (diff)
parent4fc5833b3ebda3078911808d296e62d5baa9bf52 (diff)
downloadphp-git-2d87b51ae9dafc4000830bdebd49d7665d0a4f6f.tar.gz
Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src: (29 commits) Fix the deplister rule to not ignore the .c file (Anatol) Update .gitignore to include the Windows deplister program (win32/build/deplister.c) Bug > Feature Request NEWS and UPGRADING Fixed bug #75479 Fix test Fix some tests and improve coverage for Windows in SPL Use already set variable Fix reflection arguments for sodium_memzero function Deprecate unbinding of $this of non-static methods Generalize compile_typename Fixed bug #76737 Fixed bug #72635 Remove and refactor ext/spl/examples Remove outdated soap examples Remove unused ext/bz2/php_bz2.def Remove redundant ce from reflection property_reference Only store zend_type inside reflection type_reference Fixed bug #76946 Bump versions for 7.1.24-dev ...
Diffstat (limited to 'ext/spl/examples/dbaarray.inc')
-rw-r--r--ext/spl/examples/dbaarray.inc95
1 files changed, 0 insertions, 95 deletions
diff --git a/ext/spl/examples/dbaarray.inc b/ext/spl/examples/dbaarray.inc
deleted file mode 100644
index d6ee56f442..0000000000
--- a/ext/spl/examples/dbaarray.inc
+++ /dev/null
@@ -1,95 +0,0 @@
-<?php
-
-/** @file dbaarray.inc
- * @ingroup Examples
- * @brief class DbaArray
- * @author Marcus Boerger
- * @date 2003 - 2005
- *
- * SPL - Standard PHP Library
- */
-
-if (!class_exists("DbaReader", false)) require_once("dbareader.inc");
-
-/** @ingroup Examples
- * @brief This implements a DBA Array
- * @author Marcus Boerger
- * @version 1.0
- */
-class DbaArray extends DbaReader implements ArrayAccess
-{
-
- /**
- * Open database $file with $handler in read only mode.
- *
- * @param file Database file to open.
- * @param handler Handler to use for database access.
- */
- function __construct($file, $handler)
- {
- $this->db = dba_popen($file, "c", $handler);
- if (!$this->db) {
- throw new exception("Databse could not be opened");
- }
- }
-
- /**
- * Close database.
- */
- function __destruct()
- {
- parent::__destruct();
- }
-
- /**
- * Read an entry.
- *
- * @param $name key to read from
- * @return value associated with $name
- */
- function offsetGet($name)
- {
- $data = dba_fetch($name, $this->db);
- if($data) {
- //return unserialize($data);
- return $data;
- }
- else
- {
- return NULL;
- }
- }
-
- /**
- * Set an entry.
- *
- * @param $name key to write to
- * @param $value value to write
- */
- function offsetSet($name, $value)
- {
- //dba_replace($name, serialize($value), $this->db);
- dba_replace($name, $value, $this->db);
- return $value;
- }
-
- /**
- * @return whether key $name exists.
- */
- function offsetExists($name)
- {
- return dba_exists($name, $this->db);
- }
-
- /**
- * Delete a key/value pair.
- *
- * @param $name key to delete.
- */
- function offsetUnset($name)
- {
- return dba_delete($name, $this->db);
- }
-}
-
-?>