From: <ru...@us...> - 2010-05-08 19:18:42
|
Revision: 7388 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7388&view=rev Author: rurban Date: 2010-05-08 19:18:36 +0000 (Sat, 08 May 2010) Log Message: ----------- fatal typo Modified Paths: -------------- trunk/lib/DbaDatabase.php Modified: trunk/lib/DbaDatabase.php =================================================================== --- trunk/lib/DbaDatabase.php 2010-05-07 13:24:00 UTC (rev 7387) +++ trunk/lib/DbaDatabase.php 2010-05-08 19:18:36 UTC (rev 7388) @@ -92,7 +92,7 @@ define("READONLY", true); $GLOBALS['request']->_dbi->readonly = true; $this->readonly = true; - if (!file_exist($this->_file)) { + if (!file_exists($this->_file)) { $ErrorManager->handleError($error); flush(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2010-06-07 12:16:01
|
Revision: 7480 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7480&view=rev Author: rurban Date: 2010-06-07 12:12:17 +0000 (Mon, 07 Jun 2010) Log Message: ----------- increase windows dba timeout Modified Paths: -------------- trunk/lib/DbaDatabase.php Modified: trunk/lib/DbaDatabase.php =================================================================== --- trunk/lib/DbaDatabase.php 2010-06-07 12:11:30 UTC (rev 7479) +++ trunk/lib/DbaDatabase.php 2010-06-07 12:12:17 UTC (rev 7480) @@ -2,7 +2,10 @@ require_once('lib/ErrorManager.php'); -define('DBA_DATABASE_DEFAULT_TIMEOUT', 5); +if (isWindows()) + define('DBA_DATABASE_DEFAULT_TIMEOUT', 60); +else + define('DBA_DATABASE_DEFAULT_TIMEOUT', 5); class DbaDatabase { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-11-08 16:15:17
|
Revision: 9287 http://sourceforge.net/p/phpwiki/code/9287 Author: vargenau Date: 2014-11-08 16:15:14 +0000 (Sat, 08 Nov 2014) Log Message: ----------- function _error is void Modified Paths: -------------- trunk/lib/DbaDatabase.php Modified: trunk/lib/DbaDatabase.php =================================================================== --- trunk/lib/DbaDatabase.php 2014-11-08 15:54:20 UTC (rev 9286) +++ trunk/lib/DbaDatabase.php 2014-11-08 16:15:14 UTC (rev 9287) @@ -9,7 +9,22 @@ class DbaDatabase { - function DbaDatabase($filename, $mode = false, $handler = 'gdbm') + public $_file; + public $_handler; + public $_timeout; + /** + * @var resource + */ + public $_dbh; + public $readonly; + public $_dba_open_error; + + /** + * @param string $filename + * @param bool $mode + * @param string $handler + */ + function __construct($filename, $mode = false, $handler = 'gdbm') { $this->_file = $filename; $this->_handler = $handler; @@ -34,7 +49,7 @@ function open($mode = 'w') { if ($this->_dbh) - return; // already open. + return true; // already open. $watchdog = $this->_timeout; @@ -122,21 +137,22 @@ function fetch($key) { $val = dba_fetch($key, $this->_dbh); - if ($val === false) - return $this->_error("fetch($key)"); + if ($val === false) { + $this->_error("fetch($key)"); + } return $val; } function insert($key, $val) { if (!dba_insert($key, $val, $this->_dbh)) - return $this->_error("insert($key)"); + $this->_error("insert($key)"); } function replace($key, $val) { if (!dba_replace($key, $val, $this->_dbh)) - return $this->_error("replace($key)"); + $this->_error("replace($key)"); } function firstkey() @@ -151,9 +167,10 @@ function delete($key) { - if ($this->readonly) return; + if ($this->readonly) + return; if (!dba_delete($key, $this->_dbh)) - return $this->_error("delete($key)"); + $this->_error("delete($key)"); } function get($key) @@ -164,38 +181,37 @@ function set($key, $val) { $dbh = &$this->_dbh; - if ($this->readonly) return; + if ($this->readonly) + return; if (dba_exists($key, $dbh)) { if ($val !== false) { if (!dba_replace($key, $val, $dbh)) - return $this->_error("store[replace]($key)"); + $this->_error("store[replace]($key)"); } else { if (!dba_delete($key, $dbh)) - return $this->_error("store[delete]($key)"); + $this->_error("store[delete]($key)"); } } else { if (!dba_insert($key, $val, $dbh)) - return $this->_error("store[insert]($key)"); + $this->_error("store[insert]($key)"); } } function sync() { if (!dba_sync($this->_dbh)) - return $this->_error("sync()"); + $this->_error("sync()"); } function optimize() { if (!dba_optimize($this->_dbh)) - return $this->_error("optimize()"); + $this->_error("optimize()"); return 1; } - function _error($mes) + private function _error($mes) { - //trigger_error("DbaDatabase: $mes", E_USER_WARNING); - //return false; trigger_error("$this->_file: dba error: $mes", E_USER_ERROR); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |