From: <var...@us...> - 2012-10-01 14:59:14
|
Revision: 8359 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8359&view=rev Author: vargenau Date: 2012-10-01 14:59:03 +0000 (Mon, 01 Oct 2012) Log Message: ----------- php_closing_tag [PSR-2] The closing ?> tag MUST be omitted from files containing only PHP. Modified Paths: -------------- trunk/lib/pear/Cache/Container/db.php trunk/lib/pear/Cache/Container/file.php trunk/lib/pear/Cache/Container/trifile.php trunk/lib/pear/DB.php Modified: trunk/lib/pear/Cache/Container/db.php =================================================================== --- trunk/lib/pear/Cache/Container/db.php 2012-10-01 14:37:38 UTC (rev 8358) +++ trunk/lib/pear/Cache/Container/db.php 2012-10-01 14:59:03 UTC (rev 8359) @@ -263,4 +263,3 @@ } } -?> Modified: trunk/lib/pear/Cache/Container/file.php =================================================================== --- trunk/lib/pear/Cache/Container/file.php 2012-10-01 14:37:38 UTC (rev 8358) +++ trunk/lib/pear/Cache/Container/file.php 2012-10-01 14:59:03 UTC (rev 8359) @@ -381,4 +381,3 @@ } // end func deleteDir } // end class file -?> Modified: trunk/lib/pear/Cache/Container/trifile.php =================================================================== --- trunk/lib/pear/Cache/Container/trifile.php 2012-10-01 14:37:38 UTC (rev 8358) +++ trunk/lib/pear/Cache/Container/trifile.php 2012-10-01 14:59:03 UTC (rev 8359) @@ -141,5 +141,3 @@ return true; } } - -?> Modified: trunk/lib/pear/DB.php =================================================================== --- trunk/lib/pear/DB.php 2012-10-01 14:37:38 UTC (rev 8358) +++ trunk/lib/pear/DB.php 2012-10-01 14:59:03 UTC (rev 8359) @@ -1098,5 +1098,3 @@ * c-basic-offset: 4 * End: */ - -?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-10-02 09:00:08
|
Revision: 8367 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8367&view=rev Author: vargenau Date: 2012-10-02 08:59:57 +0000 (Tue, 02 Oct 2012) Log Message: ----------- php_closing_tag [PSR-2] The closing ?> tag MUST be omitted from files containing only PHP. Modified Paths: -------------- trunk/lib/pear/Cache/Container.php trunk/lib/pear/Cache/Error.php trunk/lib/pear/Cache/Graphics.php trunk/lib/pear/Cache.php trunk/lib/pear/File_Passwd.php trunk/lib/pear/JSON.php trunk/lib/pear/PEAR.php Modified: trunk/lib/pear/Cache/Container.php =================================================================== --- trunk/lib/pear/Cache/Container.php 2012-10-02 08:57:57 UTC (rev 8366) +++ trunk/lib/pear/Cache/Container.php 2012-10-02 08:59:57 UTC (rev 8367) @@ -447,4 +447,3 @@ } // end func getExpireAbsolute } // end class Container -?> Modified: trunk/lib/pear/Cache/Error.php =================================================================== --- trunk/lib/pear/Cache/Error.php 2012-10-02 08:57:57 UTC (rev 8366) +++ trunk/lib/pear/Cache/Error.php 2012-10-02 08:59:57 UTC (rev 8367) @@ -45,4 +45,3 @@ } // end func Cache_Error } // end class Cache_Error -?> Modified: trunk/lib/pear/Cache/Graphics.php =================================================================== --- trunk/lib/pear/Cache/Graphics.php 2012-10-02 08:57:57 UTC (rev 8366) +++ trunk/lib/pear/Cache/Graphics.php 2012-10-02 08:59:57 UTC (rev 8367) @@ -345,4 +345,3 @@ } // end func generateID } // end class Cache_Graphics -?> Modified: trunk/lib/pear/Cache.php =================================================================== --- trunk/lib/pear/Cache.php 2012-10-02 08:57:57 UTC (rev 8366) +++ trunk/lib/pear/Cache.php 2012-10-02 08:59:57 UTC (rev 8367) @@ -17,8 +17,8 @@ // +----------------------------------------------------------------------+ // -require_once('PEAR.php'); -require_once('Cache/Error.php'); +require_once 'PEAR.php'; +require_once 'Cache/Error.php'; /** * Cache is a base class for cache implementations. @@ -352,4 +352,3 @@ } // end func garbageCollection } // end class cache -?> Modified: trunk/lib/pear/File_Passwd.php =================================================================== --- trunk/lib/pear/File_Passwd.php 2012-10-02 08:57:57 UTC (rev 8366) +++ trunk/lib/pear/File_Passwd.php 2012-10-02 08:59:57 UTC (rev 8367) @@ -268,4 +268,3 @@ // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: -?> Modified: trunk/lib/pear/JSON.php =================================================================== --- trunk/lib/pear/JSON.php 2012-10-02 08:57:57 UTC (rev 8366) +++ trunk/lib/pear/JSON.php 2012-10-02 08:59:57 UTC (rev 8367) @@ -51,7 +51,7 @@ * @author Matt Knapp <mdknapp[at]gmail[dot]com> * @author Brett Stimmerman <brettstimmerman[at]gmail[dot]com> * @copyright 2005 Michal Migurski - * @version CVS: + * @version * @license http://www.opensource.org/licenses/bsd-license.php * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198 */ @@ -802,5 +802,3 @@ } } - -?> Modified: trunk/lib/pear/PEAR.php =================================================================== --- trunk/lib/pear/PEAR.php 2012-10-02 08:57:57 UTC (rev 8366) +++ trunk/lib/pear/PEAR.php 2012-10-02 08:59:57 UTC (rev 8367) @@ -959,4 +959,3 @@ * c-basic-offset: 4 * End: */ -?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-11-20 11:33:20
|
Revision: 8495 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8495&view=rev Author: vargenau Date: 2012-11-20 11:33:07 +0000 (Tue, 20 Nov 2012) Log Message: ----------- Update to DB-1.7.14 Modified Paths: -------------- trunk/lib/pear/DB/common.php trunk/lib/pear/DB/dbase.php trunk/lib/pear/DB/fbsql.php trunk/lib/pear/DB/ibase.php trunk/lib/pear/DB/ifx.php trunk/lib/pear/DB/msql.php trunk/lib/pear/DB/mssql.php trunk/lib/pear/DB/mysql.php trunk/lib/pear/DB/mysqli.php trunk/lib/pear/DB/oci8.php trunk/lib/pear/DB/odbc.php trunk/lib/pear/DB/pgsql.php trunk/lib/pear/DB/sqlite.php trunk/lib/pear/DB/storage.php trunk/lib/pear/DB/sybase.php trunk/lib/pear/DB.php Modified: trunk/lib/pear/DB/common.php =================================================================== --- trunk/lib/pear/DB/common.php 2012-11-20 09:06:44 UTC (rev 8494) +++ trunk/lib/pear/DB/common.php 2012-11-20 11:33:07 UTC (rev 8495) @@ -1,152 +1,248 @@ <?php -/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */ -// +----------------------------------------------------------------------+ -// | PHP Version 4 | -// +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2004 The PHP Group | -// +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | li...@ph... so we can mail you a copy immediately. | -// +----------------------------------------------------------------------+ -// | Author: Stig Bakken <ss...@ph...> | -// | Tomas V.V.Cox <co...@id...> | -// | Maintainer: Daniel Convissor <da...@ph...> | -// +----------------------------------------------------------------------+ +/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ + +/** + * Contains the DB_common base class + * + * PHP versions 4 and 5 + * + * LICENSE: This source file is subject to version 3.0 of the PHP license + * that is available through the world-wide-web at the following URI: + * http://www.php.net/license/3_0.txt. If you did not receive a copy of + * the PHP License and are unable to obtain it through the web, please + * send a note to li...@ph... so we can mail you a copy immediately. + * + * @category Database + * @package DB + * @author Stig Bakken <ss...@ph...> + * @author Tomas V.V. Cox <co...@id...> + * @author Daniel Convissor <da...@ph...> + * @copyright 1997-2007 The PHP Group + * @license http://www.php.net/license/3_0.txt PHP License 3.0 + * @version CVS: $Id: common.php 315557 2011-08-26 14:32:35Z danielc $ + * @link http://pear.php.net/package/DB + */ + +/** + * Obtain the PEAR class so it can be extended from + */ require_once 'PEAR.php'; /** - * DB_common is a base class for DB implementations, and must be - * inherited by all such + * DB_common is the base class from which each database driver class extends * - * @package DB - * @version - * @category Database - * @author Stig Bakken <ss...@ph...> - * @author Tomas V.V.Cox <co...@id...> + * All common methods are declared here. If a given DBMS driver contains + * a particular method, that method will overload the one here. + * + * @category Database + * @package DB + * @author Stig Bakken <ss...@ph...> + * @author Tomas V.V. Cox <co...@id...> + * @author Daniel Convissor <da...@ph...> + * @copyright 1997-2007 The PHP Group + * @license http://www.php.net/license/3_0.txt PHP License 3.0 + * @version Release: 1.7.14 + * @link http://pear.php.net/package/DB */ class DB_common extends PEAR { // {{{ properties /** - * assoc of capabilities for this DB implementation - * $features['limit'] => 'emulate' => emulate with fetch row by number - * 'alter' => alter the query - * false => skip rows - * @var array + * The current default fetch mode + * @var integer */ - var $features = array(); + var $fetchmode = DB_FETCHMODE_ORDERED; /** - * assoc mapping native error codes to DB ones - * @var array + * The name of the class into which results should be fetched when + * DB_FETCHMODE_OBJECT is in effect + * + * @var string */ - var $errorcode_map = array(); + var $fetchmode_object_class = 'stdClass'; /** - * DB type (mysql, oci8, odbc etc.) - * @var string + * Was a connection present when the object was serialized()? + * @var bool + * @see DB_common::__sleep(), DB_common::__wake() */ - var $phptype; + var $was_connected = null; /** + * The most recently executed query * @var string */ - var $prepare_tokens; + var $last_query = ''; /** - * @var string + * Run-time configuration options + * + * The 'optimize' option has been deprecated. Use the 'portability' + * option instead. + * + * @var array + * @see DB_common::setOption() */ - var $prepare_types; + var $options = array( + 'result_buffering' => 500, + 'persistent' => false, + 'ssl' => false, + 'debug' => 0, + 'seqname_format' => '%s_seq', + 'autofree' => false, + 'portability' => DB_PORTABILITY_NONE, + 'optimize' => 'performance', // Deprecated. Use 'portability'. + ); /** - * @var string + * The parameters from the most recently executed query + * @var array + * @since Property available since Release 1.7.0 */ - var $prepared_queries; + var $last_parameters = array(); /** - * @var integer + * The elements from each prepared statement + * @var array */ - var $prepare_maxstmt = 0; + var $prepare_tokens = array(); /** - * @var string + * The data types of the various elements in each prepared statement + * @var array */ - var $last_query = ''; + var $prepare_types = array(); /** - * @var integer + * The prepared queries + * @var array */ - var $fetchmode = DB_FETCHMODE_ORDERED; + var $prepared_queries = array(); /** - * @var string + * Flag indicating that the last query was a manipulation query. + * @access protected + * @var boolean */ - var $fetchmode_object_class = 'stdClass'; + var $_last_query_manip = false; /** - * Run-time configuration options. + * Flag indicating that the next query <em>must</em> be a manipulation + * query. + * @access protected + * @var boolean + */ + var $_next_query_manip = false; + + + // }}} + // {{{ DB_common + + /** + * This constructor calls <kbd>$this->PEAR('DB_Error')</kbd> * - * The 'optimize' option has been deprecated. Use the 'portability' - * option instead. + * @return void + */ + function DB_common() + { + $this->PEAR('DB_Error'); + } + + // }}} + // {{{ __sleep() + + /** + * Automatically indicates which properties should be saved + * when PHP's serialize() function is called * - * @see DB_common::setOption() - * @var array + * @return array the array of properties names that should be saved */ - var $options = array( - 'persistent' => false, - 'ssl' => false, - 'debug' => 0, - 'seqname_format' => '%s_seq', - 'autofree' => false, - 'portability' => DB_PORTABILITY_NONE, - 'optimize' => 'performance', // Deprecated. Use 'portability'. - ); + function __sleep() + { + if ($this->connection) { + // Don't disconnect(), people use serialize() for many reasons + $this->was_connected = true; + } else { + $this->was_connected = false; + } + if (isset($this->autocommit)) { + return array('autocommit', + 'dbsyntax', + 'dsn', + 'features', + 'fetchmode', + 'fetchmode_object_class', + 'options', + 'was_connected', + ); + } else { + return array('dbsyntax', + 'dsn', + 'features', + 'fetchmode', + 'fetchmode_object_class', + 'options', + 'was_connected', + ); + } + } + // }}} + // {{{ __wakeup() + /** - * DB handle - * @var resource + * Automatically reconnects to the database when PHP's unserialize() + * function is called + * + * The reconnection attempt is only performed if the object was connected + * at the time PHP's serialize() function was run. + * + * @return void */ - var $dbh; + function __wakeup() + { + if ($this->was_connected) { + $this->connect($this->dsn, $this->options['persistent']); + } + } // }}} - // {{{ toString() + // {{{ __toString() /** - * String conversation + * Automatic string conversion for PHP 5 * - * @return string - * @access private + * @return string a string describing the current PEAR DB object + * + * @since Method available since Release 1.7.0 */ - function toString() + function __toString() { $info = strtolower(get_class($this)); $info .= ': (phptype=' . $this->phptype . ', dbsyntax=' . $this->dbsyntax . ')'; - if ($this->connection) { $info .= ' [connected]'; } - return $info; } // }}} - // {{{ constructor + // {{{ toString() /** - * Constructor + * DEPRECATED: String conversion method + * + * @return string a string describing the current PEAR DB object + * + * @deprecated Method deprecated in Release 1.7.0 */ - function DB_common() + function toString() { - $this->PEAR('DB_Error'); + return $this->__toString(); } // }}} @@ -156,11 +252,12 @@ * DEPRECATED: Quotes a string so it can be safely used within string * delimiters in a query * - * @return string quoted string + * @param string $string the string to be quoted * + * @return string the quoted string + * * @see DB_common::quoteSmart(), DB_common::escapeSimple() - * @deprecated Deprecated in release 1.2 or lower - * @internal + * @deprecated Method deprecated some time before Release 1.2 */ function quoteString($string) { @@ -177,25 +274,25 @@ /** * DEPRECATED: Quotes a string so it can be safely used in a query * - * @param string $string the input string to quote + * @param string $string the string to quote * - * @return string The NULL string or the string quotes - * in magic_quote_sybase style + * @return string the quoted string or the string <samp>NULL</samp> + * if the value submitted is <kbd>null</kbd>. * * @see DB_common::quoteSmart(), DB_common::escapeSimple() - * @deprecated Deprecated in release 1.6.0 - * @internal + * @deprecated Deprecated in release 1.6.0 */ function quote($string = null) { - return ($string === null) ? 'NULL' : "'".str_replace("'", "''", $string)."'"; + return ($string === null) ? 'NULL' + : "'" . str_replace("'", "''", $string) . "'"; } // }}} // {{{ quoteIdentifier() /** - * Quote a string so it can be safely used as a table or column name + * Quotes a string so it can be safely used as a table or column name * * Delimiting style depends on which database driver is being used. * @@ -219,17 +316,17 @@ * + odbc(db2) * + pgsql * + sqlite - * + sybase + * + sybase (must execute <kbd>set quoted_identifier on</kbd> sometime + * prior to use) * * InterBase doesn't seem to be able to use delimited identifiers * via PHP 4. They work fine under PHP 5. * - * @param string $str identifier name to be quoted + * @param string $str the identifier name to be quoted * - * @return string quoted identifier string + * @return string the quoted identifier * - * @since 1.6.0 - * @access public + * @since Method available since Release 1.6.0 */ function quoteIdentifier($str) { @@ -240,16 +337,15 @@ // {{{ quoteSmart() /** - * Format input so it can be safely used in a query + * Formats input so it can be safely used in a query * * The output depends on the PHP data type of input and the database * type being used. * - * @param mixed $in data to be quoted + * @param mixed $in the data to be formatted * - * @return mixed the format of the results depends on the input's - * PHP type: - * + * @return mixed the formatted data. The format depends on the input's + * PHP type: * <ul> * <li> * <kbd>input</kbd> -> <samp>returns</samp> @@ -261,7 +357,7 @@ * <kbd>integer</kbd> or <kbd>double</kbd> -> the unquoted number * </li> * <li> - * &type.bool; -> output depends on the driver in use + * <kbd>bool</kbd> -> output depends on the driver in use * Most drivers return integers: <samp>1</samp> if * <kbd>true</kbd> or <samp>0</samp> if * <kbd>false</kbd>. @@ -338,192 +434,116 @@ * </li> * </ul> * - * @since 1.6.0 * @see DB_common::escapeSimple() - * @access public + * @since Method available since Release 1.6.0 */ function quoteSmart($in) { - if (is_int($in) || is_double($in)) { + if (is_int($in)) { return $in; + } elseif (is_float($in)) { + return $this->quoteFloat($in); } elseif (is_bool($in)) { - return $in ? 1 : 0; + return $this->quoteBoolean($in); } elseif (is_null($in)) { return 'NULL'; } else { + if ($this->dbsyntax == 'access' + && preg_match('/^#.+#$/', $in)) + { + return $this->escapeSimple($in); + } return "'" . $this->escapeSimple($in) . "'"; } } // }}} - // {{{ escapeSimple() + // {{{ quoteBoolean() /** - * Escape a string according to the current DBMS's standards + * Formats a boolean value for use within a query in a locale-independent + * manner. * - * In SQLite, this makes things safe for inserts/updates, but may - * cause problems when performing text comparisons against columns - * containing binary data. See the - * {@link http://php.net/sqlite_escape_string PHP manual} for more info. - * - * @param string $str the string to be escaped - * - * @return string the escaped string - * - * @since 1.6.0 + * @param boolean the boolean value to be quoted. + * @return string the quoted string. * @see DB_common::quoteSmart() - * @access public + * @since Method available since release 1.7.8. */ - function escapeSimple($str) { - return str_replace("'", "''", $str); + function quoteBoolean($boolean) { + return $boolean ? '1' : '0'; } - + // }}} - // {{{ provides() + // {{{ quoteFloat() /** - * Tell whether a DB implementation or its backend extension - * supports a given feature + * Formats a float value for use within a query in a locale-independent + * manner. * - * @param array $feature name of the feature (see the DB class doc) - * @return bool whether this DB implementation supports $feature - * @access public + * @param float the float value to be quoted. + * @return string the quoted string. + * @see DB_common::quoteSmart() + * @since Method available since release 1.7.8. */ - function provides($feature) - { - return $this->features[$feature]; + function quoteFloat($float) { + return "'".$this->escapeSimple(str_replace(',', '.', strval(floatval($float))))."'"; } - + // }}} - // {{{ errorCode() + // {{{ escapeSimple() /** - * Map native error codes to DB's portable ones + * Escapes a string according to the current DBMS's standards * - * Requires that the DB implementation's constructor fills - * in the <var>$errorcode_map</var> property. + * In SQLite, this makes things safe for inserts/updates, but may + * cause problems when performing text comparisons against columns + * containing binary data. See the + * {@link http://php.net/sqlite_escape_string PHP manual} for more info. * - * @param mixed $nativecode the native error code, as returned by the - * backend database extension (string or integer) + * @param string $str the string to be escaped * - * @return int a portable DB error code, or DB_ERROR if this DB - * implementation has no mapping for the given error code. + * @return string the escaped string * - * @access public + * @see DB_common::quoteSmart() + * @since Method available since Release 1.6.0 */ - function errorCode($nativecode) + function escapeSimple($str) { - if (isset($this->errorcode_map[$nativecode])) { - return $this->errorcode_map[$nativecode]; - } - // Fall back to DB_ERROR if there was no mapping. - return DB_ERROR; + return str_replace("'", "''", $str); } // }}} - // {{{ errorMessage() + // {{{ provides() /** - * Map a DB error code to a textual message. This is actually - * just a wrapper for DB::errorMessage() + * Tells whether the present driver supports a given feature * - * @param integer $dbcode the DB error code + * @param string $feature the feature you're curious about * - * @return string the corresponding error message, of false - * if the error code was unknown - * - * @access public + * @return bool whether this driver supports $feature */ - function errorMessage($dbcode) + function provides($feature) { - return DB::errorMessage($this->errorcode_map[$dbcode]); + return $this->features[$feature]; } // }}} - // {{{ raiseError() - - /** - * Communicate an error and invoke error callbacks, etc - * - * Basically a wrapper for PEAR::raiseError without the message string. - * - * @param mixed integer error code, or a PEAR error object (all - * other parameters are ignored if this parameter is - * an object - * - * @param int error mode, see PEAR_Error docs - * - * @param mixed If error mode is PEAR_ERROR_TRIGGER, this is the - * error level (E_USER_NOTICE etc). If error mode is - * PEAR_ERROR_CALLBACK, this is the callback function, - * either as a function name, or as an array of an - * object and method name. For other error modes this - * parameter is ignored. - * - * @param string Extra debug information. Defaults to the last - * query and native error code. - * - * @param mixed Native error code, integer or string depending the - * backend. - * - * @return object a PEAR error object - * - * @access public - * @see PEAR_Error - */ - function &raiseError($code = DB_ERROR, $mode = null, $options = null, - $userinfo = null, $nativecode = null) - { - // The error is yet a DB error object - if (is_object($code)) { - // because we the static PEAR::raiseError, our global - // handler should be used if it is set - if ($mode === null && !empty($this->_default_error_mode)) { - $mode = $this->_default_error_mode; - $options = $this->_default_error_options; - } - $tmp = PEAR::raiseError($code, null, $mode, $options, null, null, true); - return $tmp; - } - - if ($userinfo === null) { - $userinfo = $this->last_query; - } - - if ($nativecode) { - $userinfo .= ' [nativecode=' . trim($nativecode) . ']'; - } - - $tmp = PEAR::raiseError(null, $code, $mode, $options, $userinfo, - 'DB_Error', true); - return $tmp; - } - - // }}} // {{{ setFetchMode() /** - * Sets which fetch mode should be used by default on queries - * on this connection + * Sets the fetch mode that should be used by default for query results * - * @param integer $fetchmode DB_FETCHMODE_ORDERED or - * DB_FETCHMODE_ASSOC, possibly bit-wise OR'ed with - * DB_FETCHMODE_FLIPPED. + * @param integer $fetchmode DB_FETCHMODE_ORDERED, DB_FETCHMODE_ASSOC + * or DB_FETCHMODE_OBJECT + * @param string $object_class the class name of the object to be returned + * by the fetch methods when the + * DB_FETCHMODE_OBJECT mode is selected. + * If no class is specified by default a cast + * to object from the assoc array row will be + * done. There is also the posibility to use + * and extend the 'DB_row' class. * - * @param string $object_class The class of the object - * to be returned by the fetch methods when - * the DB_FETCHMODE_OBJECT mode is selected. - * If no class is specified by default a cast - * to object from the assoc array row will be done. - * There is also the posibility to use and extend the - * 'DB_row' class. - * - * @see DB_FETCHMODE_ORDERED - * @see DB_FETCHMODE_ASSOC - * @see DB_FETCHMODE_FLIPPED - * @see DB_FETCHMODE_OBJECT - * @see DB_row::DB_row() - * @access public + * @see DB_FETCHMODE_ORDERED, DB_FETCHMODE_ASSOC, DB_FETCHMODE_OBJECT */ function setFetchMode($fetchmode, $object_class = 'stdClass') { @@ -543,7 +563,7 @@ // {{{ setOption() /** - * Set run-time configuration options for PEAR DB + * Sets run-time configuration options for PEAR DB * * Options, their data types, default values and description: * <ul> @@ -552,6 +572,13 @@ * <br />should results be freed automatically when there are no * more rows? * </li><li> + * <var>result_buffering</var> <kbd>integer</kbd> = <samp>500</samp> + * <br />how many rows of the result set should be buffered? + * <br />In mysql: mysql_unbuffered_query() is used instead of + * mysql_query() if this value is 0. (Release 1.7.0) + * <br />In oci8: this value is passed to ocisetprefetch(). + * (Release 1.7.0) + * </li><li> * <var>debug</var> <kbd>integer</kbd> = <samp>0</samp> * <br />debug level * </li><li> @@ -638,7 +665,6 @@ * that code gets mapped to DB_ERROR_NOSUCHFIELD. * DB_ERROR_MISMATCH -> DB_ERROR_NOSUCHFIELD * - * * <samp>DB_PORTABILITY_NULL_TO_EMPTY</samp> * convert null values to empty strings in data output by get*() and * fetch*(). Needed because Oracle considers empty strings to be null, @@ -651,26 +677,26 @@ * ----------------------------------------- * * Example 1. Simple setOption() example - * <code> <?php - * $dbh->setOption('autofree', true); - * ?></code> + * <code> + * $db->setOption('autofree', true); + * </code> * * Example 2. Portability for lowercasing and trimming - * <code> <?php - * $dbh->setOption('portability', - * DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_RTRIM); - * ?></code> + * <code> + * $db->setOption('portability', + * DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_RTRIM); + * </code> * * Example 3. All portability options except trimming - * <code> <?php - * $dbh->setOption('portability', - * DB_PORTABILITY_ALL ^ DB_PORTABILITY_RTRIM); - * ?></code> + * <code> + * $db->setOption('portability', + * DB_PORTABILITY_ALL ^ DB_PORTABILITY_RTRIM); + * </code> * * @param string $option option name - * @param mixed $value value for the option + * @param mixed $value value for the option * - * @return int DB_OK on success. DB_Error object on failure. + * @return int DB_OK on success. A DB_Error object on failure. * * @see DB_common::$options */ @@ -715,9 +741,9 @@ /** * Returns the value of an option * - * @param string $option option name + * @param string $option the option name you're curious about * - * @return mixed the option value + * @return mixed the option's value */ function getOption($option) { @@ -746,15 +772,15 @@ * data in a db) * * Example 1. - * <code> <?php - * $sth = $dbh->prepare('INSERT INTO tbl (a, b, c) VALUES (?, !, &)'); + * <code> + * $sth = $db->prepare('INSERT INTO tbl (a, b, c) VALUES (?, !, &)'); * $data = array( * "John's text", * "'it''s good'", * 'filename.txt' * ); - * $res = $dbh->execute($sth, $data); - * ?></code> + * $res = $db->execute($sth, $data); + * </code> * * Use backslashes to escape placeholder characters if you don't want * them to be interpreted as placeholders: @@ -766,12 +792,12 @@ * * {@internal ibase and oci8 have their own prepare() methods.}} * - * @param string $query query to be prepared + * @param string $query the query to be prepared * - * @return mixed DB statement resource on success. DB_Error on failure. + * @return mixed DB statement resource on success. A DB_Error object + * on failure. * * @see DB_common::execute() - * @access public */ function prepare($query) { @@ -811,19 +837,27 @@ // {{{ autoPrepare() /** - * Automaticaly generate an insert or update query and pass it to prepare() + * Automaticaly generates an insert or update query and pass it to prepare() * - * @param string $table name of the table - * @param array $table_fields ordered array containing the fields names - * @param int $mode type of query to make (DB_AUTOQUERY_INSERT or DB_AUTOQUERY_UPDATE) - * @param string $where in case of update queries, this string will be put after the sql WHERE statement - * @return resource handle for the query - * @see DB_common::prepare(), DB_common::buildManipSQL() - * @access public + * @param string $table the table name + * @param array $table_fields the array of field names + * @param int $mode a type of query to make: + * DB_AUTOQUERY_INSERT or DB_AUTOQUERY_UPDATE + * @param string $where for update queries: the WHERE clause to + * append to the SQL statement. Don't + * include the "WHERE" keyword. + * + * @return resource the query handle + * + * @uses DB_common::prepare(), DB_common::buildManipSQL() */ - function autoPrepare($table, $table_fields, $mode = DB_AUTOQUERY_INSERT, $where = false) + function autoPrepare($table, $table_fields, $mode = DB_AUTOQUERY_INSERT, + $where = false) { $query = $this->buildManipSQL($table, $table_fields, $mode, $where); + if (DB::isError($query)) { + return $query; + } return $this->prepare($query); } @@ -831,21 +865,33 @@ // {{{ autoExecute() /** - * Automaticaly generate an insert or update query and call prepare() + * Automaticaly generates an insert or update query and call prepare() * and execute() with it * - * @param string $table name of the table - * @param array $fields_values assoc ($key=>$value) where $key is a field name and $value its value - * @param int $mode type of query to make (DB_AUTOQUERY_INSERT or DB_AUTOQUERY_UPDATE) - * @param string $where in case of update queries, this string will be put after the sql WHERE statement - * @return mixed a new DB_Result or a DB_Error when fail - * @see DB_common::autoPrepare(), DB_common::buildManipSQL() - * @access public + * @param string $table the table name + * @param array $fields_values the associative array where $key is a + * field name and $value its value + * @param int $mode a type of query to make: + * DB_AUTOQUERY_INSERT or DB_AUTOQUERY_UPDATE + * @param string $where for update queries: the WHERE clause to + * append to the SQL statement. Don't + * include the "WHERE" keyword. + * + * @return mixed a new DB_result object for successful SELECT queries + * or DB_OK for successul data manipulation queries. + * A DB_Error object on failure. + * + * @uses DB_common::autoPrepare(), DB_common::execute() */ - function autoExecute($table, $fields_values, $mode = DB_AUTOQUERY_INSERT, $where = false) + function autoExecute($table, $fields_values, $mode = DB_AUTOQUERY_INSERT, + $where = false) { - $sth = $this->autoPrepare($table, array_keys($fields_values), $mode, $where); - $ret =& $this->execute($sth, array_values($fields_values)); + $sth = $this->autoPrepare($table, array_keys($fields_values), $mode, + $where); + if (DB::isError($sth)) { + return $sth; + } + $ret = $this->execute($sth, array_values($fields_values)); $this->freePrepared($sth); return $ret; @@ -855,25 +901,39 @@ // {{{ buildManipSQL() /** - * Make automaticaly an sql query for prepare() + * Produces an SQL query string for autoPrepare() * - * Example : buildManipSQL('table_sql', array('field1', 'field2', 'field3'), DB_AUTOQUERY_INSERT) - * will return the string : INSERT INTO table_sql (field1,field2,field3) VALUES (?,?,?) - * NB : - This belongs more to a SQL Builder class, but this is a simple facility - * - Be carefull ! If you don't give a $where param with an UPDATE query, all - * the records of the table will be updated ! + * Example: + * <pre> + * buildManipSQL('table_sql', array('field1', 'field2', 'field3'), + * DB_AUTOQUERY_INSERT); + * </pre> * - * @param string $table name of the table - * @param array $table_fields ordered array containing the fields names - * @param int $mode type of query to make (DB_AUTOQUERY_INSERT or DB_AUTOQUERY_UPDATE) - * @param string $where in case of update queries, this string will be put after the sql WHERE statement - * @return string sql query for prepare() - * @access public + * That returns + * <samp> + * INSERT INTO table_sql (field1,field2,field3) VALUES (?,?,?) + * </samp> + * + * NOTES: + * - This belongs more to a SQL Builder class, but this is a simple + * facility. + * - Be carefull! If you don't give a $where param with an UPDATE + * query, all the records of the table will be updated! + * + * @param string $table the table name + * @param array $table_fields the array of field names + * @param int $mode a type of query to make: + * DB_AUTOQUERY_INSERT or DB_AUTOQUERY_UPDATE + * @param string $where for update queries: the WHERE clause to + * append to the SQL statement. Don't + * include the "WHERE" keyword. + * + * @return string the sql query for autoPrepare() */ function buildManipSQL($table, $table_fields, $mode, $where = false) { if (count($table_fields) == 0) { - $this->raiseError(DB_ERROR_NEED_MORE_DATA); + return $this->raiseError(DB_ERROR_NEED_MORE_DATA); } $first = true; switch ($mode) { @@ -907,7 +967,7 @@ } return $sql; default: - $this->raiseError(DB_ERROR_SYNTAX); + return $this->raiseError(DB_ERROR_SYNTAX); } } @@ -918,31 +978,32 @@ * Executes a DB statement prepared with prepare() * * Example 1. - * <code> <?php - * $sth = $dbh->prepare('INSERT INTO tbl (a, b, c) VALUES (?, !, &)'); + * <code> + * $sth = $db->prepare('INSERT INTO tbl (a, b, c) VALUES (?, !, &)'); * $data = array( * "John's text", * "'it''s good'", * 'filename.txt' * ); - * $res =& $dbh->execute($sth, $data); - * ?></code> + * $res = $db->execute($sth, $data); + * </code> * - * @param resource $stmt a DB statement resource returned from prepare() - * @param mixed $data array, string or numeric data to be used in - * execution of the statement. Quantity of items - * passed must match quantity of placeholders in - * query: meaning 1 placeholder for non-array - * parameters or 1 placeholder per array element. + * @param resource $stmt a DB statement resource returned from prepare() + * @param mixed $data array, string or numeric data to be used in + * execution of the statement. Quantity of items + * passed must match quantity of placeholders in + * query: meaning 1 placeholder for non-array + * parameters or 1 placeholder per array element. * - * @return object a new DB_Result or a DB_Error when fail + * @return mixed a new DB_result object for successful SELECT queries + * or DB_OK for successul data manipulation queries. + * A DB_Error object on failure. * * {@internal ibase and oci8 have their own execute() methods.}} * * @see DB_common::prepare() - * @access public */ - function execute($stmt, $data = array()) + function &execute($stmt, $data = array()) { $realquery = $this->executeEmulateQuery($stmt, $data); if (DB::isError($realquery)) { @@ -950,7 +1011,7 @@ } $result = $this->simpleQuery($realquery); - if (DB::isError($result) || $result === DB_OK) { + if ($result === DB_OK || DB::isError($result)) { return $result; } else { $tmp = new DB_result($this, $result); @@ -962,26 +1023,26 @@ // {{{ executeEmulateQuery() /** - * Emulates the execute statement, when not supported + * Emulates executing prepared statements if the DBMS not support them * - * @param resource $stmt a DB statement resource returned from execute() - * @param mixed $data array, string or numeric data to be used in - * execution of the statement. Quantity of items - * passed must match quantity of placeholders in - * query: meaning 1 placeholder for non-array - * parameters or 1 placeholder per array element. + * @param resource $stmt a DB statement resource returned from execute() + * @param mixed $data array, string or numeric data to be used in + * execution of the statement. Quantity of items + * passed must match quantity of placeholders in + * query: meaning 1 placeholder for non-array + * parameters or 1 placeholder per array element. * - * @return mixed a string containing the real query run when emulating - * prepare/execute. A DB error code is returned on failure. + * @return mixed a string containing the real query run when emulating + * prepare/execute. A DB_Error object on failure. * + * @access protected * @see DB_common::execute() - * @access private */ function executeEmulateQuery($stmt, $data = array()) { - if (!is_array($data)) { - $data = array($data); - } + $stmt = (int)$stmt; + $data = (array)$data; + $this->last_parameters = $data; if (count($this->prepare_types[$stmt]) != count($data)) { $this->last_query = $this->prepared_queries[$stmt]; @@ -1015,8 +1076,7 @@ // {{{ executeMultiple() /** - * This function does several execute() calls on the same - * statement handle + * Performs several execute() calls on the same statement handle * * $data must be an array indexed numerically * from 0, one execute call is done for every "row" in the array. @@ -1024,19 +1084,18 @@ * If an error occurs during execute(), executeMultiple() does not * execute the unfinished rows, but rather returns that error. * - * @param resource $stmt query handle from prepare() - * @param array $data numeric array containing the - * data to insert into the query + * @param resource $stmt query handle from prepare() + * @param array $data numeric array containing the + * data to insert into the query * - * @return mixed DB_OK or DB_Error + * @return int DB_OK on success. A DB_Error object on failure. * * @see DB_common::prepare(), DB_common::execute() - * @access public */ function executeMultiple($stmt, $data) { foreach ($data as $value) { - $res =& $this->execute($stmt, $value); + $res = $this->execute($stmt, $value); if (DB::isError($res)) { return $res; } @@ -1048,14 +1107,20 @@ // {{{ freePrepared() /** - * Free the resource used in a prepared query + * Frees the internal resources associated with a prepared query * - * @param $stmt The resurce returned by the prepare() function + * @param resource $stmt the prepared statement's PHP resource + * @param bool $free_resource should the PHP resource be freed too? + * Use false if you need to get data + * from the result set later. + * + * @return bool TRUE on success, FALSE if $result is invalid + * * @see DB_common::prepare() */ - function freePrepared($stmt) + function freePrepared($stmt, $free_resource = true) { - // Free the internal prepared vars + $stmt = (int)$stmt; if (isset($this->prepare_tokens[$stmt])) { unset($this->prepare_tokens[$stmt]); unset($this->prepare_types[$stmt]); @@ -1069,19 +1134,20 @@ // {{{ modifyQuery() /** - * This method is used by backends to alter queries for various - * reasons + * Changes a query string for various DBMS specific reasons * - * It is defined here to assure that all implementations - * have this method defined. + * It is defined here to ensure all drivers have this method available. * - * @param string $query query to modify + * @param string $query the query string to modify * - * @return the new (modified) query + * @return string the modified query string * - * @access private + * @access protected + * @see DB_mysql::modifyQuery(), DB_oci8::modifyQuery(), + * DB_sqlite::modifyQuery() */ - function modifyQuery($query) { + function modifyQuery($query) + { return $query; } @@ -1089,17 +1155,25 @@ // {{{ modifyLimitQuery() /** - * This method is used by backends to alter limited queries + * Adds LIMIT clauses to a query string according to current DBMS standards * - * @param string $query query to modify - * @param integer $from the row to start to fetching - * @param integer $count the numbers of rows to fetch + * It is defined here to assure that all implementations + * have this method defined. * - * @return the new (modified) query + * @param string $query the query to modify + * @param int $from the row to start to fetching (0 = the first row) + * @param int $count the numbers of rows to fetch + * @param mixed $params array, string or numeric data to be used in + * execution of the statement. Quantity of items + * passed must match quantity of placeholders in + * query: meaning 1 placeholder for non-array + * parameters or 1 placeholder per array element. * - * @access private + * @return string the query string with LIMIT clauses added + * + * @access protected */ - function modifyLimitQuery($query, $from, $count) + function modifyLimitQuery($query, $from, $count, $params = array()) { return $query; } @@ -1108,25 +1182,24 @@ // {{{ query() /** - * Send a query to the database and return any results with a - * DB_result object + * Sends a query to the database server * * The query string can be either a normal statement to be sent directly * to the server OR if <var>$params</var> are passed the query can have * placeholders and it will be passed through prepare() and execute(). * - * @param string $query the SQL query or the statement to prepare - * @param mixed $params array, string or numeric data to be used in - * execution of the statement. Quantity of items - * passed must match quantity of placeholders in - * query: meaning 1 placeholder for non-array - * parameters or 1 placeholder per array element. + * @param string $query the SQL query or the statement to prepare + * @param mixed $params array, string or numeric data to be used in + * execution of the statement. Quantity of items + * passed must match quantity of placeholders in + * query: meaning 1 placeholder for non-array + * parameters or 1 placeholder per array element. * - * @return mixed a DB_result object or DB_OK on success, a DB - * error on failure + * @return mixed a new DB_result object for successful SELECT queries + * or DB_OK for successul data manipulation queries. + * A DB_Error object on failure. * * @see DB_result, DB_common::prepare(), DB_common::execute() - * @access public */ function &query($query, $params = array()) { @@ -1136,14 +1209,15 @@ return $sth; } $ret = $this->execute($sth, $params); - $this->freePrepared($sth); + $this->freePrepared($sth, false); return $ret; } else { + $this->last_parameters = array(); $result = $this->simpleQuery($query); - if (DB::isError($result) || $result === DB_OK) { + if ($result === DB_OK || DB::isError($result)) { return $result; } else { - $tmp =& new DB_result($this, $result); + $tmp = new DB_result($this, $result); return $tmp; } } @@ -1153,25 +1227,29 @@ // {{{ limitQuery() /** - * Generates a limited query + * Generates and executes a LIMIT query * - * @param string $query query - * @param integer $from the row to start to fetching - * @param integer $count the numbers of rows to fetch - * @param array $params required for a statement + * @param string $query the query + * @param intr $from the row to start to fetching (0 = the first row) + * @param int $count the numbers of rows to fetch + * @param mixed $params array, string or numeric data to be used in + * execution of the statement. Quantity of items + * passed must match quantity of placeholders in + * query: meaning 1 placeholder for non-array + * parameters or 1 placeholder per array element. * - * @return mixed a DB_Result object, DB_OK or a DB_Error - * - * @access public + * @return mixed a new DB_result object for successful SELECT queries + * or DB_OK for successul data manipulation queries. + * A DB_Error object on failure. */ function &limitQuery($query, $from, $count, $params = array()) { - $query = $this->modifyLimitQuery($query, $from, $count); + $query = $this->modifyLimitQuery($query, $from, $count, $params); if (DB::isError($query)){ return $query; } - $result =& $this->query($query, $params); - if (is_a($result, 'DB_result')) { + $result = $this->query($query, $params); + if (is_object($result) && is_a($result, 'DB_result')) { $result->setOption('limit_from', $from); $result->setOption('limit_count', $count); } @@ -1182,34 +1260,33 @@ // {{{ getOne() /** - * Fetch the first column of the first row of data returned from - * a query + * Fetches the first column of the first row from a query result * * Takes care of doing the query and freeing the results when finished. * - * @param string $query the SQL query - * @param mixed $params array, string or numeric data to be used in - * execution of the statement. Quantity of items - * passed must match quantity of placeholders in - * query: meaning 1 placeholder for non-array - * parameters or 1 placeholder per array element. + * @param string $query the SQL query + * @param mixed $params array, string or numeric data to be used in + * execution of the statement. Quantity of items + * passed must match quantity of placeholders in + * query: meaning 1 placeholder for non-array + * parameters or 1 placeholder per array element. * - * @return mixed the returned value of the query. DB_Error on failure. - * - * @access public + * @return mixed the returned value of the query. + * A DB_Error object on failure. */ function &getOne($query, $params = array()) { - settype($params, 'array'); + $params = (array)$params; + // modifyLimitQuery() would be nice here, but it causes BC issues if (sizeof($params) > 0) { $sth = $this->prepare($query); if (DB::isError($sth)) { return $sth; } - $res =& $this->execute($sth, $params); + $res = $this->execute($sth, $params); $this->freePrepared($sth); } else { - $res =& $this->query($query); + $res = $this->query($query); } if (DB::isError($res)) { @@ -1230,24 +1307,22 @@ // {{{ getRow() /** - * Fetch the first row of data returned from a query + * Fetches the first row of data returned from a query result * * Takes care of doing the query and freeing the results when finished. * - * @param string $query the SQL query - * @param array $params array to be used in execution of the statement. - * Quantity of array elements must match quantity - * of placeholders in query. This function does - * NOT support scalars. - * @param int $fetchmode the fetch mode to use + * @param string $query the SQL query + * @param mixed $params array, string or numeric data to be used in + * execution of the statement. Quantity of items + * passed must match quantity of placeholders in + * query: meaning 1 placeholder for non-array + * parameters or 1 placeholder per array element. + * @param int $fetchmode the fetch mode to use * - * @return array the first row of results as an array indexed from - * 0, or a DB error code. - * - * @access public + * @return array the first row of results as an array. + * A DB_Error object on failure. */ - function &getRow($query, - $params = array(), + function &getRow($query, $params = array(), $fetchmode = DB_FETCHMODE_DEFAULT) { // compat check, the params and fetchmode parameters used to @@ -1266,16 +1341,16 @@ $params = array(); } } - + // modifyLimitQuery() would be nice here, but it causes BC issues if (sizeof($params) > 0) { $sth = $this->prepare($query); if (DB::isError($sth)) { return $sth; } - $res =& $this->execute($sth, $params); + $res = $this->execute($sth, $params); $this->freePrepared($sth); } else { - $res =& $this->query($query); + $res = $this->query($query); } if (DB::isError($res)) { @@ -1297,27 +1372,25 @@ // {{{ getCol() /** - * Fetch a single column from a result set and return it as an + * Fetches a single column from a query result and returns it as an * indexed array * - * @param string $query the SQL query - * @param mixed $col which column to return (integer [column number, - * starting at 0] or string [column name]) - * @param mixed $params array, string or numeric data to be used in - * execution of the statement. Quantity of items - * passed must match quantity of placeholders in - * query: meaning 1 placeholder for non-array - * parameters or 1 placeholder per array element. + * @param string $query the SQL query + * @param mixed $col which column to return (integer [column number, + * starting at 0] or string [column name]) + * @param mixed $params array, string or numeric data to be used in + * execution of the statement. Quantity of items + * passed must match quantity of placeholders in + * query: meaning 1 placeholder for non-array + * parameters or 1 placeholder per array element. * - * @return array an indexed array with the data from the first - * row at index 0, or a DB error code + * @return array the results as an array. A DB_Error object on failure. * * @see DB_common::query() - * @access public */ function &getCol($query, $col = 0, $params = array()) { - settype($params, 'array'); + $params = (array)$params; if (sizeof($params) > 0) { $sth = $this->prepare($query); @@ -1325,10 +1398,10 @@ return $sth; } - $res =& $this->execute($sth, $params); + $res = $this->execute($sth, $params); $this->freePrepared($sth); } else { - $res =& $this->query($query); + $res = $this->query($query); } if (DB::isError($res)) { @@ -1336,10 +1409,18 @@ } $fetchmode = is_int($col) ? DB_FETCHMODE_ORDERED : DB_FETCHMODE_ASSOC; - $ret = array(); - while (is_array($row = $res->fetchRow($fetchmode))) { - $ret[] = $row[$col]; + if (!is_array($row = $res->fetchRow($fetchmode))) { + $ret = array(); + } else { + if (!array_key_exists($col, $row)) { + $ret = $this->raiseError(DB_ERROR_NOSUCHFIELD); + } else { + $ret = array($row[$col]); + while (is_array($row = $res->fetchRow($fetchmode))) { + $ret[] = $row[$col]; + } + } } $res->free(); @@ -1355,7 +1436,7 @@ // {{{ getAssoc() /** - * Fetch the entire result set of a query and return it as an + * Fetches an entire query result and returns it as an * associative array using the first column as the key * * If the result set contains more than two columns, the value @@ -1416,32 +1497,32 @@ * Keep in mind that database functions in PHP usually return string * values for results regardless of the database's internal type. * - * @param string $query the SQL query - * @param boolean $force_array used only when the query returns + * @param string $query the SQL query + * @param bool $force_array used only when the query returns * exactly two columns. If true, the values * of the returned array will be one-element * arrays instead of scalars. - * @param mixed $params array, string or numeric data to be used in - * execution of the statement. Quantity of items - * passed must match quantity of placeholders in - * query: meaning 1 placeholder for non-array - * parameters or 1 placeholder per array element. - * @param boolean $group if true, the values of the returned array - * is wrapped in another array. If the same - * key value (in the first column) repeats - * itself, the values will be appended to - * this array instead of overwriting the - * existing values. + * @param mixed $params array, string or numeric data to be used in + * execution of the statement. Quantity of + * items passed must match quantity of + * placeholders in query: meaning 1 + * placeholder for non-array parameters or + * 1 placeholder per array element. + * @param int $fetchmode the fetch mode to use + * @param bool $group if true, the values of the returned array + * is wrapped in another array. If the same + * key value (in the first column) repeats + * itself, the values will be appended to + * this array instead of overwriting the + * existing values. * - * @return array associative array with results from the query. - * DB Error on failure. - * - * @access public + * @return array the associative array containing the query results. + * A DB_Error object on failure. */ function &getAssoc($query, $force_array = false, $params = array(), $fetchmode = DB_FETCHMODE_DEFAULT, $group = false) { - settype($params, 'array'); + $params = (array)$params; if (sizeof($params) > 0) { $sth = $this->prepare($query); @@ -1449,10 +1530,10 @@ return $sth; } - $res =& $this->execute($sth, $params); + $res = $this->execute($sth, $params); $this->freePrepared($sth); } else { - $res =& $this->query($query); + $res = $this->query($query); } if (DB::isError($res)) { @@ -1464,7 +1545,7 @@ $cols = $res->numCols(); if ($cols < 2) { - $tmp =& $this->raiseError(DB_ERROR_TRUNCATED); + $tmp = $this->raiseError(DB_ERROR_TRUNCATED); return $tmp; } @@ -1532,21 +1613,24 @@ // {{{ getAll() /** - * Fetch all the rows returned from a query + * Fetches all of the rows from a query result * - * @param string $query the SQL query - * @param array $params array to be used in execution of the statement. - * Quantity of array elements must match quantity - * of placeholders in query. This function does - * NOT support scalars. - * @param int $fetchmode the fetch mode to use + * @param string $query the SQL query + * @param mixed $params array, string or numeric data to be used in + * execution of the statement. Quantity of + * items passed must match quantity of + * placeholders in query: meaning 1 + * placeholder for non-array parameters or + * 1 placeholder per array element. + * @param int $fetchmode the fetch mode to use: + * + DB_FETCHMODE_ORDERED + * + DB_FETCHMODE_ASSOC + * + DB_FETCHMODE_ORDERED | DB_FETCHMODE_FLIPPED + * + DB_FETCHMODE_ASSOC | DB_FETCHMODE_FLIPPED * - * @return array an nested array. DB error on failure. - * - * @access public + * @return array the nested array. A DB_Error object on failure. */ - function &getAll($query, - $params = array(), + function &getAll($query, $params = array(), $fetchmode =... [truncated message content] |
From: <var...@us...> - 2015-03-03 15:33:49
|
Revision: 9588 http://sourceforge.net/p/phpwiki/code/9588 Author: vargenau Date: 2015-03-03 15:33:34 +0000 (Tue, 03 Mar 2015) Log Message: ----------- Update PEAR to release 1.9.5, PEAR DB to release 1.8.2 Modified Paths: -------------- trunk/lib/pear/DB/common.php trunk/lib/pear/DB/dbase.php trunk/lib/pear/DB/fbsql.php trunk/lib/pear/DB/ibase.php trunk/lib/pear/DB/ifx.php trunk/lib/pear/DB/msql.php trunk/lib/pear/DB/mssql.php trunk/lib/pear/DB/mysql.php trunk/lib/pear/DB/mysqli.php trunk/lib/pear/DB/oci8.php trunk/lib/pear/DB/odbc.php trunk/lib/pear/DB/pgsql.php trunk/lib/pear/DB/sqlite.php trunk/lib/pear/DB/storage.php trunk/lib/pear/DB/sybase.php trunk/lib/pear/DB.php trunk/lib/pear/PEAR.php Removed Paths: ------------- trunk/lib/pear/DB/Pager.php trunk/lib/pear/DB/ldap.php Deleted: trunk/lib/pear/DB/Pager.php =================================================================== --- trunk/lib/pear/DB/Pager.php 2015-03-03 15:25:24 UTC (rev 9587) +++ trunk/lib/pear/DB/Pager.php 2015-03-03 15:33:34 UTC (rev 9588) @@ -1,253 +0,0 @@ -<?php -// -// Pear DB Pager - Retrieve and return information of databases -// result sets -// -// Copyright (C) 2001 Tomas Von Veschler Cox <co...@id...> -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -// -// -/// -// Based on DB_Pager 0.7 from the pear.php.net repository. -// The only modifications made have been modification of the include paths. -// -// From Pear CVS: Id: Pager.php,v 1.3 2002/05/12 13:59:40 cox Exp - -require_once 'PEAR.php'; -require_once 'DB.php'; - -/** -* This class handles all the stuff needed for displaying paginated results -* from a database query of Pear DB, in a very easy way. -* Documentation and examples of use, can be found in: -* http://vulcanonet.com/soft/pager/ (could be outdated) -* -* IMPORTANT! -* Since PEAR DB already support native row limit (more fast and avaible in -* all the drivers), there is no more need to use $pager->build() or -* the $pager->fetch*() methods. -* -* Usage example: -* -*< ?php -* require_once 'DB/Pager.php'; -* $db = DB::connect('your DSN string'); -* $from = 0; // The row to start to fetch from (you might want to get this -* // param from the $_GET array -* $limit = 10; // The number of results per page -* $maxpages = 10; // The number of pages for displaying in the pager (optional) -* $res = $db->limitQuery($sql, $from, $limit); -* $nrows = 0; // Alternative you could use $res->numRows() -* while ($row = $res->fetchrow()) { -* // XXX code for building the page here -* $nrows++; -* } -* $data = DB_Pager::getData($from, $limit, $nrows, $maxpages); -* // XXX code for building the pager here -* ? > -* -* @version 0.7 -* @author Tomas V.V.Cox <co...@id...> -* @see http://vulcanonet.com/soft/pager/ -*/ - -class DB_Pager extends PEAR -{ - - /** - * Constructor - * - * @param object $res A DB_result object from Pear_DB - * @param int $from The row to start fetching - * @param int $limit How many results per page - * @param int $numrows Pager will automatically - * find this param if is not given. If your Pear_DB backend extension - * doesn't support numrows(), you can manually calculate it - * and supply later to the constructor - * @deprecated - */ - function DB_Pager (&$res, $from, $limit, $numrows = null) - { - $this->res = $res; - $this->from = $from; - $this->limit = $limit; - $this->numrows = $numrows; - } - - /** - * Calculates all the data needed by Pager to work - * - * @return mixed An assoc array with all the data (see getData) - * or DB_Error on error - * @see DB_Pager::getData - * @deprecated - */ - function build() - { - // if there is no numrows given, calculate it - if ($this->numrows === null) { - $this->numrows = $this->res->numrows(); - if (DB::isError($this->numrows)) { - return $this->numrows; - } - } - $data = $this->getData($this->from, $this->limit, $this->numrows); - if (DB::isError($data)) { - return $data; - } - $this->current = $this->from - 1; - $this->top = $data['to']; - return $data; - } - - /** - * @deprecated - */ - function fetchRow($mode=DB_FETCHMODE_DEFAULT) - { - $this->current++; - if ($this->current >= $this->top) { - return null; - } - return $this->res->fetchRow($mode, $this->current); - } - - /** - * @deprecated - */ - function fetchInto(&$arr, $mode=DB_FETCHMODE_DEFAULT) - { - $this->current++; - if ($this->current >= $this->top) { - return null; - } - return $this->res->fetchInto($arr, $mode, $this->current); - } - - /* - * Gets all the data needed to paginate results - * This is an associative array with the following - * values filled in: - * - * array( - * 'current' => X, // current page you are - * 'numrows' => X, // total number of results - * 'next' => X, // row number where next page starts - * 'prev' => X, // row number where prev page starts - * 'remain' => X, // number of results remaning *in next page* - * 'numpages'=> X, // total number of pages - * 'from' => X, // the row to start fetching - * 'to' => X, // the row to stop fetching - * 'limit' => X, // how many results per page - * 'maxpages' => X, // how many pages to show (google style) - * 'firstpage' => X, // the row number of the first page - * 'lastpage' => X, // the row number where the last page starts - * 'pages' => array( // assoc with page "number => start row" - * 1 => X, - * 2 => X, - * 3 => X - * ) - * ); - * @param int $from The row to start fetching - * @param int $limit How many results per page - * @param int $numrows Number of results from query - * - * @return array associative array with data or DB_error on error - * - */ - function &getData($from, $limit, $numrows, $maxpages = false) - { - if (empty($numrows) || ($numrows < 0)) { - return null; - } - $from = (empty($from)) ? 0 : $from; - - if ($limit <= 0) { - return PEAR::raiseError (null, 'wrong "limit" param', null, - null, null, 'DB_Error', true); - } - - // Total number of pages - $pages = ceil($numrows/$limit); - $data['numpages'] = $pages; - - // first & last page - $data['firstpage'] = 1; - $data['lastpage'] = $pages; - - // Build pages array - $data['pages'] = array(); - for ($i=1; $i <= $pages; $i++) { - $offset = $limit * ($i-1); - $data['pages'][$i] = $offset; - // $from must point to one page - if ($from == $offset) { - // The current page we are - $data['current'] = $i; - } - } - if (!isset($data['current'])) { - return PEAR::raiseError (null, 'wrong "from" param', null, - null, null, 'DB_Error', true); - } - - // Limit number of pages (goole algoritm) - if ($maxpages) { - $radio = floor($maxpages/2); - $minpage = $data['current'] - $radio; - if ($minpage < 1) { - $minpage = 1; - } - $maxpage = $data['current'] + $radio - 1; - if ($maxpage > $data['numpages']) { - $maxpage = $data['numpages']; - } - foreach (range($minpage, $maxpage) as $page) { - $tmp[$page] = $data['pages'][$page]; - } - $data['pages'] = $tmp; - $data['maxpages'] = $maxpages; - } else { - $data['maxpages'] = null; - } - - // Prev link - $prev = $from - $limit; - $data['prev'] = ($prev >= 0) ? $prev : null; - - // Next link - $next = $from + $limit; - $data['next'] = ($next < $numrows) ? $next : null; - - // Results remaining in next page & Last row to fetch - if ($data['current'] == $pages) { - $data['remain'] = 0; - $data['to'] = $numrows; - } else { - if ($data['current'] == ($pages - 1)) { - $data['remain'] = $numrows - ($limit*($pages-1)); - } else { - $data['remain'] = $limit; - } - $data['to'] = $data['current'] * $limit; - } - $data['numrows'] = $numrows; - $data['from'] = $from + 1; - $data['limit'] = $limit; - - return $data; - } -} Modified: trunk/lib/pear/DB/common.php =================================================================== --- trunk/lib/pear/DB/common.php 2015-03-03 15:25:24 UTC (rev 9587) +++ trunk/lib/pear/DB/common.php 2015-03-03 15:33:34 UTC (rev 9588) @@ -5,7 +5,7 @@ /** * Contains the DB_common base class * - * PHP versions 4 and 5 + * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: @@ -20,7 +20,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: common.php 315557 2011-08-26 14:32:35Z danielc $ + * @version CVS: $Id$ * @link http://pear.php.net/package/DB */ @@ -42,7 +42,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.7.14 + * @version Release: 1.8.2 * @link http://pear.php.net/package/DB */ class DB_common extends PEAR @@ -261,7 +261,7 @@ */ function quoteString($string) { - $string = $this->quote($string); + $string = $this->quoteSmart($string); if ($string{0} == "'") { return substr($string, 1, -1); } @@ -284,8 +284,7 @@ */ function quote($string = null) { - return ($string === null) ? 'NULL' - : "'" . str_replace("'", "''", $string) . "'"; + return $this->quoteSmart($string); } // }}} Modified: trunk/lib/pear/DB/dbase.php =================================================================== --- trunk/lib/pear/DB/dbase.php 2015-03-03 15:25:24 UTC (rev 9587) +++ trunk/lib/pear/DB/dbase.php 2015-03-03 15:33:34 UTC (rev 9588) @@ -6,7 +6,7 @@ * The PEAR DB driver for PHP's dbase extension * for interacting with dBase databases * - * PHP versions 4 and 5 + * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: @@ -20,7 +20,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: dbase.php 242771 2007-09-21 13:40:42Z aharvey $ + * @version CVS: $Id$ * @link http://pear.php.net/package/DB */ @@ -41,7 +41,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.7.14 + * @version Release: 1.8.2 * @link http://pear.php.net/package/DB */ class DB_dbase extends DB_common Modified: trunk/lib/pear/DB/fbsql.php =================================================================== --- trunk/lib/pear/DB/fbsql.php 2015-03-03 15:25:24 UTC (rev 9587) +++ trunk/lib/pear/DB/fbsql.php 2015-03-03 15:33:34 UTC (rev 9588) @@ -6,7 +6,7 @@ * The PEAR DB driver for PHP's fbsql extension * for interacting with FrontBase databases * - * PHP versions 4 and 5 + * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: @@ -20,7 +20,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: fbsql.php 239211 2007-07-06 05:19:21Z aharvey $ + * @version CVS: $Id$ * @link http://pear.php.net/package/DB */ @@ -41,7 +41,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.7.14 + * @version Release: 1.8.2 * @link http://pear.php.net/package/DB * @since Class functional since Release 1.7.0 */ Modified: trunk/lib/pear/DB/ibase.php =================================================================== --- trunk/lib/pear/DB/ibase.php 2015-03-03 15:25:24 UTC (rev 9587) +++ trunk/lib/pear/DB/ibase.php 2015-03-03 15:33:34 UTC (rev 9588) @@ -9,7 +9,7 @@ * While this class works with PHP 4, PHP's InterBase extension is * unstable in PHP 4. Use PHP 5. * - * PHP versions 4 and 5 + * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: @@ -23,7 +23,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: ibase.php 277804 2009-03-26 07:16:31Z aharvey $ + * @version CVS: $Id$ * @link http://pear.php.net/package/DB */ @@ -49,7 +49,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.7.14 + * @version Release: 1.8.2 * @link http://pear.php.net/package/DB * @since Class became stable in Release 1.7.0 */ Modified: trunk/lib/pear/DB/ifx.php =================================================================== --- trunk/lib/pear/DB/ifx.php 2015-03-03 15:25:24 UTC (rev 9587) +++ trunk/lib/pear/DB/ifx.php 2015-03-03 15:33:34 UTC (rev 9588) @@ -6,7 +6,7 @@ * The PEAR DB driver for PHP's ifx extension * for interacting with Informix databases * - * PHP versions 4 and 5 + * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: @@ -20,7 +20,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: ifx.php 302738 2010-08-24 03:06:52Z clockwerx $ + * @version CVS: $Id$ * @link http://pear.php.net/package/DB */ @@ -48,7 +48,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.7.14 + * @version Release: 1.8.2 * @link http://pear.php.net/package/DB */ class DB_ifx extends DB_common Deleted: trunk/lib/pear/DB/ldap.php =================================================================== --- trunk/lib/pear/DB/ldap.php 2015-03-03 15:25:24 UTC (rev 9587) +++ trunk/lib/pear/DB/ldap.php 2015-03-03 15:33:34 UTC (rev 9588) @@ -1,912 +0,0 @@ -<?php -// -// Pear DB LDAP - Database independent query interface definition -// for PHP's LDAP extension. -// -// Copyright (C) 2002 Ludovico Magnocavallo <lu...@su...> -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -// -// Contributors -// - Piotr Roszatycki <Pio...@ne...> -// DB_ldap::base() method, support for LDAP sequences, various fixes -// -// Based on DB 1.3 from the pear.php.net repository. -// The only modifications made have been modification of the include paths. -// -// From Pear CVS: Id: ldap.php,v 1.9 2002/02/11 12:59:37 mj Exp - -require_once 'DB/common.php'; -define("DB_ERROR_BIND_FAILED", -26); -define("DB_ERROR_UNKNOWN_LDAP_ACTION", -27); - -/** - * LDAP result class - * - * LDAP_result extends DB_result to provide specific LDAP - * result methods. - * - * @version 1.0 - * @author Ludovico Magnocavallo <lu...@su...> - * @package DB - */ - -class LDAP_result extends DB_result -{ - - // {{{ properties - - /** - * data returned from ldap_entries() - * @access private - */ - var $_entries = null; - /** - * result rows as hash of records - * @access private - */ - var $_recordset = null; - /** - * current record as hash - * @access private - */ - var $_record = null; - - // }}} - // {{{ constructor - - /** - * class constructor, calls DB_result constructor - * @param ref $dbh reference to the db instance - * @param resource $result ldap command result - */ - function LDAP_result(&$dbh, $result) - { - $this->DB_result($dbh, $result); - } - - /** - * fetch rows of data into $this->_recordset - * - * called once as soon as something needs to be returned - * @access private - * @param resource $result ldap command result - * @return boolean true - */ - function getRows() { - if ($this->_recordset === null) { - // begin processing result into recordset - $this->_entries = ldap_get_entries($this->dbh->connection, $this->result); - $this->row_counter = $this->_entries['count']; - $i = 1; - $rs_template = array(); - if (count($this->dbh->attributes) > 0) { - reset($this->dbh->attributes); - while (list($a_index, $a_name) = each($this->dbh->attributes)) $rs_template[$a_name] = ''; - } - while (list($entry_idx, $entry) = each($this->_entries)) { - // begin first loop, iterate through entries - if (!empty($this->dbh->limit_from) && ($i < $this->dbh->limit_from)) continue; - if (!empty($this->dbh->limit_count) && ($i > $this->dbh->limit_count)) break; - $rs = $rs_template; - if (!is_array($entry)) continue; - while (list($attr, $attr_values) = each($entry)) { - // begin second loop, iterate through attributes - if (is_int($attr) || $attr == 'count') continue; - if (is_string($attr_values)) $rs[$attr] = $attr_values; - else { - $value = ''; - while (list($value_idx, $attr_value) = each($attr_values)) { - // begin third loop, iterate through attribute values - if (!is_int($value_idx)) continue; - if (empty($value)) $value = $attr_value; - else { - if (is_array($value)) $value[] = $attr_value; - else $value = array($value, $attr_value); - } -// else $value .= "\n$attr_value"; - // end third loop - } - $rs[$attr] = $value; - } - // end second loop - } - reset($rs); - $this->_recordset[$entry_idx] = $rs; - $i++; - // end first loop - } - $this->_entries = null; - if (!is_array($this->_recordset)) - $this->_recordset = array(); - if (!empty($this->dbh->sorting)) { - $sorting_method = (!empty($this->dbh->sorting_method) ? $this->dbh->sorting_method : 'cmp'); - uksort($this->_recordset, array(&$this, $sorting_method)); - } - reset($this->_recordset); - // end processing result into recordset - } - return DB_OK; - } - - - /** - * Fetch and return a row of data (it uses driver->fetchInto for that) - * @param int $fetchmode format of fetched row - * @param int $rownum the row number to fetch - * - * @return array a row of data, NULL on no more rows or PEAR_Error on error - * - * @access public - */ - function &fetchRow($fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) - { - $this->getRows(); - if (count($this->_recordset) == 0) return null; - if ($this->_record !== null) $this->_record = next($this->_recordset); - else $this->_record = current($this->_recordset); - $row = $this->_record; - return $row; - } - - - /** - * Fetch a row of data into an existing variable. - * - * @param mixed $arr reference to data containing the row - * @param integer $fetchmode format of fetched row - * @param integer $rownum the row number to fetch - * - * @return mixed DB_OK on success, NULL on no more rows or - * a DB_Error object on error - * - * @access public - */ - - function fetchInto(&$ar, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum = null) - { - $this->getRows(); - if ($this->_record !== null) $this->_record = next($this->_recordset); - else $this->_record = current($this->_recordset); - $ar = $this->_record; - if (!$ar) { - return null; - } - return DB_OK; - } - - /** - * return all records - * - * returns a hash of all records, basically returning - * a copy of $this->_recordset - * @param integer $fetchmode format of fetched row - * @param integer $rownum the row number to fetch (not used, here for interface compatibility) - * - * @return mixed DB_OK on success, NULL on no more rows or - * a DB_Error object on error - * - * @access public - */ - function fetchAll($fetchmode = DB_FETCHMODE_DEFAULT, $rownum = null) - { - $this->getRows(); - return($this->_recordset); - } - - /** - * Get the the number of columns in a result set. - * - * @return int the number of columns, or a DB error - * - * @access public - */ - function numCols($result) - { - $this->getRows(); - return(count(array_keys($this->_record))); - } - - function cmp($a, $b) - { - return(strcmp(strtolower($this->_recordset[$a][$this->dbh->sorting]), strtolower($this->_recordset[$b][$this->dbh->sorting]))); - } - - /** - * Get the number of rows in a result set. - * - * @return int the number of rows, or a DB error - * - * @access public - */ - function numRows() - { - $this->getRows(); - return $this->row_counter; - } - - /** - * Get the next result if a batch of queries was executed. - * - * @return bool true if a new result is available or false if not. - * - * @access public - */ - function nextResult() - { - return $this->dbh->nextResult($this->result); - } - - /** - * Frees the resources allocated for this result set. - * @return int error code - * - * @access public - */ - function free() - { - $this->_recordset = null; - $this->_record = null; - ldap_free_result($this->result); - $this->result = null; - return true; - } - - /** - * @deprecated - */ - function tableInfo($mode = null) - { - return $this->dbh->tableInfo($this->result, $mode); - } - - /** - * returns the actual rows number - * @return integer - */ - function getRowCounter() - { - $this->getRows(); - return $this->row_counter; - } -} - -/** - * LDAP DB interface class - * - * LDAP extends DB_common to provide DB compliant - * access to LDAP servers - * - * @version 1.0 - * @author Ludovico Magnocavallo <lu...@su...> - * @package DB - */ - -class DB_ldap extends DB_common -{ - // {{{ properties - - /** - * LDAP connection - * @access private - */ - var $connection; - /** - * base dn - * @access private - */ - var $base = ''; - /** - * query base dn - * @access private - */ - var $q_base = ''; - /** - * array of LDAP actions that only manipulate data - * returning a true/false value - * @access private - */ - var $manip = array('add', 'compare', 'delete', 'modify', 'mod_add', 'mod_del', 'mod_replace', 'rename'); - /** - * store the real LDAP action to perform - * (ie PHP ldap function to call) for a query - * @access private - */ - var $q_action = ''; - /** - * store optional parameters passed - * to the real LDAP action - * @access private - */ - var $q_params = array(); - - // }}} - - /** - * Constructor, calls DB_common constructor - * - * @see DB_common::DB_common() - */ - function DB_ldap() - { - $this->DB_common(); - $this->phptype = 'ldap'; - $this->dbsyntax = 'ldap'; - $this->features = array( - 'prepare' => false, - 'pconnect' => false, - 'transactions' => false, - 'limit' => false - ); - } - - /** - * Connect and bind to LDAP server with either anonymous or authenticated bind depending on dsn info - * - * @param array $dsninfo dsn info as passed by DB::connect() - * @param boolean $persistent kept for interface compatibility - * @return DB_OK if successfully connected. A DB error code is returned on failure. - */ - function connect($dsninfo, $persistent = false) - { - if (!DB::assertExtension('ldap')) - return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND); - - $this->dsn = $dsninfo; - $user = $dsninfo['username']; - $pw = $dsninfo['password']; - $host = $dsninfo['hostspec']; - $this->base = $dsninfo['database']; - - if ($host) { - $conn = ldap_connect($host); - } else { - return $this->raiseError("unknown host $host"); - } - if (!$conn) { - return $this->raiseError(DB_ERROR_CONNECT_FAILED); - } - if ($user && $pw) { - $bind = ldap_bind($conn, "${user}," . $this->base, $pw); - } else { - $bind = ldap_bind($conn); - } - if (!$bind) { - return $this->raiseError(DB_ERROR_BIND_FAILED); - } - $this->connection = $conn; - return DB_OK; - } - - /** - * Unbinds from LDAP server - * - * @return int ldap_unbind() return value - */ - function disconnect() - { - $ret = @ldap_unbind($this->connection); - $this->connection = null; - return $ret; - } - - - /** - * Performs a request against the LDAP server - * - * The type of request (and the corresponding PHP ldap function called) - * depend on two additional parameters, added in respect to the - * DB_common interface. - * - * @param string $filter text of the request to send to the LDAP server - * @param string $action type of request to perform, defaults to search (ldap_search()) - * @param array $params array of additional parameters to pass to the PHP ldap function requested - * @return result from ldap function or DB Error object if no result - */ - function simpleQuery($filter, $action = null, $params = null) - { - if ($action === null) { - $action = (!empty($this->q_action) ? $this->q_action : 'search'); - } - if ($params === null) { - $params = (count($this->q_params) > 0 ? $this->q_params : array()); - } - if (!$this->isManip($action)) { - $base = $this->q_base ? $this->q_base : $this->base; - $attributes = array(); - $attrsonly = 0; - $sizelimit = 0; - $timelimit = 0; - $deref = LDAP_DEREF_NEVER; - $sorting = ''; - $sorting_method = ''; - reset($params); - while (list($k, $v) = each($params)) { - if (isset(${$k})) ${$k} = $v; - } - $this->sorting = $sorting; - $this->sorting_method = $sorting_method; - $this->attributes = $attributes; - if ($action == 'search') - $result = @ldap_search($this->connection, $base, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref); - else if ($action == 'list') - $result = @ldap_list($this->connection, $base, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref); - else if ($action == 'read') - $result = @ldap_read($this->connection, $base, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref); - else - return $this->raiseError(DB_ERROR_UNKNOWN_LDAP_ACTION); - if (!$result) { - return $this->raiseError(); - } - } else { - # If first argument is an array, it contains the entry with DN. - if (is_array($filter)) { - $entry = $filter; - $filter = $entry["dn"]; - } else { - $entry = array(); - } - unset($entry["dn"]); - $attribute = ''; - $value = ''; - $newrdn = ''; - $newparent = ''; - $deleteoldrdn = false; - reset($params); - while (list($k, $v) = each($params)) { - if (isset(${$k})) ${$k} = $v; - } - if ($action == 'add') - $result = @ldap_add($this->connection, $filter, $entry); - else if ($action == 'compare') - $result = @ldap_add($this->connection, $filter, $attribute, $value); - else if ($action == 'delete') - $result = @ldap_delete($this->connection, $filter); - else if ($action == 'modify') - $result = @ldap_modify($this->connection, $filter, $entry); - else if ($action == 'mod_add') - $result = @ldap_mod_add($this->connection, $filter, $entry); - else if ($action == 'mod_del') - $result = @ldap_mod_del($this->connection, $filter, $entry); - else if ($action == 'mod_replace') - $result = @ldap_mod_replace($this->connection, $filter, $entry); - else if ($action == 'rename') - $result = @ldap_rename($this->connection, $filter, $newrdn, $newparent, $deleteoldrdn); - else - return $this->raiseError(DB_ERROR_UNKNOWN_LDAP_ACTION); - if (!$result) { - return $this->raiseError(); - } - } - $this->freeQuery(); - return $result; - } - - /** - * Executes a query performing variables substitution in the query text - * - * @param string $stmt text of the request to send to the LDAP server - * @param array $data query variables values to substitute - * @param string $action type of request to perform, defaults to search (ldap_search()) - * @param array $params array of additional parameters to pass to the PHP ldap function requested - * @return LDAP_result object or DB Error object if no result - * @see DB_common::executeEmulateQuery $this->simpleQuery() - */ - function execute($stmt, $data = false, $action = 'search', $params = array()) - { - $this->q_action = $action; - $this->q_params = $params; - $realquery = $this->executeEmulateQuery($stmt, $data); - if (DB::isError($realquery)) { - return $realquery; - } - $result = $this->simpleQuery($realquery); - if (DB::isError($result) || $result === DB_OK) { - return $result; - } else { - return new LDAP_result($this, $result); - } - } - - /** - * Executes multiple queries performing variables substitution for each query - * - * @param string $stmt text of the request to send to the LDAP server - * @param array $data query variables values to substitute - * @param string $action type of request to perform, defaults to search (ldap_search()) - * @param array $params array of additional parameters to pass to the PHP ldap function requested - * @return LDAP_result object or DB Error object if no result - * @see DB_common::executeMultiple - */ - function executeMultiple($stmt, &$data, $action = 'search', $params = array()) - { - $this->q_action = $action; - $this->q_params = $params; - return(parent::executeMultiple($stmt, $data)); - } - - /** - * Executes a query substituting variables if any are present - * - * @param string $query text of the request to send to the LDAP server - * @param array $data query variables values to substitute - * @param string $action type of request to perform, defaults to search (ldap_search()) - * @param array $params array of additional parameters to pass to the PHP ldap function requested - * @return LDAP_result object or DB Error object if no result - * @see DB_common::prepare() $this->execute()$this->simpleQuery() - */ - function &query($query, $data = array(), $action = 'search', $params = array()) { - $this->q_action = $action; - $this->q_params = $params; - if (sizeof($data) > 0) { - $sth = $this->prepare($query); - if (DB::isError($sth)) { - return $sth; - } - return $this->execute($sth, $data); - } else { - $result = $this->simpleQuery($query); - if (DB::isError($result) || $result === DB_OK) { - return $result; - } else { - return new LDAP_result($this, $result); - } - } - } - - /** - * Modifies a query to return only a set of rows, stores $from and $count for LDAP_result - * - * @param string $query text of the request to send to the LDAP server - * @param int $from record position from which to start returning data - * @param int $count number of records to return - * @return modified query text (no modifications are made, see above) - */ - function modifyLimitQuery($query, $from, $count) - { - $this->limit_from = $from; - $this->limit_count = $count; - return $query; - } - - /** - * Executes a query returning only a specified number of rows - * - * This method only saves the $from and $count parameters for LDAP_result - * where the actual records processing takes place - * - * @param string $query text of the request to send to the LDAP server - * @param int $from record position from which to start returning data - * @param int $count number of records to return - * @param string $action type of request to perform, defaults to search (ldap_search()) - * @param array $params array of additional parameters to pass to the PHP ldap function requested - * @return LDAP_result object or DB Error object if no result - */ - function limitQuery($query, $from, $count, $action = 'search', $params = array()) - { - $query = $this->modifyLimitQuery($query, $from, $count); - $this->q_action = $action; - $this->q_params = $params; - return $this->query($query, $action, $params); - } - - /** - * Fetch the first column of the first row of data returned from - * a query. Takes care of doing the query and freeing the results - * when finished. - * - * @param $query the SQL query - * @param $data if supplied, prepare/execute will be used - * with this array as execute parameters - * @param string $action type of request to perform, defaults to search (ldap_search()) - * @param array $params array of additional parameters to pass to the PHP ldap function requested - * @return array - * @see DB_common::getOne() - * @access public - */ - function &getOne($query, $data = array(), $action = 'search', $params = array()) - { - $this->q_action = $action; - $this->q_params = $params; - return(parent::getOne($query, $data)); - } - - /** - * Fetch the first row of data returned from a query. Takes care - * of doing the query and freeing the results when finished. - * - * @param $query the SQL query - * @param $fetchmode the fetch mode to use - * @param $data array if supplied, prepare/execute will be used - * with this array as execute parameters - * @param string $action type of request to perform, defaults to search (ldap_search()) - * @param array $params array of additional parameters to pass to the PHP ldap function requested - * @access public - * @return array the first row of results as an array indexed from - * 0, or a DB error code. - * @see DB_common::getRow() - * @access public - */ - function &getRow($query, - $data = null, - $fetchmode = DB_FETCHMODE_DEFAULT, - $action = 'search', $params = array()) - { - $this->q_action = $action; - $this->q_params = $params; - return(parent::getRow($query, $data, $fetchmode)); - } - - /** - * Fetch the first column of data returned from a query. Takes care - * of doing the query and freeing the results when finished. - * - * @param $query the SQL query - * @param $col which column to return (integer [column number, - * starting at 0] or string [column name]) - * @param $data array if supplied, prepare/execute will be used - * with this array as execute parameters - * @param string $action type of request to perform, defaults to search (ldap_search()) - * @param array $params array of additional parameters to pass to the PHP ldap function requested - * @access public - * @return array an indexed array with the data from the first - * row at index 0, or a DB error code. - * @see DB_common::getCol() - * @access public - */ - function &getCol($query, $col = 0, $data = array(), $action = 'search', $params = array()) - { - $this->q_action = $action; - $this->q_params = $params; - return(parent::getCol($query, $col, $data)); - } - - /** - * Calls DB_common::getAssoc() - * - * @param $query the SQL query - * @param $force_array (optional) used only when the query returns - * exactly two columns. If true, the values of the returned array - * will be one-element arrays instead of scalars. - * starting at 0] or string [column name]) - * @param array $data if supplied, prepare/execute will be used - * with this array as execute parameters - * @param $fetchmode the fetch mode to use - * @param boolean $group see DB_Common::getAssoc() - * @param string $action type of request to perform, defaults to search (ldap_search()) - * @param array $params array of additional parameters to pass to the PHP ldap function requested - * @access public - * @return array an indexed array with the data from the first - * row at index 0, or a DB error code. - * @see DB_common::getAssoc() - * @access public - */ - function &getAssoc($query, $force_array = false, $data = array(), - $fetchmode = DB_FETCHMODE_ORDERED, $group = false, - $action = 'search', $params = array()) - { - $this->q_action = $action; - $this->q_params = $params; - return(parent::getAssoc($query, $force_array, $data, $fetchmode, $group)); - } - - /** - * Fetch all the rows returned from a query. - * - * @param $query the SQL query - * @param array $data if supplied, prepare/execute will be used - * with this array as execute parameters - * @param $fetchmode the fetch mode to use - * @param string $action type of request to perform, defaults to search (ldap_search()) - * @param array $params array of additional parameters to pass to the PHP ldap function requested - * @access public - * @return array an nested array, or a DB error - * @see DB_common::getAll() - */ - function &getAll($query, - $data = null, - $fetchmode = DB_FETCHMODE_DEFAULT, - $action = 'search', $params = array()) - { - $this->q_action = $action; - $this->q_params = $params; - return(parent::getAll($query, $data, $fetchmode)); - } - - function numRows($result) - { - return $result->numRows(); - } - - function getTables() - { - return $this->raiseError(DB_ERROR_NOT_CAPABLE); - } - - function getListOf($type) - { - return $this->raiseError(DB_ERROR_NOT_CAPABLE); - } - - function isManip($action) - { - return(in_array($action, $this->manip)); - } - - function freeResult() - { - return true; - } - - function freeQuery($query = '') - { - $this->q_action = ''; - $this->q_base = ''; - $this->q_params = array(); - $this->attributes = null; - $this->sorting = ''; - return true; - } - - function base($base = null) - { - $this->q_base = ($base !== null) ? $base : null; - return true; - } - - /** - * Get the next value in a sequence. - * - * LDAP provides transactions for only one entry and we need to - * prevent race condition. If unique value before and after modify - * aren't equal then wait and try again. - * - * The name of sequence is LDAP DN of entry. - * - * @access public - * @param string $seq_name the DN of the sequence - * @param bool $ondemand whether to create the sequence on demand - * @return a sequence integer, or a DB error - */ - function nextId($seq_name, $ondemand = true) - { - $repeat = 0; - do { - // Get the sequence entry - $this->base($seq_name); - $this->pushErrorHandling(PEAR_ERROR_RETURN); - $data = $this->getRow("objectClass=*"); - $this->popErrorHandling(); - - if (DB::isError($data)) { - // DB_ldap doesn't use DB_ERROR_NOT_FOUND - if ($ondemand && $repeat == 0 - && $data->getCode() == DB_ERROR) { - // Try to create sequence and repeat - $repeat = 1; - $data = $this->createSequence($seq_name); - if (DB::isError($data)) { - return $this->raiseError($data); - } - } else { - // Other error - return $this->raiseError($data); - } - } else { - // Increment sequence value - $data["cn"]++; - // Unique identificator of transaction - $seq_unique = mt_rand(); - $data["uid"] = $seq_unique; - // Modify the LDAP entry - $this->pushErrorHandling(PEAR_ERROR_RETURN); - $data = $this->simpleQuery($data, 'modify'); - $this->popErrorHandling(); - if (DB::isError($data)) { - return $this->raiseError($data); - } - // Get the entry and check if it contains our unique value - $this->base($seq_name); - $data = $this->getRow("objectClass=*"); - if (DB::isError($data)) { - return $this->raiseError($data); - } - if ($data["uid"] != $seq_unique) { - // It is not our entry. Wait a little time and repeat - sleep(1); - $repeat = 1; - } else { - $repeat = 0; - } - } - } while ($repeat); - - if (DB::isError($data)) { - return $data; - } - return $data["cn"]; - } - - /** - * Create the sequence - * - * The sequence entry is based on core schema with extensibleObject, - * so it should work with any LDAP server which doesn't check schema - * or supports extensibleObject object class. - * - * Sequence name have to be DN started with "sn=$seq_id,", i.e.: - * - * $seq_name = "sn=uidNumber,ou=sequences,dc=php,dc=net"; - * - * dn: $seq_name - * objectClass: top - * objectClass: extensibleObject - * sn: $seq_id - * cn: $seq_value - * uid: $seq_uniq - * - * @param string $seq_name the DN of the sequence - * @return mixed DB_OK on success or DB error on error - * @access public - */ - function createSequence($seq_name) - { - // Extract $seq_id from DN - ereg("^([^,]*),", $seq_name, $regs); - $seq_id = $regs[1]; - - // Create the sequence entry - $data = array( - dn => $seq_name, - objectclass => array("top", "extensibleObject"), - sn => $seq_id, - cn => 0, - uid => 0 - ); - - // Add the LDAP entry - $this->pushErrorHandling(PEAR_ERROR_RETURN); - $data = $this->simpleQuery($data, 'add'); - $this->popErrorHandling(); - return $data; - } - - /** - * Drop a sequence - * - * @param string $seq_name the DN of the sequence - * @return mixed DB_OK on success or DB error on error - * @access public - */ - function dropSequence($seq_name) - { - // Delete the sequence entry - $data = array( - dn => $seq_name, - ); - $this->pushErrorHandling(PEAR_ERROR_RETURN); - $data = $this->simpleQuery($data, 'delete'); - $this->popErrorHandling(); - return $data; - } - -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ Modified: trunk/lib/pear/DB/msql.php =================================================================== --- trunk/lib/pear/DB/msql.php 2015-03-03 15:25:24 UTC (rev 9587) +++ trunk/lib/pear/DB/msql.php 2015-03-03 15:33:34 UTC (rev 9588) @@ -10,7 +10,7 @@ * 4.3.11 and 5.0.4. Make sure your version of PHP meets or exceeds * those versions. * - * PHP versions 4 and 5 + * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: @@ -23,7 +23,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: msql.php 242771 2007-09-21 13:40:42Z aharvey $ + * @version CVS: $Id$ * @link http://pear.php.net/package/DB */ @@ -47,7 +47,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.7.14 + * @version Release: 1.8.2 * @link http://pear.php.net/package/DB * @since Class not functional until Release 1.7.0 */ Modified: trunk/lib/pear/DB/mssql.php =================================================================== --- trunk/lib/pear/DB/mssql.php 2015-03-03 15:25:24 UTC (rev 9587) +++ trunk/lib/pear/DB/mssql.php 2015-03-03 15:33:34 UTC (rev 9588) @@ -6,7 +6,7 @@ * The PEAR DB driver for PHP's mssql extension * for interacting with Microsoft SQL Server databases * - * PHP versions 4 and 5 + * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: @@ -20,7 +20,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: mssql.php 306603 2010-12-24 06:05:07Z aharvey $ + * @version CVS: $Id$ * @link http://pear.php.net/package/DB */ @@ -49,7 +49,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.7.14 + * @version Release: 1.8.2 * @link http://pear.php.net/package/DB */ class DB_mssql extends DB_common Modified: trunk/lib/pear/DB/mysql.php =================================================================== --- trunk/lib/pear/DB/mysql.php 2015-03-03 15:25:24 UTC (rev 9587) +++ trunk/lib/pear/DB/mysql.php 2015-03-03 15:33:34 UTC (rev 9588) @@ -6,7 +6,7 @@ * The PEAR DB driver for PHP's mysql extension * for interacting with MySQL databases * - * PHP versions 4 and 5 + * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: @@ -20,7 +20,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: mysql.php 242769 2007-09-21 13:32:52Z aharvey $ + * @version CVS: $Id$ * @link http://pear.php.net/package/DB */ @@ -41,7 +41,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.7.14 + * @version Release: 1.8.2 * @link http://pear.php.net/package/DB */ class DB_mysql extends DB_common @@ -773,17 +773,6 @@ } // }}} - // {{{ quote() - - /** - * @deprecated Deprecated in release 1.6.0 - */ - function quote($str) - { - return $this->quoteSmart($str); - } - - // }}} // {{{ escapeSimple() /** Modified: trunk/lib/pear/DB/mysqli.php =================================================================== --- trunk/lib/pear/DB/mysqli.php 2015-03-03 15:25:24 UTC (rev 9587) +++ trunk/lib/pear/DB/mysqli.php 2015-03-03 15:33:34 UTC (rev 9588) @@ -6,7 +6,7 @@ * The PEAR DB driver for PHP's mysqli extension * for interacting with MySQL databases * - * PHP versions 4 and 5 + * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: @@ -19,7 +19,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: mysqli.php 315557 2011-08-26 14:32:35Z danielc $ + * @version CVS: $Id$ * @link http://pear.php.net/package/DB */ @@ -43,7 +43,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.7.14 + * @version Release: 1.8.2 * @link http://pear.php.net/package/DB * @since Class functional since Release 1.6.3 */ Modified: trunk/lib/pear/DB/oci8.php =================================================================== --- trunk/lib/pear/DB/oci8.php 2015-03-03 15:25:24 UTC (rev 9587) +++ trunk/lib/pear/DB/oci8.php 2015-03-03 15:33:34 UTC (rev 9588) @@ -6,7 +6,7 @@ * The PEAR DB driver for PHP's oci8 extension * for interacting with Oracle databases * - * PHP versions 4 and 5 + * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: @@ -20,7 +20,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: oci8.php 293241 2010-01-08 05:00:28Z danielc $ + * @version CVS: $Id$ * @link http://pear.php.net/package/DB */ @@ -47,7 +47,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.7.14 + * @version Release: 1.8.2 * @link http://pear.php.net/package/DB */ class DB_oci8 extends DB_common Modified: trunk/lib/pear/DB/odbc.php =================================================================== --- trunk/lib/pear/DB/odbc.php 2015-03-03 15:25:24 UTC (rev 9587) +++ trunk/lib/pear/DB/odbc.php 2015-03-03 15:33:34 UTC (rev 9588) @@ -6,7 +6,7 @@ * The PEAR DB driver for PHP's odbc extension * for interacting with databases via ODBC connections * - * PHP versions 4 and 5 + * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: @@ -20,7 +20,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: odbc.php 239211 2007-07-06 05:19:21Z aharvey $ + * @version CVS: $Id$ * @link http://pear.php.net/package/DB */ @@ -44,7 +44,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.7.14 + * @version Release: 1.8.2 * @link http://pear.php.net/package/DB */ class DB_odbc extends DB_common @@ -481,18 +481,6 @@ } // }}} - // {{{ quote() - - /** - * @deprecated Deprecated in release 1.6.0 - * @internal - */ - function quote($str) - { - return $this->quoteSmart($str); - } - - // }}} // {{{ nextId() /** Modified: trunk/lib/pear/DB/pgsql.php =================================================================== --- trunk/lib/pear/DB/pgsql.php 2015-03-03 15:25:24 UTC (rev 9587) +++ trunk/lib/pear/DB/pgsql.php 2015-03-03 15:33:34 UTC (rev 9588) @@ -6,7 +6,7 @@ * The PEAR DB driver for PHP's pgsql extension * for interacting with PostgreSQL databases * - * PHP versions 4 and 5 + * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: @@ -21,7 +21,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: pgsql.php 306604 2010-12-24 06:09:35Z aharvey $ + * @version CVS: $Id$ * @link http://pear.php.net/package/DB */ @@ -43,7 +43,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.7.14 + * @version Release: 1.8.2 * @link http://pear.php.net/package/DB */ class DB_pgsql extends DB_common @@ -466,18 +466,6 @@ } // }}} - // {{{ quote() - - /** - * @deprecated Deprecated in release 1.6.0 - * @internal - */ - function quote($str) - { - return $this->quoteSmart($str); - } - - // }}} // {{{ quoteBoolean() /** Modified: trunk/lib/pear/DB/sqlite.php =================================================================== --- trunk/lib/pear/DB/sqlite.php 2015-03-03 15:25:24 UTC (rev 9587) +++ trunk/lib/pear/DB/sqlite.php 2015-03-03 15:33:34 UTC (rev 9588) @@ -6,7 +6,7 @@ * The PEAR DB driver for PHP's sqlite extension * for interacting with SQLite databases * - * PHP versions 4 and 5 + * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: @@ -21,7 +21,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 3.0 - * @version CVS: $Id: sqlite.php 306605 2010-12-24 06:22:59Z aharvey $ + * @version CVS: $Id$ * @link http://pear.php.net/package/DB */ @@ -47,7 +47,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 3.0 - * @version Release: 1.7.14 + * @version Release: 1.8.2 * @link http://pear.php.net/package/DB */ class DB_sqlite extends DB_common Modified: trunk/lib/pear/DB/storage.php =================================================================== --- trunk/lib/pear/DB/storage.php 2015-03-03 15:25:24 UTC (rev 9587) +++ trunk/lib/pear/DB/storage.php 2015-03-03 15:33:34 UTC (rev 9588) @@ -5,7 +5,7 @@ /** * Provides an object interface to a table row * - * PHP versions 4 and 5 + * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: @@ -18,7 +18,7 @@ * @author Stig Bakken <st...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: storage.php 241120 2007-08-12 05:27:25Z aharvey $ + * @version CVS: $Id$ * @link http://pear.php.net/package/DB */ @@ -38,7 +38,7 @@ * @author Stig Bakken <st...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.7.14 + * @version Release: 1.8.2 * @link http://pear.php.net/package/DB */ class DB_storage extends PEAR Modified: trunk/lib/pear/DB/sybase.php =================================================================== --- trunk/lib/pear/DB/sybase.php 2015-03-03 15:25:24 UTC (rev 9587) +++ trunk/lib/pear/DB/sybase.php 2015-03-03 15:33:34 UTC (rev 9588) @@ -6,7 +6,7 @@ * The PEAR DB driver for PHP's sybase extension * for interacting with Sybase databases * - * PHP versions 4 and 5 + * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is availabl... [truncated message content] |
From: <var...@us...> - 2019-07-20 16:37:26
|
Revision: 10129 http://sourceforge.net/p/phpwiki/code/10129 Author: vargenau Date: 2019-07-20 16:37:25 +0000 (Sat, 20 Jul 2019) Log Message: ----------- Use __construct Modified Paths: -------------- trunk/lib/pear/Cache/Cache.php trunk/lib/pear/Cache/Container/db.php trunk/lib/pear/Cache/Container/dbx.php trunk/lib/pear/Cache/Container/file.php trunk/lib/pear/Cache/Container/imgfile.php trunk/lib/pear/Cache/Container/mdb.php trunk/lib/pear/Cache/Container/msession.php trunk/lib/pear/Cache/Container/phplib.php trunk/lib/pear/Cache/Container/shm.php trunk/lib/pear/Cache/Error.php trunk/lib/pear/Cache.php Modified: trunk/lib/pear/Cache/Cache.php =================================================================== --- trunk/lib/pear/Cache/Cache.php 2019-07-20 16:34:29 UTC (rev 10128) +++ trunk/lib/pear/Cache/Cache.php 2019-07-20 16:37:25 UTC (rev 10129) @@ -126,9 +126,9 @@ * @param string Name of container class * @param array Array with container class options */ - function Cache($container, $container_options = '') + function __construct($container, $container_options = '') { - $this->PEAR(); + parent::__construct(); $container = strtolower($container); $container_class = 'Cache_Container_' . $container; $container_classfile = 'Cache/Container/' . $container . '.php'; Modified: trunk/lib/pear/Cache/Container/db.php =================================================================== --- trunk/lib/pear/Cache/Container/db.php 2019-07-20 16:34:29 UTC (rev 10128) +++ trunk/lib/pear/Cache/Container/db.php 2019-07-20 16:37:25 UTC (rev 10129) @@ -79,7 +79,7 @@ */ var $db; - function Cache_Container_db($options) + function __construct($options) { if (!is_array($options) || !isset($options['dsn'])) { return new Cache_Error('No dsn specified!', __FILE__, __LINE__); Modified: trunk/lib/pear/Cache/Container/dbx.php =================================================================== --- trunk/lib/pear/Cache/Container/dbx.php 2019-07-20 16:34:29 UTC (rev 10128) +++ trunk/lib/pear/Cache/Container/dbx.php 2019-07-20 16:37:25 UTC (rev 10129) @@ -109,7 +109,7 @@ var $persistent = true; - function Cache_Container_dbx($options) + function __construct($options) { if (!is_array($options) ) { return new Cache_Error('No options specified!', __FILE__, __LINE__); Modified: trunk/lib/pear/Cache/Container/file.php =================================================================== --- trunk/lib/pear/Cache/Container/file.php 2019-07-20 16:34:29 UTC (rev 10128) +++ trunk/lib/pear/Cache/Container/file.php 2019-07-20 16:37:25 UTC (rev 10129) @@ -100,7 +100,7 @@ * * @param array Config options: ["cache_dir" => ..., "filename_prefix" => ...] */ - function Cache_Container_file($options = '') + function __construct($options = '') { if (is_array($options)) { $this->setOptions($options, array_merge($this->allowed_options, array('cache_dir', 'filename_prefix', 'max_userdata_linelength'))); Modified: trunk/lib/pear/Cache/Container/imgfile.php =================================================================== --- trunk/lib/pear/Cache/Container/imgfile.php 2019-07-20 16:34:29 UTC (rev 10128) +++ trunk/lib/pear/Cache/Container/imgfile.php 2019-07-20 16:37:25 UTC (rev 10129) @@ -71,7 +71,7 @@ * * @param array Config options: ["cache_dir" => ..., "filename_prefix" => ...] */ - function Cache_Container_file($options = '') { + function __construct($options = '') { if (is_array($options)) $this->setOptions($options, array_merge($this->allowed_options, array('cache_dir', 'filename_prefix'))); Modified: trunk/lib/pear/Cache/Container/mdb.php =================================================================== --- trunk/lib/pear/Cache/Container/mdb.php 2019-07-20 16:34:29 UTC (rev 10128) +++ trunk/lib/pear/Cache/Container/mdb.php 2019-07-20 16:37:25 UTC (rev 10129) @@ -86,7 +86,7 @@ * * @param mixed Array with connection info or dsn string */ - function Cache_Container_mdb($options) + function __construct($options) { $this->db = &MDB::Connect($options); if (MDB::isError($this->db)) { @@ -377,4 +377,4 @@ } } -?> \ No newline at end of file +?> Modified: trunk/lib/pear/Cache/Container/msession.php =================================================================== --- trunk/lib/pear/Cache/Container/msession.php 2019-07-20 16:34:29 UTC (rev 10128) +++ trunk/lib/pear/Cache/Container/msession.php 2019-07-20 16:37:25 UTC (rev 10129) @@ -81,7 +81,7 @@ var $ms = null; - function Cache_Container_msession($options = '') + function __construct($options = '') { if (is_array($options)) { $this->setOptions($options, array_merge($this->allowed_options, array('id_length', 'uniq', 'host', 'port', 'connect'))); @@ -245,4 +245,4 @@ } // end func garbageCollection } // end class file -?> \ No newline at end of file +?> Modified: trunk/lib/pear/Cache/Container/phplib.php =================================================================== --- trunk/lib/pear/Cache/Container/phplib.php 2019-07-20 16:34:29 UTC (rev 10128) +++ trunk/lib/pear/Cache/Container/phplib.php 2019-07-20 16:37:25 UTC (rev 10129) @@ -116,7 +116,7 @@ * see $local_path for some hints.s * @see $local_path */ - function Cache_Container_phplib($options = '') + function __construct($options = '') { if (is_array($options)) { $this->setOptions($options, array_merge($this->allowed_options, array('db_class', 'db_file', 'db_path', 'local_file', 'local_path'))); @@ -261,4 +261,4 @@ } } // end func garbageCollection } -?> \ No newline at end of file +?> Modified: trunk/lib/pear/Cache/Container/shm.php =================================================================== --- trunk/lib/pear/Cache/Container/shm.php 2019-07-20 16:34:29 UTC (rev 10128) +++ trunk/lib/pear/Cache/Container/shm.php 2019-07-20 16:37:25 UTC (rev 10129) @@ -106,7 +106,7 @@ * * @param array shm_key, sem_key, shm_size, sem_perm, shm_perm */ - function Cache_Container_shm($options = '') + function __construct($options = '') { if (is_array($options)) { $this->setOptions($options, array_merge($this->allowed_options, Modified: trunk/lib/pear/Cache/Error.php =================================================================== --- trunk/lib/pear/Cache/Error.php 2019-07-20 16:34:29 UTC (rev 10128) +++ trunk/lib/pear/Cache/Error.php 2019-07-20 16:37:25 UTC (rev 10129) @@ -42,11 +42,11 @@ * @param string file where the error occured * @param string linenumber where the error occured */ - function Cache_Error($msg, $file = __FILE__, $line = __LINE__) { + function __construct($msg, $file = __FILE__, $line = __LINE__) { - $this->PEAR_Error(sprintf("%s [%s on line %d].", $msg, $file, $line)); + parent::__construct(sprintf("%s [%s on line %d].", $msg, $file, $line)); } // end func Cache_Error } // end class Cache_Error -?> \ No newline at end of file +?> Modified: trunk/lib/pear/Cache.php =================================================================== --- trunk/lib/pear/Cache.php 2019-07-20 16:34:29 UTC (rev 10128) +++ trunk/lib/pear/Cache.php 2019-07-20 16:37:25 UTC (rev 10129) @@ -124,9 +124,9 @@ * @param string Name of container class * @param array Array with container class options */ - function Cache($container, $container_options = '') + function __construct($container, $container_options = '') { - $this->PEAR(); + parent::__construct(); $container = strtolower($container); $container_class = 'Cache_Container_' . $container; $container_classfile = 'Cache/Container/' . $container . '.php'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-06-28 07:37:39
|
Revision: 10327 http://sourceforge.net/p/phpwiki/code/10327 Author: vargenau Date: 2021-06-28 07:37:34 +0000 (Mon, 28 Jun 2021) Log Message: ----------- PEAR: use __construct for File_Passwd and Services_JSON Modified Paths: -------------- trunk/lib/pear/File_Passwd.php trunk/lib/pear/JSON.php Modified: trunk/lib/pear/File_Passwd.php =================================================================== --- trunk/lib/pear/File_Passwd.php 2021-06-24 19:27:56 UTC (rev 10326) +++ trunk/lib/pear/File_Passwd.php 2021-06-28 07:37:34 UTC (rev 10327) @@ -80,7 +80,7 @@ * @see close() */ - function File_Passwd($file, $lock = 0, $lockfile = "") { + function __construct($file, $lock = 0, $lockfile = "") { $this->filename = $file; if( !empty( $lockfile) ) { $this->lockfile = $lockfile; Modified: trunk/lib/pear/JSON.php =================================================================== --- trunk/lib/pear/JSON.php 2021-06-24 19:27:56 UTC (rev 10326) +++ trunk/lib/pear/JSON.php 2021-06-28 07:37:34 UTC (rev 10327) @@ -139,7 +139,7 @@ * strings or numbers, if you return an object, make sure it does * not have a toJSON method, otherwise an error will occur. */ - function Services_JSON($use = 0) + function __construct($use = 0) { $this->use = $use; $this->_mb_strlen = function_exists('mb_strlen'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2025-02-09 18:59:41
|
Revision: 11086 http://sourceforge.net/p/phpwiki/code/11086 Author: vargenau Date: 2025-02-09 18:59:38 +0000 (Sun, 09 Feb 2025) Log Message: ----------- Revert r11085 Modified Paths: -------------- trunk/lib/pear/Cache/Application.php trunk/lib/pear/Cache/Cache.php trunk/lib/pear/Cache/Container/db.php trunk/lib/pear/Cache/Container/dbx.php trunk/lib/pear/Cache/Container/file.php trunk/lib/pear/Cache/Container/imgfile.php trunk/lib/pear/Cache/Container/mdb.php trunk/lib/pear/Cache/Container/msession.php trunk/lib/pear/Cache/Container/phplib.php trunk/lib/pear/Cache/Container/shm.php trunk/lib/pear/Cache/Container/trifile.php trunk/lib/pear/Cache/Container.php trunk/lib/pear/Cache/Error.php trunk/lib/pear/Cache/Function.php trunk/lib/pear/Cache/Graphics.php trunk/lib/pear/Cache/HTTP_Request.php trunk/lib/pear/Cache/Output.php trunk/lib/pear/Cache/OutputCompression.php trunk/lib/pear/Cache.php trunk/lib/pear/DB/common.php trunk/lib/pear/DB/dbase.php trunk/lib/pear/DB/fbsql.php trunk/lib/pear/DB/ibase.php trunk/lib/pear/DB/ifx.php trunk/lib/pear/DB/msql.php trunk/lib/pear/DB/mssql.php trunk/lib/pear/DB/mysql.php trunk/lib/pear/DB/mysqli.php trunk/lib/pear/DB/oci8.php trunk/lib/pear/DB/odbc.php trunk/lib/pear/DB/pgsql.php trunk/lib/pear/DB/sqlite.php trunk/lib/pear/DB/sqlite3.php trunk/lib/pear/DB/storage.php trunk/lib/pear/DB/sybase.php trunk/lib/pear/DB.php trunk/lib/pear/JSON.php trunk/lib/pear/PEAR.php Modified: trunk/lib/pear/Cache/Application.php =================================================================== --- trunk/lib/pear/Cache/Application.php 2025-02-09 18:37:38 UTC (rev 11085) +++ trunk/lib/pear/Cache/Application.php 2025-02-09 18:59:38 UTC (rev 11086) @@ -15,6 +15,8 @@ // +----------------------------------------------------------------------+ // | Authors: Richard Heyes <ri...@ph...> | // +----------------------------------------------------------------------+ +// +// $Id: Application.php 178289 2005-01-26 09:47:28Z dufuz $ require_once 'lib/pear/Cache.php'; @@ -21,7 +23,7 @@ // Application level variables // // Purpose -// Variables that are persistent across all user sessions, +// Variables that are persisent across all user sessions, // not just a specific user ala normal sessions. // // Usage: @@ -76,8 +78,8 @@ var $registered_vars; /** - * @param string $container Name of container class - * @param array $container_options Array with container class options + * @param string Name of container class + * @param array Array with container class options */ function __construct($container = 'file', $container_options = array('cache_dir' => '/tmp/', 'filename_prefix' => 'cache_'), $id = 'application_var', $group = 'application_cache') { @@ -122,8 +124,8 @@ * * Registers a variable to be stored. * - * @param string $varname Name of variable to register - * @param mixed $data Optional data to store + * @param string Name of variable to register + * @param mixed Optional data to store */ function register($varname, $data = null) { @@ -139,7 +141,7 @@ * * Unregisters a variable from being stored. * - * @param string $varname Name of variable to unregister + * @param string Name of variable to unregister */ function unregister($varname) { Modified: trunk/lib/pear/Cache/Cache.php =================================================================== --- trunk/lib/pear/Cache/Cache.php 2025-02-09 18:37:38 UTC (rev 11085) +++ trunk/lib/pear/Cache/Cache.php 2025-02-09 18:59:38 UTC (rev 11086) @@ -15,6 +15,8 @@ // | Authors: Ulf Wendel <ulf...@ph...> | // | Sebastian Bergmann <sb...@se...> | // +----------------------------------------------------------------------+ +// +// $Id: Cache.php 267047 2008-10-07 08:58:46Z dufuz $ require_once 'lib/pear/PEAR.php'; require_once 'lib/pear/Cache/Error.php'; @@ -26,7 +28,7 @@ * cache script runs. The idea behind the cache is quite simple. If you have * the same input parameters for whatever tasks/algorithm you use you'll * usually get the same output. So why not caching templates, functions calls, -* graphic generation etc. Caching certain actions e.g. XSLT transformations +* graphic generation etc. Caching certain actions e.g. XSLT tranformations * saves you lots of time. * * The design of the cache reminds of PHPLibs session implementation. A @@ -57,6 +59,7 @@ * bad circumstances (especially with the file container) * * @author Ulf Wendel <ulf...@ph...> +* @version $Id: Cache.php 267047 2008-10-07 08:58:46Z dufuz $ * @package Cache * @access public */ @@ -120,8 +123,8 @@ /** * - * @param string $container Name of container class - * @param array $container_options Array with container class options + * @param string Name of container class + * @param array Array with container class options */ function __construct($container, $container_options = '') { @@ -154,7 +157,7 @@ /** * Enables or disables caching. * - * @param boolean $state The new caching state. + * @param boolean The new caching state. * @access public */ function setCaching($state) @@ -165,8 +168,8 @@ /** * Returns the requested dataset it if exists and is not expired * - * @param string $id dataset ID - * @param string $group cache group + * @param string dataset ID + * @param string cache group * @return mixed cached data or null on failure * @access public */ @@ -185,10 +188,10 @@ /** * Stores the given data in the cache. * - * @param string $id dataset ID used as cache identifier - * @param mixed $data data to cache - * @param integer $expires lifetime of the cached data in seconds - 0 for endless - * @param string $group cache group + * @param string dataset ID used as cache identifier + * @param mixed data to cache + * @param integer lifetime of the cached data in seconds - 0 for endless + * @param string cache group * @return boolean * @access public */ @@ -203,11 +206,11 @@ /** * Stores a dataset with additional userdefined data. * - * @param string $id dataset ID - * @param mixed $cachedata data to store - * @param string $userdata additional userdefined data - * @param mixed $expires userdefined expire date - * @param string $group cache group + * @param string dataset ID + * @param mixed data to store + * @param string additional userdefined data + * @param mixed userdefined expire date + * @param string cache group * @return boolean * @throws Cache_Error * @access public @@ -224,8 +227,8 @@ /** * Loads the given ID from the cache. * - * @param string $id dataset ID - * @param string $group cache group + * @param string dataset ID + * @param string cache group * @return mixed cached data or null on failure * @access public */ @@ -240,8 +243,8 @@ /** * Returns the userdata field of a cached data set. * - * @param string $id dataset ID - * @param string $group cache group + * @param string dataset ID + * @param string cache group * @return string userdata * @access public * @see extSave() @@ -257,8 +260,8 @@ /** * Removes the specified dataset from the cache. * - * @param string $id dataset ID - * @param string $group cache group + * @param string dataset ID + * @param string cache group * @return boolean * @access public */ @@ -273,7 +276,7 @@ /** * Flushes the cache - removes all data from it * - * @param string $group cache group, if empty all groups will be flashed + * @param string cache group, if empty all groups will be flashed * @return integer number of removed datasets */ function flush($group = 'default') @@ -289,8 +292,8 @@ * * Note: this does not say that the cached data is not expired! * - * @param string $id dataset ID - * @param string $group cache group + * @param string dataset ID + * @param string cache group * @return boolean * @access public */ @@ -305,9 +308,9 @@ /** * Checks if a dataset is expired * - * @param string $id dataset ID - * @param string $group cache group - * @param integer $max_age maximum age for the cached data in seconds - 0 for endless + * @param string dataset ID + * @param string cache group + * @param integer maximum age for the cached data in seconds - 0 for endless * If the cached data is older but the given lifetime it will * be removed from the cache. You don't have to provide this * argument if you call isExpired(). Every dataset knows @@ -330,7 +333,7 @@ * This is a quick but dirty hack to get a "unique" ID for a any kind of variable. * ID clashes might occur from time to time although they are extreme unlikely! * - * @param mixed $variable variable to generate a ID for + * @param mixed variable to generate a ID for * @return string "unique" ID * @access public */ @@ -343,7 +346,7 @@ /** * Calls the garbage collector of the storage object with a certain probability * - * @param boolean $force Force a garbage collection run? + * @param boolean Force a garbage collection run? * @see $gc_probability, $gc_time */ function garbageCollection($force = false) Modified: trunk/lib/pear/Cache/Container/db.php =================================================================== --- trunk/lib/pear/Cache/Container/db.php 2025-02-09 18:37:38 UTC (rev 11085) +++ trunk/lib/pear/Cache/Container/db.php 2025-02-09 18:59:38 UTC (rev 11086) @@ -16,6 +16,8 @@ // | Sebastian Bergmann <sb...@se...> | // | Chuck Hagenbuch <ch...@ho...> | // +----------------------------------------------------------------------+ +// +// $Id: db.php 178288 2005-01-26 09:42:30Z dufuz $ require_once 'lib/pear/DB.php'; require_once 'lib/pear/Cache/Container.php'; @@ -27,7 +29,7 @@ * the tables shown. As far as I know there's no large binary * type in SQL-92 or SQL-99. Postgres seems to lack any * BLOB or TEXT type, for MS-SQL you could use IMAGE, don't know -* about other databases. Please add suggestions for other databases to +* about other databases. Please add sugestions for other databases to * the inline docs. * * The field 'changed' has no meaning for the Cache itself. It's just there @@ -50,6 +52,7 @@ * ) * * @author Sebastian Bergmann <sb...@se...> +* @version $Id: db.php 178288 2005-01-26 09:42:30Z dufuz $ * @package Cache */ class Cache_Container_db extends Cache_Container Modified: trunk/lib/pear/Cache/Container/dbx.php =================================================================== --- trunk/lib/pear/Cache/Container/dbx.php 2025-02-09 18:37:38 UTC (rev 11085) +++ trunk/lib/pear/Cache/Container/dbx.php 2025-02-09 18:59:38 UTC (rev 11086) @@ -14,7 +14,10 @@ // +----------------------------------------------------------------------+ // | Authors: Christian Stocker <ch...@ph...> | // +----------------------------------------------------------------------+ +// +// $Id: dbx.php 268860 2008-11-12 14:56:26Z clockwerx $ + require_once 'lib/pear/Cache/Container.php'; /** @@ -24,7 +27,7 @@ * the tables shown. As far as I know there's no large binary * type in SQL-92 or SQL-99. Postgres seems to lack any * BLOB or TEXT type, for MS-SQL you could use IMAGE, don't know -* about other databases. Please add suggestions for other databases to +* about other databases. Please add sugestions for other databases to * the inline docs. * * The field 'changed' has no meaning for the Cache itself. It's just there @@ -47,6 +50,7 @@ * ) * * @author Christian Stocker <ch...@ph...> +* @version $Id: dbx.php 268860 2008-11-12 14:56:26Z clockwerx $ * @package Cache */ class Cache_Container_dbx extends Cache_Container Modified: trunk/lib/pear/Cache/Container/file.php =================================================================== --- trunk/lib/pear/Cache/Container/file.php 2025-02-09 18:37:38 UTC (rev 11085) +++ trunk/lib/pear/Cache/Container/file.php 2025-02-09 18:59:38 UTC (rev 11086) @@ -15,6 +15,8 @@ // | Authors: Ulf Wendel <ulf...@ph...> | // | Sebastian Bergmann <sb...@se...> | // +----------------------------------------------------------------------+ +// +// $Id: file.php 293864 2010-01-23 03:49:21Z clockwerx $ require_once 'lib/pear/Cache/Container.php'; @@ -22,6 +24,7 @@ * Stores cache contents in a file. * * @author Ulf Wendel <ulf...@ph...> +* @version $Id: file.php 293864 2010-01-23 03:49:21Z clockwerx $ */ class Cache_Container_file extends Cache_Container { @@ -49,14 +52,14 @@ * Filename prefix for cache files. * * You can use the filename prefix to implement a "domain" based cache or just - * to give the files a more descriptive name. The word "domain" is borrowed from - * a user authentication system. One user id (cached dataset with the ID x) - * may exist in different domains (different filename prefix). You might want + * to give the files a more descriptive name. The word "domain" is borroed from + * a user authentification system. One user id (cached dataset with the ID x) + * may exists in different domains (different filename prefix). You might want * to use this to have different cache values for a production, development and * quality assurance system. If you want the production cache not to be influenced * by the quality assurance activities, use different filename prefixes for them. * - * I personally don't think that you'll never need this, but 640kb happened to be + * I personally don't think that you'll never need this, but 640kb happend to be * not enough, so... you know what I mean. If you find a useful application of the * feature please update this inline doc. * @@ -93,9 +96,9 @@ var $max_userdata_linelength = 257; /** - * Creates the cache directory if necessary + * Creates the cache directory if neccessary * - * @param array $options Config options: ["cache_dir" => ..., "filename_prefix" => ...] + * @param array Config options: ["cache_dir" => ..., "filename_prefix" => ...] */ function __construct($options = '') { @@ -119,7 +122,7 @@ $this->entries = array(); $this->group_dirs = array(); - } // end func constructor + } // end func contructor function fetch($id, $group) { @@ -131,7 +134,7 @@ if (!file_exists($file)) { return array(null, null, null); } - // retrieve the content + // retrive the content if (!($fh = @fopen($file, 'rb'))) { return new Cache_Error("Can't access cache file '$file'. Check access rights and path.", __FILE__, __LINE__); } @@ -252,11 +255,11 @@ * Garbage collection for files is a rather "expensive", "long time" * operation. All files in the cache directory have to be examined which * means that they must be opened for reading, the expiration date has to be - * read from them and if necessary they have to be unlinked (removed). + * read from them and if neccessary they have to be unlinked (removed). * If you have a user comment for a good default gc probability please add it to * to the inline docs. * - * @param integer $maxlifetime Maximum lifetime in seconds of an no longer used/touched entry + * @param integer Maximum lifetime in seconds of an no longer used/touched entry * @throws Cache_Error */ function garbageCollection($maxlifetime) @@ -292,8 +295,8 @@ /** * Does the recursive gc procedure, protected. * - * @param integer $maxlifetime Maximum lifetime in seconds of an no longer used/touched entry - * @param string $dir directory to examine - don't sets this parameter, it's used for a + * @param integer Maximum lifetime in seconds of an no longer used/touched entry + * @param string directory to examine - don't sets this parameter, it's used for a * recursive function call! * @throws Cache_Error */ @@ -342,8 +345,8 @@ /** * Returns the filename for the specified id. * - * @param string $id dataset ID - * @param string $group cache group + * @param string dataset ID + * @param string cache group * @return string full filename with the path * @access public */ @@ -370,7 +373,7 @@ /** * Deletes a directory and all files in it. * - * @param string $dir directory + * @param string directory * @return integer number of removed files * @throws Cache_Error */ Modified: trunk/lib/pear/Cache/Container/imgfile.php =================================================================== --- trunk/lib/pear/Cache/Container/imgfile.php 2025-02-09 18:37:38 UTC (rev 11085) +++ trunk/lib/pear/Cache/Container/imgfile.php 2025-02-09 18:59:38 UTC (rev 11086) @@ -22,6 +22,7 @@ * Stores cache contents in a file. * * @author Ulf Wendel <ulf...@ph...> +* @version */ class Cache_Container_file extends Cache_Container { @@ -68,7 +69,7 @@ /** * Creates the cache directory if neccessary * - * @param array $options Config options: ["cache_dir" => ..., "filename_prefix" => ...] + * @param array Config options: ["cache_dir" => ..., "filename_prefix" => ...] */ function __construct($options = '') { if (is_array($options)) @@ -218,7 +219,7 @@ * If you have a user comment for a good default gc probability please add it to * to the inline docs. * - * @param integer $maxlifetime Maximum lifetime in seconds of an no longer used/touched entry + * @param integer Maximum lifetime in seconds of an no longer used/touched entry * @throws Cache_Error */ function garbageCollection($maxlifetime) { @@ -252,8 +253,8 @@ /** * Does the recursive gc procedure, protected. * - * @param integer $maxlifetime Maximum lifetime in seconds of an no longer used/touched entry - * @param string $dir directory to examine - don't sets this parameter, it's used for a + * @param integer Maximum lifetime in seconds of an no longer used/touched entry + * @param string directory to examine - don't sets this parameter, it's used for a * recursive function call! * @throws Cache_Error */ @@ -314,8 +315,8 @@ /** * Returns the filename for the specified id. * - * @param string $id dataset ID - * @param string $group cache group + * @param string dataset ID + * @param string cache group * @return string full filename with the path * @access public */ @@ -338,7 +339,7 @@ /** * Deletes a directory and all files in it. * - * @param string $dir directory + * @param string directory * @return integer number of removed files * @throws Cache_Error */ Modified: trunk/lib/pear/Cache/Container/mdb.php =================================================================== --- trunk/lib/pear/Cache/Container/mdb.php 2025-02-09 18:37:38 UTC (rev 11085) +++ trunk/lib/pear/Cache/Container/mdb.php 2025-02-09 18:59:38 UTC (rev 11086) @@ -17,6 +17,8 @@ // +----------------------------------------------------------------------+ // | Author: Lorenzo Alberton <l.alberton at quipo.it> | // +----------------------------------------------------------------------+ +// +// $Id: mdb.php 174777 2004-12-15 09:09:33Z dufuz $ require_once 'lib/pear/MDB.php'; require_once 'lib/pear/Cache/Container.php'; @@ -59,6 +61,7 @@ * ------------------------------------------ * * @author Lorenzo Alberton <l.alberton at quipo.it> +* @version $Id: mdb.php 174777 2004-12-15 09:09:33Z dufuz $ * @package Cache */ class Cache_Container_mdb extends Cache_Container @@ -81,7 +84,7 @@ /** * Constructor * - * @param mixed $options Array with connection info or dsn string + * @param mixed Array with connection info or dsn string */ function __construct($options) { @@ -99,8 +102,8 @@ /** * Fetch in the db the data that matches input parameters * - * @param string $id dataset ID - * @param string $group cache group + * @param string dataset ID + * @param string cache group * @return mixed dataset value or null/Cache_Error on failure * @access public */ @@ -179,11 +182,11 @@ * If dataset_ID already exists, overwrite it with new data, * else insert data in a new record. * - * @param string $id dataset ID - * @param mixed $data data to be cached - * @param integer $expires expiration time - * @param string $group cache group - * @param string $userdata userdata + * @param string dataset ID + * @param mixed data to be cached + * @param integer expiration time + * @param string cache group + * @param string userdata * @access public */ function save($id, $data, $expires, $group, $userdata) @@ -253,8 +256,8 @@ /** * Removes a dataset from the database * - * @param string $id dataset ID - * @param string $group cache group + * @param string dataset ID + * @param string cache group */ function remove($id, $group) { @@ -275,7 +278,7 @@ * Remove all cached data for a certain group, or empty * the cache table if no group is specified. * - * @param string $group cache group + * @param string cache group */ function flush($group = '') { @@ -298,8 +301,8 @@ /** * Check if a dataset ID/group exists. * - * @param string $id dataset ID - * @param string $group cache group + * @param string dataset ID + * @param string cache group * @return boolean */ function idExists($id, $group) @@ -324,7 +327,7 @@ /** * Garbage collector. * - * @param int $maxlifetime maxlifetime + * @param int maxlifetime */ function garbageCollection($maxlifetime) { Modified: trunk/lib/pear/Cache/Container/msession.php =================================================================== --- trunk/lib/pear/Cache/Container/msession.php 2025-02-09 18:37:38 UTC (rev 11085) +++ trunk/lib/pear/Cache/Container/msession.php 2025-02-09 18:59:38 UTC (rev 11086) @@ -14,6 +14,8 @@ // +----------------------------------------------------------------------+ // | Authors: Ulf Wendel <ulf...@ph...> | // +----------------------------------------------------------------------+ +// +// $Id: msession.php 178289 2005-01-26 09:47:28Z dufuz $ require_once 'lib/pear/Cache/Container.php'; @@ -23,6 +25,7 @@ * WARNING: experimental, untested * * @author Ulf Wendel <ulf...@ph...> +* @version $Id: msession.php 178289 2005-01-26 09:47:28Z dufuz $ */ class Cache_Container_msession extends Cache_Container { @@ -196,7 +199,7 @@ * * Note: garbage collection should cause lot's of network traffic. * - * @param integer $maxlifetime Maximum lifetime in seconds of an no longer used/touched entry + * @param integer Maximum lifetime in seconds of an no longer used/touched entry * @throws Cache_Error */ function garbageCollection($maxlifetime) Modified: trunk/lib/pear/Cache/Container/phplib.php =================================================================== --- trunk/lib/pear/Cache/Container/phplib.php 2025-02-09 18:37:38 UTC (rev 11085) +++ trunk/lib/pear/Cache/Container/phplib.php 2025-02-09 18:59:38 UTC (rev 11086) @@ -15,6 +15,8 @@ // | Authors: Ulf Wendel <ulf...@ph...> | // | Sebastian Bergmann <sb...@se...> | // +----------------------------------------------------------------------+ +// +// $Id: phplib.php 174777 2004-12-15 09:09:33Z dufuz $ require_once 'lib/pear/Cache/Container.php'; @@ -25,7 +27,7 @@ * the tables shown. As far as I know there's no large binary * type in SQL-92 or SQL-99. Postgres seems to lack any * BLOB or TEXT type, for MS-SQL you could use IMAGE, don't know -* about other databases. Please add suggestions for other databases to +* about other databases. Please add sugestions for other databases to * the inline docs. * * The field 'changed' is used by the garbage collection. Depending on @@ -48,6 +50,7 @@ * * * @author Ulf Wendel <ulf...@ph...>, Sebastian Bergmann <sb...@se...> +* @version $Id: phplib.php 174777 2004-12-15 09:09:33Z dufuz $ * @package Cache * @see save() */ @@ -101,7 +104,7 @@ /** * Creates an instance of a phplib db class to use it for storage. * - * @param mixed $options If empty the object tries to used the + * @param mixed If empty the object tries to used the * preconfigured class variables. If given it * must be an array with: * db_class => name of the DB class to use Modified: trunk/lib/pear/Cache/Container/shm.php =================================================================== --- trunk/lib/pear/Cache/Container/shm.php 2025-02-09 18:37:38 UTC (rev 11085) +++ trunk/lib/pear/Cache/Container/shm.php 2025-02-09 18:59:38 UTC (rev 11086) @@ -15,6 +15,8 @@ // | Authors: Ulf Wendel <ulf...@ph...> | // | Sebastian Bergmann <sb...@se...> | // +----------------------------------------------------------------------+ +// +// $Id: shm.php 186977 2005-05-25 10:00:41Z dufuz $ require_once 'lib/pear/Cache/Container.php'; @@ -27,6 +29,7 @@ * caching algorithm using PHP. * * @author Ulf Wendel <ulf...@ph...> +* @version $Id: shm.php 186977 2005-05-25 10:00:41Z dufuz $ * @package Cache */ class Cache_Container_shm extends Cache_Container @@ -101,7 +104,7 @@ /** * Creates a shared memory container * - * @param array $options shm_key, sem_key, shm_size, sem_perm, shm_perm + * @param array shm_key, sem_key, shm_size, sem_perm, shm_perm */ function __construct($options = '') { Modified: trunk/lib/pear/Cache/Container/trifile.php =================================================================== --- trunk/lib/pear/Cache/Container/trifile.php 2025-02-09 18:37:38 UTC (rev 11085) +++ trunk/lib/pear/Cache/Container/trifile.php 2025-02-09 18:59:38 UTC (rev 11086) @@ -16,6 +16,8 @@ // | Sebastian Bergmann <sb...@se...> | // | Ian Eure <ie...@ph...> | // +----------------------------------------------------------------------+ +// +// $Id: trifile.php 184642 2005-04-18 19:05:01Z dufuz $ require_once 'lib/pear/Cache/Container/file.php'; Modified: trunk/lib/pear/Cache/Container.php =================================================================== --- trunk/lib/pear/Cache/Container.php 2025-02-09 18:37:38 UTC (rev 11085) +++ trunk/lib/pear/Cache/Container.php 2025-02-09 18:59:38 UTC (rev 11086) @@ -16,6 +16,8 @@ // | Sebastian Bergmann <sb...@se...> | // | Christian Stocker <ch...@ph...> | // +----------------------------------------------------------------------+ +// +// $Id: Container.php 293863 2010-01-23 03:46:52Z clockwerx $ require_once 'lib/pear/Cache/Error.php'; @@ -37,6 +39,7 @@ * not recommended! * * @author Ulf Wendel <ulf...@ph...> +* @version $Id: Container.php 293863 2010-01-23 03:46:52Z clockwerx $ * @package Cache * @access public * @abstract @@ -45,7 +48,7 @@ { /** - * Flag indicating whether to preload datasets. + * Flag indicating wheter to preload datasets. * * See the class description for more details. * @@ -126,7 +129,7 @@ /** - * Options that can be set in every derived class using its constructor. + * Options that can be set in every derived class using it's constructor. * * @var array */ @@ -136,8 +139,8 @@ /** * Loads a dataset from the cache. * - * @param string $id dataset ID - * @param string $group cache group + * @param string dataset ID + * @param string cache group * @return mixed dataset value or null on failure * @access public */ @@ -162,8 +165,8 @@ /** * Returns the userdata field of a cached data set. * - * @param string $id dataset ID - * @param string $group cache group + * @param string dataset ID + * @param string cache group * @return string userdata * @access public */ @@ -188,9 +191,9 @@ /** * Checks if a dataset is expired. * - * @param string $id dataset ID - * @param string $group cache group - * @param integer $max_age maximum age timestamp + * @param string dataset ID + * @param string cache group + * @param integer maximum age timestamp * @return boolean * @access public */ @@ -233,8 +236,8 @@ /** * Checks if a dataset is cached. * - * @param string $id dataset ID - * @param string $group cache group + * @param string dataset ID + * @param string cache group * @return boolean */ function isCached($id, $group) @@ -255,8 +258,8 @@ /** * Fetches a dataset from the storage medium. * - * @param string $id dataset ID - * @param string $group cache group + * @param string dataset ID + * @param string cache group * @return array format: [expire date, cached data, user data] * @throws Cache_Error * @abstract @@ -269,11 +272,11 @@ /** * Stores a dataset. * - * @param string $id dataset ID - * @param mixed $data data to store - * @param mixed $expire userdefined expire date - * @param string $group cache group - * @param string $userdata additional userdefined data + * @param string dataset ID + * @param mixed data to store + * @param mixed userdefined expire date + * @param string cache group + * @param string additional userdefined data * @return boolean * @throws Cache_Error * @access public @@ -290,8 +293,8 @@ /** * Removes a dataset. * - * @param string $id dataset ID - * @param string $group cache group + * @param string dataset ID + * @param string cache group * @return boolean * @access public * @abstract @@ -305,7 +308,7 @@ /** * Flushes the cache - removes all caches datasets from the cache. * - * @param string $group If a cache group is given only the group will be flushed + * @param string If a cache group is given only the group will be flushed * @return integer Number of removed datasets, -1 on failure * @access public * @abstract @@ -319,8 +322,8 @@ /** * Checks if a dataset exists. * - * @param string $id dataset ID - * @param string $group cache group + * @param string dataset ID + * @param string cache group * @return boolean * @access public * @abstract @@ -347,8 +350,8 @@ /** * Does a speculative preload of a dataset * - * @param string $id dataset ID - * @param string $group cache group + * @param string dataset ID + * @param string cache group * @return boolean */ function preload($id, $group) @@ -378,13 +381,13 @@ * Flushes the internal preload buffer. * * save(), remove() and flush() must call this method - * to prevent differences between the preloaded values and + * to preevent differences between the preloaded values and * the real cache contents. * - * @param string $id dataset ID, if left out the preloaded values will be flushed. + * @param string dataset ID, if left out the preloaded values will be flushed. * If given the preloaded values will only be flushed if they are * equal to the given id and group - * @param string $group cache group + * @param string cache group * @see preload() */ function flushPreload($id = '', $group = 'default') @@ -403,8 +406,8 @@ /** * Imports the requested datafields as object variables if allowed * - * @param array $requested List of fields to be imported as object variables - * @param array $allowed List of allowed datafields + * @param array List of fields to be imported as object variables + * @param array List of allowed datafields */ function setOptions($requested, $allowed) { @@ -418,7 +421,7 @@ /** * Encodes the data for the storage container. * - * @return mixed data to encode + * @var mixed data to encode */ function encode($data) { @@ -433,7 +436,7 @@ /** * Decodes the data from the storage container. * - * @return mixed + * @var mixed */ function decode($data) { @@ -448,7 +451,7 @@ /** * Translates human readable/relative times in unixtime * - * @param mixed $expires can be in the following formats: + * @param mixed can be in the following formats: * human readable : yyyymmddhhmm[ss]] eg: 20010308095100 * relative in seconds (1) : +xx eg: +10 * relative in seconds (2) : x < 946681200 eg: 10 @@ -468,10 +471,10 @@ } elseif ($expires < 100000000000) { //if integer is < 100000000000 (= in 3140 years), // it must be an absolut unixtime - // (since the "human-readable" definition asks for a higher number) + // (since the "human readable" definition asks for a higher number) return $expires; } else { - // else it's "human-readable"; + // else it's "human readable"; $year = substr($expires, 0, 4); $month = substr($expires, 4, 2); $day = substr($expires, 6, 2); Modified: trunk/lib/pear/Cache/Error.php =================================================================== --- trunk/lib/pear/Cache/Error.php 2025-02-09 18:37:38 UTC (rev 11085) +++ trunk/lib/pear/Cache/Error.php 2025-02-09 18:59:38 UTC (rev 11086) @@ -14,6 +14,8 @@ // +----------------------------------------------------------------------+ // | Authors: Ulf Wendel <ulf...@ph...> | // +----------------------------------------------------------------------+ +// +// $Id: Error.php 174777 2004-12-15 09:09:33Z dufuz $ require_once 'lib/pear/PEAR.php'; @@ -36,9 +38,9 @@ /** * Creates an cache error object. * - * @param string $msg error message - * @param string $file file where the error occurred - * @param string $line line number where the error occurred + * @param string error message + * @param string file where the error occured + * @param string linenumber where the error occured */ function __construct($msg, $file = __FILE__, $line = __LINE__) { Modified: trunk/lib/pear/Cache/Function.php =================================================================== --- trunk/lib/pear/Cache/Function.php 2025-02-09 18:37:38 UTC (rev 11085) +++ trunk/lib/pear/Cache/Function.php 2025-02-09 18:59:38 UTC (rev 11086) @@ -14,6 +14,8 @@ // +----------------------------------------------------------------------+ // | Authors: Sebastian Bergmann <sb...@se...> | // +----------------------------------------------------------------------+ +// +// $Id: Function.php 174777 2004-12-15 09:09:33Z dufuz $ require_once 'lib/pear/Cache.php'; @@ -63,6 +65,7 @@ * @module Function_Cache * @modulegroup Function_Cache * @package Cache +* @version $Revision: 174777 $ * @access public */ class Cache_Function extends Cache @@ -72,9 +75,9 @@ /** * Constructor * - * @param string $container Name of container class - * @param array $container_options Array with container class options - * @param integer $expires Number of seconds for which to cache + * @param string Name of container class + * @param array Array with container class options + * @param integer Number of seconds for which to cache */ function __construct($container = 'file', $container_options = array('cache_dir' => '.', Modified: trunk/lib/pear/Cache/Graphics.php =================================================================== --- trunk/lib/pear/Cache/Graphics.php 2025-02-09 18:37:38 UTC (rev 11085) +++ trunk/lib/pear/Cache/Graphics.php 2025-02-09 18:59:38 UTC (rev 11086) @@ -14,6 +14,8 @@ // +----------------------------------------------------------------------+ // | Authors: Ulf Wendel <ulf...@ph...> | // +----------------------------------------------------------------------+ +// +// $Id: Graphics.php 178289 2005-01-26 09:47:28Z dufuz $ require_once 'lib/pear/Cache.php'; @@ -64,6 +66,7 @@ * the output buffer. Modify it if required! * * @author Ulf Wendel <ulf...@ph...> +* @version $Id: Graphics.php 178289 2005-01-26 09:47:28Z dufuz $ * @package Cache */ class Cache_Graphics extends Cache @@ -114,7 +117,7 @@ /** * Mapping from supported image type to a ImageType() constant. * - * Refer to the PHP manual for more information on ImageType() + * Referr to the PHP manual for more informations on ImageType() * * @var array * @link http://www.php.net/ImageType @@ -139,13 +142,13 @@ * Returns the content of a cached image file. * * This function can be used to send the image directly to the browser. - * Make sure that you send a correspondding header before sending the image itself. + * Make sure that you send a correspondending header before sending the image itself. * * Always try to get the image from the cache before you compute it. See * the class docs for an example. * - * @param string $id Image-ID - * @param string $format Image type: gif, jpg, png, wbmp + * @param string Image-ID + * @param string Image type: gif, jpg, png, wbmp * @return string Image file contents if a cached file exists otherwise an empty string * @see cacheImage() */ @@ -162,8 +165,8 @@ * Always try to get the image from the cache before you compute it. See * the class docs for an example. * - * @param string $id Image-ID - * @param string $format Image type: gif, jpg, png, wbmp + * @param string Image-ID + * @param string Image type: gif, jpg, png, wbmp * @return array [ full path to the image file, image url ] * @throw Cache_Error * @see cacheImageLink() @@ -183,18 +186,18 @@ /** * Create an image from the given image handler, cache it and return the file content. * - * Always try to retrieve the image from the cache before you compute it. + * Always try to retrive the image from the cache before you compute it. * * Warning: this function uses the output buffer. If you expect collisions * modify the code. * - * @param string $id Image-ID. Used as a part of the cache filename. + * @param string Image-ID. Used as a part of the cache filename. * Use md5() to generate a "unique" ID for your image * based on characteristic values such as the color, size etc. - * @param string $img Image handler to create the image from. - * @param string $format Image type: gif, jpg, png, wbmp. Also used as filename suffix. + * @param string Image handler to create the image from. + * @param string Image type: gif, jpg, png, wbmp. Also used as filename suffix. * If an unsupported type is requested the functions tries to - * fall back to a supported type before throwing an exception. + * fallback to a supported type before throwing an exeption. * @return string Image content returned by ImageGIF/... * @throws Cache_Error * @access public @@ -253,15 +256,15 @@ /** * Create an image from the given image handler, cache it and return a url and the file path of the image. * - * Always try to retrieve the image from the cache before you compute it. + * Always try to retrive the image from the cache before you compute it. * - * @param string $id Image-ID. Used as a part of the cache filename. + * @param string Image-ID. Used as a part of the cache filename. * Use md5() to generate a "unique" ID for your image * based on characteristic values such as the color, size etc. - * @param string $img Image handler to create the image from. - * @param string $format Image type: gif, jpg, png, wbmp. Also used as filename suffix. + * @param string Image handler to create the image from. + * @param string Image type: gif, jpg, png, wbmp. Also used as filename suffix. * If an unsupported type is requested the functions tries to - * fall back to a supported type before throwing an exception. + * fallback to a supported type before throwing an exeption. * @return array [ full path to the image file, image url ] * @throws Cache_Error * @access public @@ -313,8 +316,8 @@ * Make sure that the URL matches the cache directory, * otherwise you'll get broken links. * - * @param string $cache_url - * @access public + * @param string + * @access public * @see setCacheDir() */ function setCacheURL($cache_url) @@ -330,8 +333,8 @@ /** * Sets the directory where to cache generated Images * - * @param string $cache_dir - * @access public + * @param string + * @access public * @see setCacheURL() */ function setCacheDir($cache_dir) Modified: trunk/lib/pear/Cache/HTTP_Request.php =================================================================== --- trunk/lib/pear/Cache/HTTP_Request.php 2025-02-09 18:37:38 UTC (rev 11085) +++ trunk/lib/pear/Cache/HTTP_Request.php 2025-02-09 18:59:38 UTC (rev 11086) @@ -14,6 +14,8 @@ // +----------------------------------------------------------------------+ // | Authors: Fabien MARTY <fab...@fr...> | // +----------------------------------------------------------------------+ +// +// $Id: HTTP_Request.php 174777 2004-12-15 09:09:33Z dufuz $ require_once 'lib/pear/Cache.php'; require_once 'lib/pear/HTTP/Request.php'; @@ -32,9 +34,9 @@ * You want to get news from another site through RSS remote files. But you * don't want to access to to the remote site at every time you display * its news on your site. Because, if the remote site is down or slow... -* So you need a class which makes a local cache copy of the remote file. +* So you you need a class which makes a local cache copy of the remote file. * Every x hours, the cache is updated. But if the remote site is down, the -* local cache copy is kept (you can also get error messages if you want). +* local cache copy is keeped (you can also get error messages if you want). * * So you need this class! * @@ -54,6 +56,7 @@ * ?> * * @author Fabien MARTY <fab...@fr...> +* @version $Id: HTTP_Request.php 174777 2004-12-15 09:09:33Z dufuz $ * @package Cache */ Modified: trunk/lib/pear/Cache/Output.php =================================================================== --- trunk/lib/pear/Cache/Output.php 2025-02-09 18:37:38 UTC (rev 11085) +++ trunk/lib/pear/Cache/Output.php 2025-02-09 18:59:38 UTC (rev 11086) @@ -16,6 +16,8 @@ // | Christian Stocker <ch...@ph...> | // | Vinai Kopp <ko...@ne...> | // +----------------------------------------------------------------------+ +// +// $Id: Output.php 178289 2005-01-26 09:47:28Z dufuz $ require_once 'lib/pear/Cache.php'; @@ -26,9 +28,9 @@ * output can increase the overall speed dramatically, especially if you use * a Shared Memory storage container. * -* As you can see in the example the usage is extremely simple. To cache a script +* As you can see in the example the usage is extemely simple. To cache a script * simple put some few lines of code in front of your script and some at the end. -* A preferable place for this are the auto_prepend and auto_append files (=> php.ini). +* A preferrable place for this are the auto_prepend and auto_append files (=> php.ini). * * Usage example: * @@ -88,6 +90,7 @@ * Have fun! * * @authors Ulf Wendel <ulf...@ph...> +* @version $ID: $ * @package Cache * @access public */ @@ -122,8 +125,8 @@ /** * starts the output buffering and returns an empty string or returns the cached output from the cache. * - * @param string $id dataset ID - * @param string $group cache group + * @param string dataset ID + * @param string cache group * @return string * @access public */ @@ -183,8 +186,8 @@ * Sends the data to the user. * This is for compatibility with OutputCompression * - * @param string $content - * @access public + * @param string + * @access public */ function printContent($content = '') { Modified: trunk/lib/pear/Cache/OutputCompression.php =================================================================== --- trunk/lib/pear/Cache/OutputCompression.php 2025-02-09 18:37:38 UTC (rev 11085) +++ trunk/lib/pear/Cache/OutputCompression.php 2025-02-09 18:59:38 UTC (rev 11086) @@ -19,7 +19,7 @@ require_once 'lib/pear/Cache/Output.php'; /** -* Cache using Output Buffering and content (gz) compression. +* Cache using Output Buffering and contnet (gz) compression. ** Usage example: * * // place this somewhere in a central config file @@ -50,6 +50,7 @@ * * Based upon a case study from Christian Stocker and inspired by jpcache. * +* @version $Id: OutputCompression.php 178289 2005-01-26 09:47:28Z dufuz $ * @author Ulf Wendel <ulf...@ph...>, Christian Stocker <ch...@ph...> * @access public * @package Cache @@ -80,9 +81,9 @@ /** * Sets the storage details and the content encoding used (if not autodetection) * - * @param string $container Name of container class - * @param array $container_options Array with container class options - * @param string $encoding content encoding mode - auto => test which encoding the user accepts + * @param string Name of container class + * @param array Array with container class options + * @param string content encoding mode - auto => test which encoding the user accepts */ function __construct($container, $container_options = '', $encoding = 'auto') { @@ -173,8 +174,8 @@ /** * Sends the compressed data to the user. * - * @param string $content - * @access public + * @param string + * @access public */ function printContent($content = '') { @@ -218,7 +219,7 @@ /** * Sets the encoding to be used. * - * @param string $encoding "auto" means autodetect for every client + * @param string "auto" means autodetect for every client * @access public * @see $encoding */ @@ -259,7 +260,7 @@ * Import variables from special namespaces. * * @access private - * @param string $variable Type of variable (server, session, post) + * @param string Type of variable (server, session, post) * @return array */ function &_importGlobalVariable($variable) Modified: trunk/lib/pear/Cache.php =================================================================== --- trunk/lib/pear/Cache.php 2025-02-09 18:37:38 UTC (rev 11085) +++ trunk/lib/pear/Cache.php 2025-02-09 18:59:38 UTC (rev 11086) @@ -27,7 +27,7 @@ * cache script runs. The idea behind the cache is quite simple. If you have * the same input parameters for whatever tasks/algorithm you use you'll * usually get the same output. So why not caching templates, functions calls, -* graphic generation etc. Caching certain actions e.g. XSLT transformations +* graphic generation etc. Caching certain actions e.g. XSLT tranformations * saves you lots of time. * * The design of the cache reminds of PHPLibs session implementation. A @@ -121,8 +121,8 @@ /** * - * @param string $container Name of container class - * @param array $container_options Array with container class options + * @param string Name of container class + * @param array Array with container class options */ function __construct($container, $container_options = '') { @@ -155,7 +155,7 @@ /** * Enables or disables caching. * - * @param boolean $state The new caching state. + * @param boolean The new caching state. * @access public */ function setCaching($state) @@ -166,8 +166,8 @@ /** * Returns the requested dataset it if exists and is not expired * - * @param string $id dataset ID - * @param string $group cache group + * @param string dataset ID + * @param string cache group * @return mixed cached data or NULL on failure * @access public */ @@ -184,10 +184,10 @@ /** * Stores the given data in the cache. * - * @param string $id dataset ID used as cache identifier - * @param mixed $data data to cache - * @param integer $expires lifetime of the cached data in seconds - 0 for endless - * @param string $group cache group + * @param string dataset ID used as cache identifier + * @param mixed data to cache + * @param integer lifetime of the cached data in seconds - 0 for endless + * @param string cache group * @return boolean * @access public */ @@ -201,11 +201,11 @@ /** * Stores a dataset without additional userdefined data. * - * @param string $id dataset ID - * @param mixed $cachedata data to store - * @param string $userdata additional userdefined data - * @param mixed $expires userdefined expire date - * @param string $group cache group + * @param string dataset ID + * @param mixed data to store + * @param string additional userdefined data + * @param mixed userdefined expire date + * @param string cache group * @return boolean * @throws Cache_Error * @access public @@ -221,8 +221,8 @@ /** * Loads the given ID from the cache. * - * @param string $id dataset ID - * @param string $group cache group + * @param string dataset ID + * @param string cache group * @return mixed cached data or NULL on failure * @access public */ @@ -236,8 +236,8 @@ /** * Returns the userdata field of a cached data set. * - * @param string $id dataset ID - * @param string $group cache group + * @param string dataset ID + * @param string cache group * @return string userdata * @access public * @see extSave() @@ -252,8 +252,8 @@ /** * Removes the specified dataset from the cache. * - * @param string $id dataset ID - * @param string $group cache group + * @param string dataset ID + * @param string cache group * @return boolean * @access public */ @@ -267,7 +267,7 @@ /** * Flushes the cache - removes all data from it * - * @param string $group cache group, if empty all groups will be flashed + * @param string cache group, if empty all groups will be flashed * @return integer number of removed datasets */ function flush($group = 'default') { @@ -282,8 +282,8 @@ * * Note: this does not say that the cached data is not expired! * - * @param string $id dataset ID - * @param string $group cache group + * @param string dataset ID + * @param string cache group * @return boolean * @access public */ @@ -297,9 +297,9 @@ /** * Checks if a dataset is expired * - * @param string $id dataset ID - * @param string $group cache group - * @param integer $max_age maximum age for the cached data in seconds - 0 for endless + * @param string dataset ID + * @param string cache group + * @param integer maximum age for the cached data in seconds - 0 for endless * If the cached data is older but the given lifetime it will * be removed from the cache. You don't have to provide this * argument if you call isExpired(). Every dataset knows @@ -321,7 +321,7 @@ * This is a quick but dirty hack to get a "unique" ID for a any kind of variable. * ID clashes might occur from time to time although they are extreme unlikely! * - * @param mixed $variable variable to generate a ID for + * @param mixed variable to generate a ID for * @return string "unique" ID * @access public */ @@ -333,7 +333,7 @@ /** * Calls the garbage collector of the storage object with a certain probability * - * @param boolean $force Force a garbage collection run? + * @param boolean Force a garbage collection run? * @see $gc_probability, $gc_time */ function garbageCollection($force = false) { Modified: trunk/lib/pear/DB/common.php =================================================================== --- trunk/lib/pear/DB/common.php 2025-02-09 18:37:38 UTC (rev 11085) +++ trunk/lib/pear/DB/common.php 2025-02-09 18:59:38 UTC (rev 11086) @@ -430,8 +430,8 @@ * </li> * <li> * other (including strings and numeric strings) -> - * the data with single quotes escaped by preceding - * single quotes, backslashes are escaped by preceding + * the data with single quotes escaped by preceeding + * single quotes, backslashes are escaped by preceeding * backslashes, then the whole string is encapsulated * between single quotes * </li> @@ -467,7 +467,7 @@ * Formats a boolean value for use within a query in a locale-independent * manner. * - * @param boolean $boolean the boolean value to be quoted. + * @param boolean the boolean value to be quoted. * @return string the quoted string. * @see DB_common::quoteSmart() * @since Method available since release 1.7.8. @@ -483,7 +483,7 @@ * Formats a float value for use within a query in a locale-independent * manner. * - * @param float $float the float value to be quoted. + * @param float the float value to be quoted. * @return string the quoted string. * @see DB_common::quoteSmart() * @since Method available since release 1.7.8. @@ -543,7 +543,7 @@ * DB_FETCHMODE_OBJECT mode is selected. * If no class is specified by default a cast * to object from the assoc array row will be - * done. There is also the possibility to use + * done. There is also the posibility to use * and extend the 'DB_row' class. * * @see DB_FETCHMODE_ORDERED, DB_FETCHMODE_ASSOC, DB_FETCHMODE_OBJECT @@ -842,7 +842,7 @@ // {{{ autoPrepare() /** - * Automatically generates an insert or update query and pass it to prepare() + * Automaticaly generates an insert or update query and pass it to prepare() * * @param string $table the table name * @param array $table_fields the array of field names @@ -870,7 +870,7 @@ // {{{ autoExecute() /** - * Automatically generates an insert or update query and call prepare() + * Automaticaly generates an insert or update query and call prepare() * and execute() with it * * @param string $table the table name @@ -883,7 +883,7 @@ * include the "WHERE" keyword. * * @return mixed a new DB_result object for successful SELECT queries - * or DB_OK for successful data manipulation queries. + * or DB_OK for successul data manipulation queries. * A DB_Error object on failure. * * @uses DB_common::autoPrepare(), DB_common::execute() @@ -925,7 +925,7 @@ * NOTES: * - This belongs more to a SQL Builder class, but this is a simple * facility. - * - Be careful! If you don't give a $where param with an UPDATE + * - Be carefull! If you don't give a $where param with an UPDATE * query, all the records of the table will be updated! * * @param string $table the table name @@ -1004,7 +1004,7 @@ * parameters or 1 placeholder per array element. * * @return mixed a new DB_result object for successful SELECT queries - * or DB_OK for successful data manipulation queries. + * or DB_OK for successul data manipulation queries. * A DB_Error object on failure. * * {@internal ibase and oci8 have their own execute() methods.}} @@ -1204,7 +1204,7 @@ * parameters or 1 placeholder per array element. * * @return mixed a new DB_result object for successful SELECT queries - * or DB_OK for successful data manipulation queries. + * or DB_OK for successul data manipulation queries. * A DB_Error object on failure. * * @see DB_result, DB_common::prepare(), DB_common::execute() @@ -1239,7 +1239,7 @@ * Generates and executes a LIMIT query * * @param string $query the query - * @param int $from the row to start to fetching (0 = the first row) + * @param intr $from the row to start to fetching (0 = the first row) * @param int $count the numbers of rows to fetch * @param mixed $params array, string or numeric data to be used in * execution of the statement. Quantity of items @@ -1248,7 +1248,7 @@ * parameters or 1 placeholder per array element. * * @return mixed a new DB_result object for successful SELECT queries - * or DB_OK for successful data manipulation queries. + * or DB_OK for successul data manipulation que... [truncated message content] |
From: <var...@us...> - 2016-01-05 20:16:23
|
Revision: 9748 http://sourceforge.net/p/phpwiki/code/9748 Author: vargenau Date: 2016-01-05 20:16:20 +0000 (Tue, 05 Jan 2016) Log Message: ----------- Update Pear DB to release 1.9.2 Modified Paths: -------------- trunk/lib/pear/DB/common.php trunk/lib/pear/DB/dbase.php trunk/lib/pear/DB/fbsql.php trunk/lib/pear/DB/ibase.php trunk/lib/pear/DB/ifx.php trunk/lib/pear/DB/msql.php trunk/lib/pear/DB/mssql.php trunk/lib/pear/DB/mysql.php trunk/lib/pear/DB/mysqli.php trunk/lib/pear/DB/oci8.php trunk/lib/pear/DB/odbc.php trunk/lib/pear/DB/pgsql.php trunk/lib/pear/DB/sqlite.php trunk/lib/pear/DB/storage.php trunk/lib/pear/DB/sybase.php trunk/lib/pear/DB.php Modified: trunk/lib/pear/DB/common.php =================================================================== --- trunk/lib/pear/DB/common.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/common.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -42,7 +42,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_common extends PEAR @@ -145,7 +145,7 @@ * * @return void */ - function DB_common() + function __construct() { $this->PEAR('DB_Error'); } Modified: trunk/lib/pear/DB/dbase.php =================================================================== --- trunk/lib/pear/DB/dbase.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/dbase.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -41,7 +41,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_dbase extends DB_common @@ -140,13 +140,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_dbase() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB/fbsql.php =================================================================== --- trunk/lib/pear/DB/fbsql.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/fbsql.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -41,7 +41,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB * @since Class functional since Release 1.7.0 */ @@ -124,13 +124,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_fbsql() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB/ibase.php =================================================================== --- trunk/lib/pear/DB/ibase.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/ibase.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -49,7 +49,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB * @since Class became stable in Release 1.7.0 */ @@ -180,13 +180,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_ibase() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB/ifx.php =================================================================== --- trunk/lib/pear/DB/ifx.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/ifx.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -48,7 +48,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_ifx extends DB_common @@ -167,13 +167,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_ifx() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB/msql.php =================================================================== --- trunk/lib/pear/DB/msql.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/msql.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -47,7 +47,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB * @since Class not functional until Release 1.7.0 */ @@ -126,13 +126,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_msql() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB/mssql.php =================================================================== --- trunk/lib/pear/DB/mssql.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/mssql.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -49,7 +49,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_mssql extends DB_common @@ -179,13 +179,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_mssql() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB/mysql.php =================================================================== --- trunk/lib/pear/DB/mysql.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/mysql.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -41,7 +41,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_mysql extends DB_common @@ -162,13 +162,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_mysql() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB/mysqli.php =================================================================== --- trunk/lib/pear/DB/mysqli.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/mysqli.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -43,7 +43,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB * @since Class functional since Release 1.6.3 */ @@ -224,13 +224,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_mysqli() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} @@ -497,7 +497,11 @@ */ function freeResult($result) { - return is_resource($result) ? mysqli_free_result($result) : false; + if (! $result instanceof mysqli_result) { + return false; + } + mysqli_free_result($result); + return true; } // }}} @@ -1031,6 +1035,10 @@ ? $this->mysqli_types[$tmp->type] : 'unknown', // http://bugs.php.net/?id=36579 + // Doc Bug #36579: mysqli_fetch_field length handling + // https://bugs.php.net/bug.php?id=62426 + // Bug #62426: mysqli_fetch_field_direct returns incorrect + // length on UTF8 fields 'len' => $tmp->length, 'flags' => $flags, ); Modified: trunk/lib/pear/DB/oci8.php =================================================================== --- trunk/lib/pear/DB/oci8.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/oci8.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -47,7 +47,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_oci8 extends DB_common @@ -173,13 +173,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_oci8() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB/odbc.php =================================================================== --- trunk/lib/pear/DB/odbc.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/odbc.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -44,7 +44,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_odbc extends DB_common @@ -153,13 +153,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_odbc() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB/pgsql.php =================================================================== --- trunk/lib/pear/DB/pgsql.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/pgsql.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -43,7 +43,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_pgsql extends DB_common @@ -148,13 +148,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_pgsql() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB/sqlite.php =================================================================== --- trunk/lib/pear/DB/sqlite.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/sqlite.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -47,7 +47,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_sqlite extends DB_common @@ -152,13 +152,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_sqlite() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB/storage.php =================================================================== --- trunk/lib/pear/DB/storage.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/storage.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -38,7 +38,7 @@ * @author Stig Bakken <st...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_storage extends PEAR @@ -94,7 +94,7 @@ * a reference to this object * */ - function DB_storage($table, $keycolumn, &$dbh, $validator = null) + function __construct($table, $keycolumn, &$dbh, $validator = null) { $this->PEAR('DB_Error'); $this->_table = $table; Modified: trunk/lib/pear/DB/sybase.php =================================================================== --- trunk/lib/pear/DB/sybase.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/sybase.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -17,7 +17,7 @@ * @category Database * @package DB * @author Sterling Hughes <ste...@ph...> - * @author Antônio Carlos Venâncio Júnior <fl...@ph...> + * @author Antônio Carlos Venâncio Júnior * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 @@ -42,11 +42,11 @@ * @category Database * @package DB * @author Sterling Hughes <ste...@ph...> - * @author Antônio Carlos Venâncio Júnior <fl...@ph...> + * @author Antônio Carlos Venâncio Júnior * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_sybase extends DB_common @@ -141,13 +141,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_sybase() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB.php =================================================================== --- trunk/lib/pear/DB.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -426,7 +426,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB @@ -577,7 +577,7 @@ */ function apiVersion() { - return '1.8.2'; + return '1.9.2'; } // }}} @@ -941,7 +941,7 @@ * @author Stig Bakken <ss...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_Error extends PEAR_Error @@ -959,18 +959,32 @@ * * @see PEAR_Error */ - function DB_Error($code = DB_ERROR, $mode = PEAR_ERROR_RETURN, + function __construct($code = DB_ERROR, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE, $debuginfo = null) { if (is_int($code)) { - $this->PEAR_Error('DB Error: ' . DB::errorMessage($code), $code, + parent::__construct('DB Error: ' . DB::errorMessage($code), $code, $mode, $level, $debuginfo); } else { - $this->PEAR_Error("DB Error: $code", DB_ERROR, + parent::__construct("DB Error: $code", DB_ERROR, $mode, $level, $debuginfo); } } + /** + * Workaround to both avoid the "Redefining already defined constructor" + * PHP error and provide backward compatibility in case someone is calling + * DB_Error() dynamically + */ + public function __call($method, $arguments) + { + if ($method == 'DB_Error') { + return call_user_func_array(array($this, '__construct'), $arguments); + } + trigger_error( + 'Call to undefined method DB_Error::' . $method . '()', E_USER_ERROR + ); + } // }}} } @@ -988,7 +1002,7 @@ * @author Stig Bakken <ss...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_result @@ -1095,7 +1109,7 @@ * * @return void */ - function DB_result(&$dbh, $result, $options = array()) + function __construct(&$dbh, $result, $options = array()) { $this->autofree = $dbh->options['autofree']; $this->dbh = &$dbh; @@ -1453,7 +1467,7 @@ * @author Stig Bakken <ss...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB * @see DB_common::setFetchMode() */ @@ -1468,7 +1482,7 @@ * * @return void */ - function DB_row(&$arr) + function __construct(&$arr) { foreach ($arr as $key => $value) { $this->$key = &$arr[$key]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-01-05 20:54:01
|
Revision: 9749 http://sourceforge.net/p/phpwiki/code/9749 Author: vargenau Date: 2016-01-05 20:53:59 +0000 (Tue, 05 Jan 2016) Log Message: ----------- Update PEAR.php to release 1.10.1 Modified Paths: -------------- trunk/lib/pear/PEAR.php Removed Paths: ------------- trunk/lib/pear/PEAR5.php Modified: trunk/lib/pear/PEAR.php =================================================================== --- trunk/lib/pear/PEAR.php 2016-01-05 20:16:20 UTC (rev 9748) +++ trunk/lib/pear/PEAR.php 2016-01-05 20:53:59 UTC (rev 9749) @@ -14,7 +14,6 @@ * @author Greg Beaver <ce...@ph...> * @copyright 1997-2010 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id$ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -33,8 +32,6 @@ */ define('PEAR_ERROR_EXCEPTION', 32); /**#@-*/ -define('PEAR_ZE2', (function_exists('version_compare') && - version_compare(zend_version(), "2-dev", "ge"))); if (substr(PHP_OS, 0, 3) == 'WIN') { define('OS_WINDOWS', true); @@ -78,7 +75,7 @@ * @author Greg Beaver <ce...@ph...> * @copyright 1997-2006 The PHP Group * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version Release: 1.9.5 + * @version Release: 1.10.1 * @link http://pear.php.net/package/PEAR * @see PEAR_Error * @since Class available since PHP 4.0.2 @@ -137,6 +134,18 @@ var $_expected_errors = array(); /** + * List of methods that can be called both statically and non-statically. + * @var array + */ + protected static $bivalentMethods = array( + 'setErrorHandling' => true, + 'raiseError' => true, + 'throwError' => true, + 'pushErrorHandling' => true, + 'popErrorHandling' => true, + ); + + /** * Constructor. Registers this object in * $_PEAR_destructor_object_list for destructor emulation if a * destructor object exists. @@ -146,7 +155,7 @@ * @access public * @return void */ - function PEAR($error_class = null) + function __construct($error_class = null) { $classname = strtolower(get_class($this)); if ($this->_debug) { @@ -174,6 +183,18 @@ } /** + * Only here for backwards compatibility. + * E.g. Archive_Tar calls $this->PEAR() in its constructor. + * + * @param string $error_class Which class to use for error objects, + * defaults to PEAR_Error. + */ + public function PEAR($error_class = null) + { + self::__construct($error_class); + } + + /** * Destructor (the emulated type of...). Does nothing right now, * but is included for forward compatibility, so subclass * destructors should always call it. @@ -190,19 +211,44 @@ } } + public function __call($method, $arguments) + { + if (!isset(self::$bivalentMethods[$method])) { + trigger_error( + 'Call to undefined method PEAR::' . $method . '()', E_USER_ERROR + ); + } + return call_user_func_array( + array(get_class(), '_' . $method), + array_merge(array($this), $arguments) + ); + } + + public static function __callStatic($method, $arguments) + { + if (!isset(self::$bivalentMethods[$method])) { + trigger_error( + 'Call to undefined method PEAR::' . $method . '()', E_USER_ERROR + ); + } + return call_user_func_array( + array(get_class(), '_' . $method), + array_merge(array(null), $arguments) + ); + } + /** * If you have a class that's mostly/entirely static, and you need static * properties, you can use this method to simulate them. Eg. in your method(s) * do this: $myVar = &PEAR::getStaticProperty('myclass', 'myVar'); * You MUST use a reference, or they will not persist! * - * @access public * @param string $class The calling classname, to prevent clashes * @param string $var The variable to retrieve. * @return mixed A reference to the variable. If not set it will be * auto initialised to NULL. */ - function &getStaticProperty($class, $var) + public static function &getStaticProperty($class, $var) { static $properties; if (!isset($properties[$class])) { @@ -220,12 +266,12 @@ * Use this function to register a shutdown method for static * classes. * - * @access public * @param mixed $func The function name (or array of class/method) to call * @param mixed $args The arguments to pass to the function + * * @return void */ - function registerShutdownFunc($func, $args = array()) + public static function registerShutdownFunc($func, $args = array()) { // if we are called statically, there is a potential // that no shutdown func is registered. Bug #6445 @@ -244,10 +290,10 @@ * only if $code is a string and * $obj->getMessage() == $code or * $code is an integer and $obj->getCode() == $code - * @access public + * * @return bool true if parameter is an error */ - function isError($data, $code = null) + public static function isError($data, $code = null) { if (!is_a($data, 'PEAR_Error')) { return false; @@ -269,6 +315,9 @@ * PEAR objects. If called in an object, setErrorHandling sets * the default behaviour for that object. * + * @param object $object + * Object the method was called on (non-static mode) + * * @param int $mode * One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, @@ -300,11 +349,12 @@ * * @since PHP 4.0.5 */ - function setErrorHandling($mode = null, $options = null) - { - if (isset($this) && is_a($this, 'PEAR')) { - $setmode = &$this->_default_error_mode; - $setoptions = &$this->_default_error_options; + protected static function _setErrorHandling( + $object, $mode = null, $options = null + ) { + if ($object !== null) { + $setmode = &$object->_default_error_mode; + $setoptions = &$object->_default_error_options; } else { $setmode = &$GLOBALS['_PEAR_default_error_mode']; $setoptions = &$GLOBALS['_PEAR_default_error_options']; @@ -464,12 +514,12 @@ * @param bool $skipmsg If true, raiseError will only pass error codes, * the error message parameter will be dropped. * - * @access public * @return object a PEAR error object * @see PEAR::setErrorHandling * @since PHP 4.0.5 */ - function &raiseError($message = null, + protected static function _raiseError($object, + $message = null, $code = null, $mode = null, $options = null, @@ -487,10 +537,10 @@ } if ( - isset($this) && - isset($this->_expected_errors) && - count($this->_expected_errors) > 0 && - count($exp = end($this->_expected_errors)) + $object !== null && + isset($object->_expected_errors) && + count($object->_expected_errors) > 0 && + count($exp = end($object->_expected_errors)) ) { if ($exp[0] == "*" || (is_int(reset($exp)) && in_array($code, $exp)) || @@ -503,9 +553,9 @@ // No mode given, try global ones if ($mode === null) { // Class error handler - if (isset($this) && isset($this->_default_error_mode)) { - $mode = $this->_default_error_mode; - $options = $this->_default_error_options; + if ($object !== null && isset($object->_default_error_mode)) { + $mode = $object->_default_error_mode; + $options = $object->_default_error_options; // Global error handler } elseif (isset($GLOBALS['_PEAR_default_error_mode'])) { $mode = $GLOBALS['_PEAR_default_error_mode']; @@ -515,18 +565,12 @@ if ($error_class !== null) { $ec = $error_class; - } elseif (isset($this) && isset($this->_error_class)) { - $ec = $this->_error_class; + } elseif ($object !== null && isset($object->_error_class)) { + $ec = $object->_error_class; } else { $ec = 'PEAR_Error'; } - if (intval(PHP_VERSION) < 5) { - // little non-eval hack to fix bug #12147 - include 'PEAR/FixPHP5PEARWarnings.php'; - return $a; - } - if ($skipmsg) { $a = new $ec($code, $mode, $options, $userinfo); } else { @@ -548,14 +592,13 @@ * @param string $userinfo If you need to pass along for example debug * information, this parameter is meant for that. * - * @access public * @return object a PEAR error object * @see PEAR::raiseError */ - function &throwError($message = null, $code = null, $userinfo = null) + protected static function _throwError($object, $message = null, $code = null, $userinfo = null) { - if (isset($this) && is_a($this, 'PEAR')) { - $a = &$this->raiseError($message, $code, null, null, $userinfo); + if ($object !== null) { + $a = &$object->raiseError($message, $code, null, null, $userinfo); return $a; } @@ -563,7 +606,7 @@ return $a; } - function staticPushErrorHandling($mode, $options = null) + public static function staticPushErrorHandling($mode, $options = null) { $stack = &$GLOBALS['_PEAR_error_handler_stack']; $def_mode = &$GLOBALS['_PEAR_default_error_mode']; @@ -598,7 +641,7 @@ return true; } - function staticPopErrorHandling() + public static function staticPopErrorHandling() { $stack = &$GLOBALS['_PEAR_error_handler_stack']; $setmode = &$GLOBALS['_PEAR_default_error_mode']; @@ -646,20 +689,20 @@ * * @see PEAR::setErrorHandling */ - function pushErrorHandling($mode, $options = null) + protected static function _pushErrorHandling($object, $mode, $options = null) { $stack = &$GLOBALS['_PEAR_error_handler_stack']; - if (isset($this) && is_a($this, 'PEAR')) { - $def_mode = &$this->_default_error_mode; - $def_options = &$this->_default_error_options; + if ($object !== null) { + $def_mode = &$object->_default_error_mode; + $def_options = &$object->_default_error_options; } else { $def_mode = &$GLOBALS['_PEAR_default_error_mode']; $def_options = &$GLOBALS['_PEAR_default_error_options']; } $stack[] = array($def_mode, $def_options); - if (isset($this) && is_a($this, 'PEAR')) { - $this->setErrorHandling($mode, $options); + if ($object !== null) { + $object->setErrorHandling($mode, $options); } else { PEAR::setErrorHandling($mode, $options); } @@ -674,14 +717,14 @@ * * @see PEAR::pushErrorHandling */ - function popErrorHandling() + protected static function _popErrorHandling($object) { $stack = &$GLOBALS['_PEAR_error_handler_stack']; array_pop($stack); list($mode, $options) = $stack[sizeof($stack) - 1]; array_pop($stack); - if (isset($this) && is_a($this, 'PEAR')) { - $this->setErrorHandling($mode, $options); + if ($object !== null) { + $object->setErrorHandling($mode, $options); } else { PEAR::setErrorHandling($mode, $options); } @@ -695,7 +738,7 @@ * @param string $ext The extension name * @return bool Success or not on the dl() call */ - function loadExtension($ext) + public static function loadExtension($ext) { if (extension_loaded($ext)) { return true; @@ -704,8 +747,7 @@ // if either returns true dl() will produce a FATAL error, stop that if ( function_exists('dl') === false || - ini_get('enable_dl') != 1 || - ini_get('safe_mode') == 1 + ini_get('enable_dl') != 1 ) { return false; } @@ -726,10 +768,6 @@ } } -if (PEAR_ZE2) { - include_once 'PEAR5.php'; -} - function _PEAR_call_destructors() { global $_PEAR_destructor_object_list; @@ -737,12 +775,9 @@ sizeof($_PEAR_destructor_object_list)) { reset($_PEAR_destructor_object_list); - if (PEAR_ZE2) { - $destructLifoExists = PEAR5::getStaticProperty('PEAR', 'destructlifo'); - } else { - $destructLifoExists = PEAR::getStaticProperty('PEAR', 'destructlifo'); - } + $destructLifoExists = PEAR::getStaticProperty('PEAR', 'destructlifo'); + if ($destructLifoExists) { $_PEAR_destructor_object_list = array_reverse($_PEAR_destructor_object_list); } @@ -788,7 +823,7 @@ * @author Gregory Beaver <ce...@ph...> * @copyright 1997-2006 The PHP Group * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version Release: 1.9.5 + * @version Release: 1.10.1 * @link http://pear.php.net/manual/en/core.pear.pear-error.php * @see PEAR::raiseError(), PEAR::throwError() * @since Class available since PHP 4.0.2 @@ -823,7 +858,7 @@ * @access public * */ - function PEAR_Error($message = 'unknown error', $code = null, + function __construct($message = 'unknown error', $code = null, $mode = null, $options = null, $userinfo = null) { if ($mode === null) { @@ -834,11 +869,7 @@ $this->mode = $mode; $this->userinfo = $userinfo; - if (PEAR_ZE2) { - $skiptrace = PEAR5::getStaticProperty('PEAR_Error', 'skiptrace'); - } else { - $skiptrace = PEAR::getStaticProperty('PEAR_Error', 'skiptrace'); - } + $skiptrace = PEAR::getStaticProperty('PEAR_Error', 'skiptrace'); if (!$skiptrace) { $this->backtrace = debug_backtrace(); @@ -897,6 +928,24 @@ } /** + * Only here for backwards compatibility. + * + * Class "Cache_Error" still uses it, among others. + * + * @param string $message Message + * @param int $code Error code + * @param int $mode Error mode + * @param mixed $options See __construct() + * @param string $userinfo Additional user/debug info + */ + public function PEAR_Error( + $message = 'unknown error', $code = null, $mode = null, + $options = null, $userinfo = null + ) { + self::__construct($message, $code, $mode, $options, $userinfo); + } + + /** * Get the error mode from an error object. * * @return int error mode Deleted: trunk/lib/pear/PEAR5.php =================================================================== --- trunk/lib/pear/PEAR5.php 2016-01-05 20:16:20 UTC (rev 9748) +++ trunk/lib/pear/PEAR5.php 2016-01-05 20:53:59 UTC (rev 9749) @@ -1,33 +0,0 @@ -<?php -/** - * This is only meant for PHP 5 to get rid of certain strict warning - * that doesn't get hidden since it's in the shutdown function - */ -class PEAR5 -{ - /** - * If you have a class that's mostly/entirely static, and you need static - * properties, you can use this method to simulate them. Eg. in your method(s) - * do this: $myVar = &PEAR5::getStaticProperty('myclass', 'myVar'); - * You MUST use a reference, or they will not persist! - * - * @access public - * @param string $class The calling classname, to prevent clashes - * @param string $var The variable to retrieve. - * @return mixed A reference to the variable. If not set it will be - * auto initialised to NULL. - */ - static function &getStaticProperty($class, $var) - { - static $properties; - if (!isset($properties[$class])) { - $properties[$class] = array(); - } - - if (!array_key_exists($var, $properties[$class])) { - $properties[$class][$var] = null; - } - - return $properties[$class][$var]; - } -} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2019-04-18 15:37:24
|
Revision: 10104 http://sourceforge.net/p/phpwiki/code/10104 Author: vargenau Date: 2019-04-18 15:37:23 +0000 (Thu, 18 Apr 2019) Log Message: ----------- Use full path lib/pear/ for require_once in case we cannot update include path (merci Free!) Modified Paths: -------------- trunk/lib/pear/Cache/Application.php trunk/lib/pear/Cache/Cache.php trunk/lib/pear/Cache/Container/db.php trunk/lib/pear/Cache/Container/dbx.php trunk/lib/pear/Cache/Container/file.php trunk/lib/pear/Cache/Container/imgfile.php trunk/lib/pear/Cache/Container/mdb.php trunk/lib/pear/Cache/Container/msession.php trunk/lib/pear/Cache/Container/phplib.php trunk/lib/pear/Cache/Container/shm.php trunk/lib/pear/Cache/Container/trifile.php trunk/lib/pear/Cache/Container.php trunk/lib/pear/Cache/Error.php trunk/lib/pear/Cache/Function.php trunk/lib/pear/Cache/Graphics.php trunk/lib/pear/Cache/HTTP_Request.php trunk/lib/pear/Cache/Output.php trunk/lib/pear/Cache/OutputCompression.php trunk/lib/pear/Cache.php trunk/lib/pear/DB/common.php trunk/lib/pear/DB/dbase.php trunk/lib/pear/DB/fbsql.php trunk/lib/pear/DB/ibase.php trunk/lib/pear/DB/ifx.php trunk/lib/pear/DB/msql.php trunk/lib/pear/DB/mssql.php trunk/lib/pear/DB/mysql.php trunk/lib/pear/DB/mysqli.php trunk/lib/pear/DB/oci8.php trunk/lib/pear/DB/odbc.php trunk/lib/pear/DB/pgsql.php trunk/lib/pear/DB/sqlite.php trunk/lib/pear/DB/storage.php trunk/lib/pear/DB/sybase.php trunk/lib/pear/DB.php trunk/lib/pear/File_Passwd.php Modified: trunk/lib/pear/Cache/Application.php =================================================================== --- trunk/lib/pear/Cache/Application.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/Cache/Application.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -18,7 +18,7 @@ // // $Id: Application.php 178289 2005-01-26 09:47:28Z dufuz $ -require_once 'Cache.php'; +require_once 'lib/pear/Cache.php'; // Application level variables // Modified: trunk/lib/pear/Cache/Cache.php =================================================================== --- trunk/lib/pear/Cache/Cache.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/Cache/Cache.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -18,8 +18,8 @@ // // $Id: Cache.php 267047 2008-10-07 08:58:46Z dufuz $ -require_once 'PEAR.php'; -require_once 'Cache/Error.php'; +require_once 'lib/pear/PEAR.php'; +require_once 'lib/pear/Cache/Error.php'; /** * Cache is a base class for cache implementations. Modified: trunk/lib/pear/Cache/Container/db.php =================================================================== --- trunk/lib/pear/Cache/Container/db.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/Cache/Container/db.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -19,8 +19,8 @@ // // $Id: db.php 178288 2005-01-26 09:42:30Z dufuz $ -require_once 'DB.php'; -require_once 'Cache/Container.php'; +require_once 'lib/pear/DB.php'; +require_once 'lib/pear/Cache/Container.php'; /** * PEAR/DB Cache Container. Modified: trunk/lib/pear/Cache/Container/dbx.php =================================================================== --- trunk/lib/pear/Cache/Container/dbx.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/Cache/Container/dbx.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -18,7 +18,7 @@ // $Id: dbx.php 268860 2008-11-12 14:56:26Z clockwerx $ -require_once 'Cache/Container.php'; +require_once 'lib/pear/Cache/Container.php'; /** * ext/dbx Cache Container. Modified: trunk/lib/pear/Cache/Container/file.php =================================================================== --- trunk/lib/pear/Cache/Container/file.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/Cache/Container/file.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -18,7 +18,7 @@ // // $Id: file.php 293864 2010-01-23 03:49:21Z clockwerx $ -require_once 'Cache/Container.php'; +require_once 'lib/pear/Cache/Container.php'; /** * Stores cache contents in a file. Modified: trunk/lib/pear/Cache/Container/imgfile.php =================================================================== --- trunk/lib/pear/Cache/Container/imgfile.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/Cache/Container/imgfile.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -16,7 +16,7 @@ // | Sebastian Bergmann <sb...@se...> | // +----------------------------------------------------------------------+ -require_once 'Cache/Container.php'; +require_once 'lib/pear/Cache/Container.php'; /** * Stores cache contents in a file. Modified: trunk/lib/pear/Cache/Container/mdb.php =================================================================== --- trunk/lib/pear/Cache/Container/mdb.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/Cache/Container/mdb.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -20,8 +20,8 @@ // // $Id: mdb.php 174777 2004-12-15 09:09:33Z dufuz $ -require_once 'MDB.php'; -require_once 'Cache/Container.php'; +require_once 'lib/pear/MDB.php'; +require_once 'lib/pear/Cache/Container.php'; /** * PEAR/MDB Cache Container. Modified: trunk/lib/pear/Cache/Container/msession.php =================================================================== --- trunk/lib/pear/Cache/Container/msession.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/Cache/Container/msession.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -17,7 +17,7 @@ // // $Id: msession.php 178289 2005-01-26 09:47:28Z dufuz $ -require_once 'Cache/Container.php'; +require_once 'lib/pear/Cache/Container.php'; /** * Stores cache contents in msessions. Modified: trunk/lib/pear/Cache/Container/phplib.php =================================================================== --- trunk/lib/pear/Cache/Container/phplib.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/Cache/Container/phplib.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -18,7 +18,7 @@ // // $Id: phplib.php 174777 2004-12-15 09:09:33Z dufuz $ -require_once 'Cache/Container.php'; +require_once 'lib/pear/Cache/Container.php'; /** * Stores cache data into a database table using PHPLibs DB abstraction. Modified: trunk/lib/pear/Cache/Container/shm.php =================================================================== --- trunk/lib/pear/Cache/Container/shm.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/Cache/Container/shm.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -18,7 +18,7 @@ // // $Id: shm.php 186977 2005-05-25 10:00:41Z dufuz $ -require_once 'Cache/Container.php'; +require_once 'lib/pear/Cache/Container.php'; /** * Stores cache data into shared memory. Modified: trunk/lib/pear/Cache/Container/trifile.php =================================================================== --- trunk/lib/pear/Cache/Container/trifile.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/Cache/Container/trifile.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -19,7 +19,7 @@ // // $Id: trifile.php 184642 2005-04-18 19:05:01Z dufuz $ -require_once 'Cache/Container/file.php'; +require_once 'lib/pear/Cache/Container/file.php'; /** * Tri-file cache. Modified: trunk/lib/pear/Cache/Container.php =================================================================== --- trunk/lib/pear/Cache/Container.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/Cache/Container.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -19,7 +19,7 @@ // // $Id: Container.php 293863 2010-01-23 03:46:52Z clockwerx $ -require_once 'Cache/Error.php'; +require_once 'lib/pear/Cache/Error.php'; /** * Common base class of all cache storage container. Modified: trunk/lib/pear/Cache/Error.php =================================================================== --- trunk/lib/pear/Cache/Error.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/Cache/Error.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -17,7 +17,7 @@ // // $Id: Error.php 174777 2004-12-15 09:09:33Z dufuz $ -require_once 'PEAR.php'; +require_once 'lib/pear/PEAR.php'; /** * Cache Error class Modified: trunk/lib/pear/Cache/Function.php =================================================================== --- trunk/lib/pear/Cache/Function.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/Cache/Function.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -17,7 +17,7 @@ // // $Id: Function.php 174777 2004-12-15 09:09:33Z dufuz $ -require_once 'Cache.php'; +require_once 'lib/pear/Cache.php'; /** * Function_Cache Modified: trunk/lib/pear/Cache/Graphics.php =================================================================== --- trunk/lib/pear/Cache/Graphics.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/Cache/Graphics.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -17,7 +17,7 @@ // // $Id: Graphics.php 178289 2005-01-26 09:47:28Z dufuz $ -require_once 'Cache.php'; +require_once 'lib/pear/Cache.php'; /** * Graphics disk cache. Modified: trunk/lib/pear/Cache/HTTP_Request.php =================================================================== --- trunk/lib/pear/Cache/HTTP_Request.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/Cache/HTTP_Request.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -17,8 +17,8 @@ // // $Id: HTTP_Request.php 174777 2004-12-15 09:09:33Z dufuz $ -require_once 'Cache.php'; -require_once 'HTTP/Request.php'; +require_once 'lib/pear/Cache.php'; +require_once 'lib/pear/HTTP/Request.php'; define('CACHE_HTTP_REQUEST_GROUP_NAME', 'cache_http_request'); define('CACHE_HTTP_REQUEST_SUCCESS_RESPONSE_CODE', 200); Modified: trunk/lib/pear/Cache/Output.php =================================================================== --- trunk/lib/pear/Cache/Output.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/Cache/Output.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -19,7 +19,7 @@ // // $Id: Output.php 178289 2005-01-26 09:47:28Z dufuz $ -require_once 'Cache.php'; +require_once 'lib/pear/Cache.php'; /** * Class to cache the output of a script using the output buffering functions Modified: trunk/lib/pear/Cache/OutputCompression.php =================================================================== --- trunk/lib/pear/Cache/OutputCompression.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/Cache/OutputCompression.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -16,7 +16,7 @@ // | Christian Stocker <ch...@ph...> | // +----------------------------------------------------------------------+ -require_once 'Cache/Output.php'; +require_once 'lib/pear/Cache/Output.php'; /** * Cache using Output Buffering and contnet (gz) compression. Modified: trunk/lib/pear/Cache.php =================================================================== --- trunk/lib/pear/Cache.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/Cache.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -17,8 +17,8 @@ // +----------------------------------------------------------------------+ // -require_once 'PEAR.php'; -require_once 'Cache/Error.php'; +require_once 'lib/pear/PEAR.php'; +require_once 'lib/pear/Cache/Error.php'; /** * Cache is a base class for cache implementations. Modified: trunk/lib/pear/DB/common.php =================================================================== --- trunk/lib/pear/DB/common.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/DB/common.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -27,7 +27,7 @@ /** * Obtain the PEAR class so it can be extended from */ -require_once 'PEAR.php'; +require_once 'lib/pear/PEAR.php'; /** * DB_common is the base class from which each database driver class extends Modified: trunk/lib/pear/DB/dbase.php =================================================================== --- trunk/lib/pear/DB/dbase.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/DB/dbase.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -27,7 +27,7 @@ /** * Obtain the DB_common class so it can be extended from */ -require_once 'DB/common.php'; +require_once 'lib/pear/DB/common.php'; /** * The methods PEAR DB uses to interact with PHP's dbase extension Modified: trunk/lib/pear/DB/fbsql.php =================================================================== --- trunk/lib/pear/DB/fbsql.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/DB/fbsql.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -27,7 +27,7 @@ /** * Obtain the DB_common class so it can be extended from */ -require_once 'DB/common.php'; +require_once 'lib/pear/DB/common.php'; /** * The methods PEAR DB uses to interact with PHP's fbsql extension Modified: trunk/lib/pear/DB/ibase.php =================================================================== --- trunk/lib/pear/DB/ibase.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/DB/ibase.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -30,7 +30,7 @@ /** * Obtain the DB_common class so it can be extended from */ -require_once 'DB/common.php'; +require_once 'lib/pear/DB/common.php'; /** * The methods PEAR DB uses to interact with PHP's interbase extension Modified: trunk/lib/pear/DB/ifx.php =================================================================== --- trunk/lib/pear/DB/ifx.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/DB/ifx.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -27,7 +27,7 @@ /** * Obtain the DB_common class so it can be extended from */ -require_once 'DB/common.php'; +require_once 'lib/pear/DB/common.php'; /** * The methods PEAR DB uses to interact with PHP's ifx extension Modified: trunk/lib/pear/DB/msql.php =================================================================== --- trunk/lib/pear/DB/msql.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/DB/msql.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -30,7 +30,7 @@ /** * Obtain the DB_common class so it can be extended from */ -require_once 'DB/common.php'; +require_once 'lib/pear/DB/common.php'; /** * The methods PEAR DB uses to interact with PHP's msql extension Modified: trunk/lib/pear/DB/mssql.php =================================================================== --- trunk/lib/pear/DB/mssql.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/DB/mssql.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -27,7 +27,7 @@ /** * Obtain the DB_common class so it can be extended from */ -require_once 'DB/common.php'; +require_once 'lib/pear/DB/common.php'; /** * The methods PEAR DB uses to interact with PHP's mssql extension Modified: trunk/lib/pear/DB/mysql.php =================================================================== --- trunk/lib/pear/DB/mysql.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/DB/mysql.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -27,7 +27,7 @@ /** * Obtain the DB_common class so it can be extended from */ -require_once 'DB/common.php'; +require_once 'lib/pear/DB/common.php'; /** * The methods PEAR DB uses to interact with PHP's mysql extension Modified: trunk/lib/pear/DB/mysqli.php =================================================================== --- trunk/lib/pear/DB/mysqli.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/DB/mysqli.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -26,7 +26,7 @@ /** * Obtain the DB_common class so it can be extended from */ -require_once 'DB/common.php'; +require_once 'lib/pear/DB/common.php'; /** * The methods PEAR DB uses to interact with PHP's mysqli extension Modified: trunk/lib/pear/DB/oci8.php =================================================================== --- trunk/lib/pear/DB/oci8.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/DB/oci8.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -27,7 +27,7 @@ /** * Obtain the DB_common class so it can be extended from */ -require_once 'DB/common.php'; +require_once 'lib/pear/DB/common.php'; /** * The methods PEAR DB uses to interact with PHP's oci8 extension Modified: trunk/lib/pear/DB/odbc.php =================================================================== --- trunk/lib/pear/DB/odbc.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/DB/odbc.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -27,7 +27,7 @@ /** * Obtain the DB_common class so it can be extended from */ -require_once 'DB/common.php'; +require_once 'lib/pear/DB/common.php'; /** * The methods PEAR DB uses to interact with PHP's odbc extension Modified: trunk/lib/pear/DB/pgsql.php =================================================================== --- trunk/lib/pear/DB/pgsql.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/DB/pgsql.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -28,7 +28,7 @@ /** * Obtain the DB_common class so it can be extended from */ -require_once 'DB/common.php'; +require_once 'lib/pear/DB/common.php'; /** * The methods PEAR DB uses to interact with PHP's pgsql extension Modified: trunk/lib/pear/DB/sqlite.php =================================================================== --- trunk/lib/pear/DB/sqlite.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/DB/sqlite.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -28,7 +28,7 @@ /** * Obtain the DB_common class so it can be extended from */ -require_once 'DB/common.php'; +require_once 'lib/pear/DB/common.php'; /** * The methods PEAR DB uses to interact with PHP's sqlite extension Modified: trunk/lib/pear/DB/storage.php =================================================================== --- trunk/lib/pear/DB/storage.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/DB/storage.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -25,7 +25,7 @@ /** * Obtain the DB class so it can be extended from */ -require_once 'DB.php'; +require_once 'lib/pear/DB.php'; /** * Provides an object interface to a table row Modified: trunk/lib/pear/DB/sybase.php =================================================================== --- trunk/lib/pear/DB/sybase.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/DB/sybase.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -28,7 +28,7 @@ /** * Obtain the DB_common class so it can be extended from */ -require_once 'DB/common.php'; +require_once 'lib/pear/DB/common.php'; /** * The methods PEAR DB uses to interact with PHP's sybase extension Modified: trunk/lib/pear/DB.php =================================================================== --- trunk/lib/pear/DB.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/DB.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -27,7 +27,7 @@ /** * Obtain the PEAR class so it can be extended from */ -require_once 'PEAR.php'; +require_once 'lib/pear/PEAR.php'; // {{{ constants Modified: trunk/lib/pear/File_Passwd.php =================================================================== --- trunk/lib/pear/File_Passwd.php 2019-04-18 14:38:56 UTC (rev 10103) +++ trunk/lib/pear/File_Passwd.php 2019-04-18 15:37:23 UTC (rev 10104) @@ -18,7 +18,7 @@ // // Manipulate standard UNIX passwd,.htpasswd and CVS pserver passwd files -require_once 'PEAR.php'; +require_once 'lib/pear/PEAR.php'; /** * Class to manage passwd-style files This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2020-04-21 10:48:16
|
Revision: 10168 http://sourceforge.net/p/phpwiki/code/10168 Author: vargenau Date: 2020-04-21 10:48:14 +0000 (Tue, 21 Apr 2020) Log Message: ----------- Upgrade PEAR DB to release 1.10.0 Modified Paths: -------------- trunk/lib/pear/DB/common.php trunk/lib/pear/DB/dbase.php trunk/lib/pear/DB/fbsql.php trunk/lib/pear/DB/ibase.php trunk/lib/pear/DB/ifx.php trunk/lib/pear/DB/msql.php trunk/lib/pear/DB/mssql.php trunk/lib/pear/DB/mysql.php trunk/lib/pear/DB/mysqli.php trunk/lib/pear/DB/oci8.php trunk/lib/pear/DB/odbc.php trunk/lib/pear/DB/pgsql.php trunk/lib/pear/DB/sqlite.php trunk/lib/pear/DB/storage.php trunk/lib/pear/DB/sybase.php trunk/lib/pear/DB.php Modified: trunk/lib/pear/DB/common.php =================================================================== --- trunk/lib/pear/DB/common.php 2020-03-29 20:43:54 UTC (rev 10167) +++ trunk/lib/pear/DB/common.php 2020-04-21 10:48:14 UTC (rev 10168) @@ -42,7 +42,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.9.3 + * @version Release: 1.10.0 * @link http://pear.php.net/package/DB */ class DB_common extends PEAR @@ -262,7 +262,7 @@ function quoteString($string) { $string = $this->quoteSmart($string); - if ($string{0} == "'") { + if ($string[0] == "'") { return substr($string, 1, -1); } return $string; @@ -885,6 +885,9 @@ function autoExecute($table, $fields_values, $mode = DB_AUTOQUERY_INSERT, $where = false) { + if ($where) { + $where = strtr($where, array('?' => '\?', '!' => '\!', '&' => '\&',)); + } $sth = $this->autoPrepare($table, array_keys($fields_values), $mode, $where); if (DB::isError($sth)) { Modified: trunk/lib/pear/DB/dbase.php =================================================================== --- trunk/lib/pear/DB/dbase.php 2020-03-29 20:43:54 UTC (rev 10167) +++ trunk/lib/pear/DB/dbase.php 2020-04-21 10:48:14 UTC (rev 10168) @@ -41,7 +41,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.9.3 + * @version Release: 1.10.0 * @link http://pear.php.net/package/DB */ class DB_dbase extends DB_common Modified: trunk/lib/pear/DB/fbsql.php =================================================================== --- trunk/lib/pear/DB/fbsql.php 2020-03-29 20:43:54 UTC (rev 10167) +++ trunk/lib/pear/DB/fbsql.php 2020-04-21 10:48:14 UTC (rev 10168) @@ -41,7 +41,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.9.3 + * @version Release: 1.10.0 * @link http://pear.php.net/package/DB * @since Class functional since Release 1.7.0 */ Modified: trunk/lib/pear/DB/ibase.php =================================================================== --- trunk/lib/pear/DB/ibase.php 2020-03-29 20:43:54 UTC (rev 10167) +++ trunk/lib/pear/DB/ibase.php 2020-04-21 10:48:14 UTC (rev 10168) @@ -49,7 +49,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.9.3 + * @version Release: 1.10.0 * @link http://pear.php.net/package/DB * @since Class became stable in Release 1.7.0 */ Modified: trunk/lib/pear/DB/ifx.php =================================================================== --- trunk/lib/pear/DB/ifx.php 2020-03-29 20:43:54 UTC (rev 10167) +++ trunk/lib/pear/DB/ifx.php 2020-04-21 10:48:14 UTC (rev 10168) @@ -48,7 +48,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.9.3 + * @version Release: 1.10.0 * @link http://pear.php.net/package/DB */ class DB_ifx extends DB_common Modified: trunk/lib/pear/DB/msql.php =================================================================== --- trunk/lib/pear/DB/msql.php 2020-03-29 20:43:54 UTC (rev 10167) +++ trunk/lib/pear/DB/msql.php 2020-04-21 10:48:14 UTC (rev 10168) @@ -47,7 +47,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.9.3 + * @version Release: 1.10.0 * @link http://pear.php.net/package/DB * @since Class not functional until Release 1.7.0 */ Modified: trunk/lib/pear/DB/mssql.php =================================================================== --- trunk/lib/pear/DB/mssql.php 2020-03-29 20:43:54 UTC (rev 10167) +++ trunk/lib/pear/DB/mssql.php 2020-04-21 10:48:14 UTC (rev 10168) @@ -49,7 +49,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.9.3 + * @version Release: 1.10.0 * @link http://pear.php.net/package/DB */ class DB_mssql extends DB_common Modified: trunk/lib/pear/DB/mysql.php =================================================================== --- trunk/lib/pear/DB/mysql.php 2020-03-29 20:43:54 UTC (rev 10167) +++ trunk/lib/pear/DB/mysql.php 2020-04-21 10:48:14 UTC (rev 10168) @@ -41,7 +41,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.9.3 + * @version Release: 1.10.0 * @link http://pear.php.net/package/DB */ class DB_mysql extends DB_common Modified: trunk/lib/pear/DB/mysqli.php =================================================================== --- trunk/lib/pear/DB/mysqli.php 2020-03-29 20:43:54 UTC (rev 10167) +++ trunk/lib/pear/DB/mysqli.php 2020-04-21 10:48:14 UTC (rev 10168) @@ -43,7 +43,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.9.3 + * @version Release: 1.10.0 * @link http://pear.php.net/package/DB * @since Class functional since Release 1.6.3 */ Modified: trunk/lib/pear/DB/oci8.php =================================================================== --- trunk/lib/pear/DB/oci8.php 2020-03-29 20:43:54 UTC (rev 10167) +++ trunk/lib/pear/DB/oci8.php 2020-04-21 10:48:14 UTC (rev 10168) @@ -47,7 +47,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.9.3 + * @version Release: 1.10.0 * @link http://pear.php.net/package/DB */ class DB_oci8 extends DB_common @@ -446,9 +446,6 @@ if (!is_resource($stmt)) { return false; } - if ($free_resource) { - @ocifreestatement($stmt); - } if (isset($this->prepare_types[(int)$stmt])) { unset($this->prepare_types[(int)$stmt]); unset($this->manip_query[(int)$stmt]); Modified: trunk/lib/pear/DB/odbc.php =================================================================== --- trunk/lib/pear/DB/odbc.php 2020-03-29 20:43:54 UTC (rev 10167) +++ trunk/lib/pear/DB/odbc.php 2020-04-21 10:48:14 UTC (rev 10168) @@ -44,7 +44,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.9.3 + * @version Release: 1.10.0 * @link http://pear.php.net/package/DB */ class DB_odbc extends DB_common Modified: trunk/lib/pear/DB/pgsql.php =================================================================== --- trunk/lib/pear/DB/pgsql.php 2020-03-29 20:43:54 UTC (rev 10167) +++ trunk/lib/pear/DB/pgsql.php 2020-04-21 10:48:14 UTC (rev 10168) @@ -43,7 +43,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.9.3 + * @version Release: 1.10.0 * @link http://pear.php.net/package/DB */ class DB_pgsql extends DB_common Modified: trunk/lib/pear/DB/sqlite.php =================================================================== --- trunk/lib/pear/DB/sqlite.php 2020-03-29 20:43:54 UTC (rev 10167) +++ trunk/lib/pear/DB/sqlite.php 2020-04-21 10:48:14 UTC (rev 10168) @@ -47,7 +47,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 3.0 - * @version Release: 1.9.3 + * @version Release: 1.10.0 * @link http://pear.php.net/package/DB */ class DB_sqlite extends DB_common Modified: trunk/lib/pear/DB/storage.php =================================================================== --- trunk/lib/pear/DB/storage.php 2020-03-29 20:43:54 UTC (rev 10167) +++ trunk/lib/pear/DB/storage.php 2020-04-21 10:48:14 UTC (rev 10168) @@ -38,7 +38,7 @@ * @author Stig Bakken <st...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.9.3 + * @version Release: 1.10.0 * @link http://pear.php.net/package/DB */ class DB_storage extends PEAR Modified: trunk/lib/pear/DB/sybase.php =================================================================== --- trunk/lib/pear/DB/sybase.php 2020-03-29 20:43:54 UTC (rev 10167) +++ trunk/lib/pear/DB/sybase.php 2020-04-21 10:48:14 UTC (rev 10168) @@ -46,7 +46,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.9.3 + * @version Release: 1.10.0 * @link http://pear.php.net/package/DB */ class DB_sybase extends DB_common Modified: trunk/lib/pear/DB.php =================================================================== --- trunk/lib/pear/DB.php 2020-03-29 20:43:54 UTC (rev 10167) +++ trunk/lib/pear/DB.php 2020-04-21 10:48:14 UTC (rev 10168) @@ -180,9 +180,18 @@ * Tried to insert a null value into a column that doesn't allow nulls */ define('DB_ERROR_CONSTRAINT_NOT_NULL',-29); + +/** + * Database lock timeout exceeded. + */ +define('DB_ERROR_LOCK_TIMEOUT', -30); + +/** + * Database deadlock encountered. + */ +define('DB_ERROR_DEADLOCK', -31); /**#@-*/ - // }}} // {{{ prepared statement-related @@ -426,7 +435,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.9.3 + * @version Release: 1.10.0 * @link http://pear.php.net/package/DB */ class DB @@ -577,7 +586,7 @@ */ function apiVersion() { - return '1.9.3'; + return '1.10.0'; } // }}} @@ -683,6 +692,8 @@ DB_ERROR_TRUNCATED => 'truncated', DB_ERROR_VALUE_COUNT_ON_ROW => 'value count on row', DB_OK => 'no error', + DB_ERROR_DEADLOCK => 'deadlock', + DB_ERROR_LOCK_TIMEOUT => 'database lock timeout', ); } @@ -941,7 +952,7 @@ * @author Stig Bakken <ss...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.9.3 + * @version Release: 1.10.0 * @link http://pear.php.net/package/DB */ class DB_Error extends PEAR_Error @@ -1002,7 +1013,7 @@ * @author Stig Bakken <ss...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.9.3 + * @version Release: 1.10.0 * @link http://pear.php.net/package/DB */ class DB_result @@ -1467,7 +1478,7 @@ * @author Stig Bakken <ss...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.9.3 + * @version Release: 1.10.0 * @link http://pear.php.net/package/DB * @see DB_common::setFetchMode() */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2025-02-09 18:37:41
|
Revision: 11085 http://sourceforge.net/p/phpwiki/code/11085 Author: vargenau Date: 2025-02-09 18:37:38 +0000 (Sun, 09 Feb 2025) Log Message: ----------- Upgrade PEAR Modified Paths: -------------- trunk/lib/pear/Cache/Application.php trunk/lib/pear/Cache/Cache.php trunk/lib/pear/Cache/Container/db.php trunk/lib/pear/Cache/Container/dbx.php trunk/lib/pear/Cache/Container/file.php trunk/lib/pear/Cache/Container/imgfile.php trunk/lib/pear/Cache/Container/mdb.php trunk/lib/pear/Cache/Container/msession.php trunk/lib/pear/Cache/Container/phplib.php trunk/lib/pear/Cache/Container/shm.php trunk/lib/pear/Cache/Container/trifile.php trunk/lib/pear/Cache/Container.php trunk/lib/pear/Cache/Error.php trunk/lib/pear/Cache/Function.php trunk/lib/pear/Cache/Graphics.php trunk/lib/pear/Cache/HTTP_Request.php trunk/lib/pear/Cache/Output.php trunk/lib/pear/Cache/OutputCompression.php trunk/lib/pear/Cache.php trunk/lib/pear/DB/common.php trunk/lib/pear/DB/dbase.php trunk/lib/pear/DB/fbsql.php trunk/lib/pear/DB/ibase.php trunk/lib/pear/DB/ifx.php trunk/lib/pear/DB/msql.php trunk/lib/pear/DB/mssql.php trunk/lib/pear/DB/mysql.php trunk/lib/pear/DB/mysqli.php trunk/lib/pear/DB/oci8.php trunk/lib/pear/DB/odbc.php trunk/lib/pear/DB/pgsql.php trunk/lib/pear/DB/sqlite.php trunk/lib/pear/DB/sqlite3.php trunk/lib/pear/DB/storage.php trunk/lib/pear/DB/sybase.php trunk/lib/pear/DB.php trunk/lib/pear/JSON.php trunk/lib/pear/PEAR.php Modified: trunk/lib/pear/Cache/Application.php =================================================================== --- trunk/lib/pear/Cache/Application.php 2024-04-16 08:11:34 UTC (rev 11084) +++ trunk/lib/pear/Cache/Application.php 2025-02-09 18:37:38 UTC (rev 11085) @@ -15,8 +15,6 @@ // +----------------------------------------------------------------------+ // | Authors: Richard Heyes <ri...@ph...> | // +----------------------------------------------------------------------+ -// -// $Id: Application.php 178289 2005-01-26 09:47:28Z dufuz $ require_once 'lib/pear/Cache.php'; @@ -23,7 +21,7 @@ // Application level variables // // Purpose -// Variables that are persisent across all user sessions, +// Variables that are persistent across all user sessions, // not just a specific user ala normal sessions. // // Usage: @@ -78,8 +76,8 @@ var $registered_vars; /** - * @param string Name of container class - * @param array Array with container class options + * @param string $container Name of container class + * @param array $container_options Array with container class options */ function __construct($container = 'file', $container_options = array('cache_dir' => '/tmp/', 'filename_prefix' => 'cache_'), $id = 'application_var', $group = 'application_cache') { @@ -124,8 +122,8 @@ * * Registers a variable to be stored. * - * @param string Name of variable to register - * @param mixed Optional data to store + * @param string $varname Name of variable to register + * @param mixed $data Optional data to store */ function register($varname, $data = null) { @@ -141,7 +139,7 @@ * * Unregisters a variable from being stored. * - * @param string Name of variable to unregister + * @param string $varname Name of variable to unregister */ function unregister($varname) { Modified: trunk/lib/pear/Cache/Cache.php =================================================================== --- trunk/lib/pear/Cache/Cache.php 2024-04-16 08:11:34 UTC (rev 11084) +++ trunk/lib/pear/Cache/Cache.php 2025-02-09 18:37:38 UTC (rev 11085) @@ -15,8 +15,6 @@ // | Authors: Ulf Wendel <ulf...@ph...> | // | Sebastian Bergmann <sb...@se...> | // +----------------------------------------------------------------------+ -// -// $Id: Cache.php 267047 2008-10-07 08:58:46Z dufuz $ require_once 'lib/pear/PEAR.php'; require_once 'lib/pear/Cache/Error.php'; @@ -28,7 +26,7 @@ * cache script runs. The idea behind the cache is quite simple. If you have * the same input parameters for whatever tasks/algorithm you use you'll * usually get the same output. So why not caching templates, functions calls, -* graphic generation etc. Caching certain actions e.g. XSLT tranformations +* graphic generation etc. Caching certain actions e.g. XSLT transformations * saves you lots of time. * * The design of the cache reminds of PHPLibs session implementation. A @@ -59,7 +57,6 @@ * bad circumstances (especially with the file container) * * @author Ulf Wendel <ulf...@ph...> -* @version $Id: Cache.php 267047 2008-10-07 08:58:46Z dufuz $ * @package Cache * @access public */ @@ -123,8 +120,8 @@ /** * - * @param string Name of container class - * @param array Array with container class options + * @param string $container Name of container class + * @param array $container_options Array with container class options */ function __construct($container, $container_options = '') { @@ -157,7 +154,7 @@ /** * Enables or disables caching. * - * @param boolean The new caching state. + * @param boolean $state The new caching state. * @access public */ function setCaching($state) @@ -168,8 +165,8 @@ /** * Returns the requested dataset it if exists and is not expired * - * @param string dataset ID - * @param string cache group + * @param string $id dataset ID + * @param string $group cache group * @return mixed cached data or null on failure * @access public */ @@ -188,10 +185,10 @@ /** * Stores the given data in the cache. * - * @param string dataset ID used as cache identifier - * @param mixed data to cache - * @param integer lifetime of the cached data in seconds - 0 for endless - * @param string cache group + * @param string $id dataset ID used as cache identifier + * @param mixed $data data to cache + * @param integer $expires lifetime of the cached data in seconds - 0 for endless + * @param string $group cache group * @return boolean * @access public */ @@ -206,11 +203,11 @@ /** * Stores a dataset with additional userdefined data. * - * @param string dataset ID - * @param mixed data to store - * @param string additional userdefined data - * @param mixed userdefined expire date - * @param string cache group + * @param string $id dataset ID + * @param mixed $cachedata data to store + * @param string $userdata additional userdefined data + * @param mixed $expires userdefined expire date + * @param string $group cache group * @return boolean * @throws Cache_Error * @access public @@ -227,8 +224,8 @@ /** * Loads the given ID from the cache. * - * @param string dataset ID - * @param string cache group + * @param string $id dataset ID + * @param string $group cache group * @return mixed cached data or null on failure * @access public */ @@ -243,8 +240,8 @@ /** * Returns the userdata field of a cached data set. * - * @param string dataset ID - * @param string cache group + * @param string $id dataset ID + * @param string $group cache group * @return string userdata * @access public * @see extSave() @@ -260,8 +257,8 @@ /** * Removes the specified dataset from the cache. * - * @param string dataset ID - * @param string cache group + * @param string $id dataset ID + * @param string $group cache group * @return boolean * @access public */ @@ -276,7 +273,7 @@ /** * Flushes the cache - removes all data from it * - * @param string cache group, if empty all groups will be flashed + * @param string $group cache group, if empty all groups will be flashed * @return integer number of removed datasets */ function flush($group = 'default') @@ -292,8 +289,8 @@ * * Note: this does not say that the cached data is not expired! * - * @param string dataset ID - * @param string cache group + * @param string $id dataset ID + * @param string $group cache group * @return boolean * @access public */ @@ -308,9 +305,9 @@ /** * Checks if a dataset is expired * - * @param string dataset ID - * @param string cache group - * @param integer maximum age for the cached data in seconds - 0 for endless + * @param string $id dataset ID + * @param string $group cache group + * @param integer $max_age maximum age for the cached data in seconds - 0 for endless * If the cached data is older but the given lifetime it will * be removed from the cache. You don't have to provide this * argument if you call isExpired(). Every dataset knows @@ -333,7 +330,7 @@ * This is a quick but dirty hack to get a "unique" ID for a any kind of variable. * ID clashes might occur from time to time although they are extreme unlikely! * - * @param mixed variable to generate a ID for + * @param mixed $variable variable to generate a ID for * @return string "unique" ID * @access public */ @@ -346,7 +343,7 @@ /** * Calls the garbage collector of the storage object with a certain probability * - * @param boolean Force a garbage collection run? + * @param boolean $force Force a garbage collection run? * @see $gc_probability, $gc_time */ function garbageCollection($force = false) Modified: trunk/lib/pear/Cache/Container/db.php =================================================================== --- trunk/lib/pear/Cache/Container/db.php 2024-04-16 08:11:34 UTC (rev 11084) +++ trunk/lib/pear/Cache/Container/db.php 2025-02-09 18:37:38 UTC (rev 11085) @@ -16,8 +16,6 @@ // | Sebastian Bergmann <sb...@se...> | // | Chuck Hagenbuch <ch...@ho...> | // +----------------------------------------------------------------------+ -// -// $Id: db.php 178288 2005-01-26 09:42:30Z dufuz $ require_once 'lib/pear/DB.php'; require_once 'lib/pear/Cache/Container.php'; @@ -29,7 +27,7 @@ * the tables shown. As far as I know there's no large binary * type in SQL-92 or SQL-99. Postgres seems to lack any * BLOB or TEXT type, for MS-SQL you could use IMAGE, don't know -* about other databases. Please add sugestions for other databases to +* about other databases. Please add suggestions for other databases to * the inline docs. * * The field 'changed' has no meaning for the Cache itself. It's just there @@ -52,7 +50,6 @@ * ) * * @author Sebastian Bergmann <sb...@se...> -* @version $Id: db.php 178288 2005-01-26 09:42:30Z dufuz $ * @package Cache */ class Cache_Container_db extends Cache_Container Modified: trunk/lib/pear/Cache/Container/dbx.php =================================================================== --- trunk/lib/pear/Cache/Container/dbx.php 2024-04-16 08:11:34 UTC (rev 11084) +++ trunk/lib/pear/Cache/Container/dbx.php 2025-02-09 18:37:38 UTC (rev 11085) @@ -14,10 +14,7 @@ // +----------------------------------------------------------------------+ // | Authors: Christian Stocker <ch...@ph...> | // +----------------------------------------------------------------------+ -// -// $Id: dbx.php 268860 2008-11-12 14:56:26Z clockwerx $ - require_once 'lib/pear/Cache/Container.php'; /** @@ -27,7 +24,7 @@ * the tables shown. As far as I know there's no large binary * type in SQL-92 or SQL-99. Postgres seems to lack any * BLOB or TEXT type, for MS-SQL you could use IMAGE, don't know -* about other databases. Please add sugestions for other databases to +* about other databases. Please add suggestions for other databases to * the inline docs. * * The field 'changed' has no meaning for the Cache itself. It's just there @@ -50,7 +47,6 @@ * ) * * @author Christian Stocker <ch...@ph...> -* @version $Id: dbx.php 268860 2008-11-12 14:56:26Z clockwerx $ * @package Cache */ class Cache_Container_dbx extends Cache_Container Modified: trunk/lib/pear/Cache/Container/file.php =================================================================== --- trunk/lib/pear/Cache/Container/file.php 2024-04-16 08:11:34 UTC (rev 11084) +++ trunk/lib/pear/Cache/Container/file.php 2025-02-09 18:37:38 UTC (rev 11085) @@ -15,8 +15,6 @@ // | Authors: Ulf Wendel <ulf...@ph...> | // | Sebastian Bergmann <sb...@se...> | // +----------------------------------------------------------------------+ -// -// $Id: file.php 293864 2010-01-23 03:49:21Z clockwerx $ require_once 'lib/pear/Cache/Container.php'; @@ -24,7 +22,6 @@ * Stores cache contents in a file. * * @author Ulf Wendel <ulf...@ph...> -* @version $Id: file.php 293864 2010-01-23 03:49:21Z clockwerx $ */ class Cache_Container_file extends Cache_Container { @@ -52,14 +49,14 @@ * Filename prefix for cache files. * * You can use the filename prefix to implement a "domain" based cache or just - * to give the files a more descriptive name. The word "domain" is borroed from - * a user authentification system. One user id (cached dataset with the ID x) - * may exists in different domains (different filename prefix). You might want + * to give the files a more descriptive name. The word "domain" is borrowed from + * a user authentication system. One user id (cached dataset with the ID x) + * may exist in different domains (different filename prefix). You might want * to use this to have different cache values for a production, development and * quality assurance system. If you want the production cache not to be influenced * by the quality assurance activities, use different filename prefixes for them. * - * I personally don't think that you'll never need this, but 640kb happend to be + * I personally don't think that you'll never need this, but 640kb happened to be * not enough, so... you know what I mean. If you find a useful application of the * feature please update this inline doc. * @@ -96,9 +93,9 @@ var $max_userdata_linelength = 257; /** - * Creates the cache directory if neccessary + * Creates the cache directory if necessary * - * @param array Config options: ["cache_dir" => ..., "filename_prefix" => ...] + * @param array $options Config options: ["cache_dir" => ..., "filename_prefix" => ...] */ function __construct($options = '') { @@ -122,7 +119,7 @@ $this->entries = array(); $this->group_dirs = array(); - } // end func contructor + } // end func constructor function fetch($id, $group) { @@ -134,7 +131,7 @@ if (!file_exists($file)) { return array(null, null, null); } - // retrive the content + // retrieve the content if (!($fh = @fopen($file, 'rb'))) { return new Cache_Error("Can't access cache file '$file'. Check access rights and path.", __FILE__, __LINE__); } @@ -255,11 +252,11 @@ * Garbage collection for files is a rather "expensive", "long time" * operation. All files in the cache directory have to be examined which * means that they must be opened for reading, the expiration date has to be - * read from them and if neccessary they have to be unlinked (removed). + * read from them and if necessary they have to be unlinked (removed). * If you have a user comment for a good default gc probability please add it to * to the inline docs. * - * @param integer Maximum lifetime in seconds of an no longer used/touched entry + * @param integer $maxlifetime Maximum lifetime in seconds of an no longer used/touched entry * @throws Cache_Error */ function garbageCollection($maxlifetime) @@ -295,8 +292,8 @@ /** * Does the recursive gc procedure, protected. * - * @param integer Maximum lifetime in seconds of an no longer used/touched entry - * @param string directory to examine - don't sets this parameter, it's used for a + * @param integer $maxlifetime Maximum lifetime in seconds of an no longer used/touched entry + * @param string $dir directory to examine - don't sets this parameter, it's used for a * recursive function call! * @throws Cache_Error */ @@ -345,8 +342,8 @@ /** * Returns the filename for the specified id. * - * @param string dataset ID - * @param string cache group + * @param string $id dataset ID + * @param string $group cache group * @return string full filename with the path * @access public */ @@ -373,7 +370,7 @@ /** * Deletes a directory and all files in it. * - * @param string directory + * @param string $dir directory * @return integer number of removed files * @throws Cache_Error */ Modified: trunk/lib/pear/Cache/Container/imgfile.php =================================================================== --- trunk/lib/pear/Cache/Container/imgfile.php 2024-04-16 08:11:34 UTC (rev 11084) +++ trunk/lib/pear/Cache/Container/imgfile.php 2025-02-09 18:37:38 UTC (rev 11085) @@ -22,7 +22,6 @@ * Stores cache contents in a file. * * @author Ulf Wendel <ulf...@ph...> -* @version */ class Cache_Container_file extends Cache_Container { @@ -69,7 +68,7 @@ /** * Creates the cache directory if neccessary * - * @param array Config options: ["cache_dir" => ..., "filename_prefix" => ...] + * @param array $options Config options: ["cache_dir" => ..., "filename_prefix" => ...] */ function __construct($options = '') { if (is_array($options)) @@ -219,7 +218,7 @@ * If you have a user comment for a good default gc probability please add it to * to the inline docs. * - * @param integer Maximum lifetime in seconds of an no longer used/touched entry + * @param integer $maxlifetime Maximum lifetime in seconds of an no longer used/touched entry * @throws Cache_Error */ function garbageCollection($maxlifetime) { @@ -253,8 +252,8 @@ /** * Does the recursive gc procedure, protected. * - * @param integer Maximum lifetime in seconds of an no longer used/touched entry - * @param string directory to examine - don't sets this parameter, it's used for a + * @param integer $maxlifetime Maximum lifetime in seconds of an no longer used/touched entry + * @param string $dir directory to examine - don't sets this parameter, it's used for a * recursive function call! * @throws Cache_Error */ @@ -315,8 +314,8 @@ /** * Returns the filename for the specified id. * - * @param string dataset ID - * @param string cache group + * @param string $id dataset ID + * @param string $group cache group * @return string full filename with the path * @access public */ @@ -339,7 +338,7 @@ /** * Deletes a directory and all files in it. * - * @param string directory + * @param string $dir directory * @return integer number of removed files * @throws Cache_Error */ Modified: trunk/lib/pear/Cache/Container/mdb.php =================================================================== --- trunk/lib/pear/Cache/Container/mdb.php 2024-04-16 08:11:34 UTC (rev 11084) +++ trunk/lib/pear/Cache/Container/mdb.php 2025-02-09 18:37:38 UTC (rev 11085) @@ -17,8 +17,6 @@ // +----------------------------------------------------------------------+ // | Author: Lorenzo Alberton <l.alberton at quipo.it> | // +----------------------------------------------------------------------+ -// -// $Id: mdb.php 174777 2004-12-15 09:09:33Z dufuz $ require_once 'lib/pear/MDB.php'; require_once 'lib/pear/Cache/Container.php'; @@ -61,7 +59,6 @@ * ------------------------------------------ * * @author Lorenzo Alberton <l.alberton at quipo.it> -* @version $Id: mdb.php 174777 2004-12-15 09:09:33Z dufuz $ * @package Cache */ class Cache_Container_mdb extends Cache_Container @@ -84,7 +81,7 @@ /** * Constructor * - * @param mixed Array with connection info or dsn string + * @param mixed $options Array with connection info or dsn string */ function __construct($options) { @@ -102,8 +99,8 @@ /** * Fetch in the db the data that matches input parameters * - * @param string dataset ID - * @param string cache group + * @param string $id dataset ID + * @param string $group cache group * @return mixed dataset value or null/Cache_Error on failure * @access public */ @@ -182,11 +179,11 @@ * If dataset_ID already exists, overwrite it with new data, * else insert data in a new record. * - * @param string dataset ID - * @param mixed data to be cached - * @param integer expiration time - * @param string cache group - * @param string userdata + * @param string $id dataset ID + * @param mixed $data data to be cached + * @param integer $expires expiration time + * @param string $group cache group + * @param string $userdata userdata * @access public */ function save($id, $data, $expires, $group, $userdata) @@ -256,8 +253,8 @@ /** * Removes a dataset from the database * - * @param string dataset ID - * @param string cache group + * @param string $id dataset ID + * @param string $group cache group */ function remove($id, $group) { @@ -278,7 +275,7 @@ * Remove all cached data for a certain group, or empty * the cache table if no group is specified. * - * @param string cache group + * @param string $group cache group */ function flush($group = '') { @@ -301,8 +298,8 @@ /** * Check if a dataset ID/group exists. * - * @param string dataset ID - * @param string cache group + * @param string $id dataset ID + * @param string $group cache group * @return boolean */ function idExists($id, $group) @@ -327,7 +324,7 @@ /** * Garbage collector. * - * @param int maxlifetime + * @param int $maxlifetime maxlifetime */ function garbageCollection($maxlifetime) { Modified: trunk/lib/pear/Cache/Container/msession.php =================================================================== --- trunk/lib/pear/Cache/Container/msession.php 2024-04-16 08:11:34 UTC (rev 11084) +++ trunk/lib/pear/Cache/Container/msession.php 2025-02-09 18:37:38 UTC (rev 11085) @@ -14,8 +14,6 @@ // +----------------------------------------------------------------------+ // | Authors: Ulf Wendel <ulf...@ph...> | // +----------------------------------------------------------------------+ -// -// $Id: msession.php 178289 2005-01-26 09:47:28Z dufuz $ require_once 'lib/pear/Cache/Container.php'; @@ -25,7 +23,6 @@ * WARNING: experimental, untested * * @author Ulf Wendel <ulf...@ph...> -* @version $Id: msession.php 178289 2005-01-26 09:47:28Z dufuz $ */ class Cache_Container_msession extends Cache_Container { @@ -199,7 +196,7 @@ * * Note: garbage collection should cause lot's of network traffic. * - * @param integer Maximum lifetime in seconds of an no longer used/touched entry + * @param integer $maxlifetime Maximum lifetime in seconds of an no longer used/touched entry * @throws Cache_Error */ function garbageCollection($maxlifetime) Modified: trunk/lib/pear/Cache/Container/phplib.php =================================================================== --- trunk/lib/pear/Cache/Container/phplib.php 2024-04-16 08:11:34 UTC (rev 11084) +++ trunk/lib/pear/Cache/Container/phplib.php 2025-02-09 18:37:38 UTC (rev 11085) @@ -15,8 +15,6 @@ // | Authors: Ulf Wendel <ulf...@ph...> | // | Sebastian Bergmann <sb...@se...> | // +----------------------------------------------------------------------+ -// -// $Id: phplib.php 174777 2004-12-15 09:09:33Z dufuz $ require_once 'lib/pear/Cache/Container.php'; @@ -27,7 +25,7 @@ * the tables shown. As far as I know there's no large binary * type in SQL-92 or SQL-99. Postgres seems to lack any * BLOB or TEXT type, for MS-SQL you could use IMAGE, don't know -* about other databases. Please add sugestions for other databases to +* about other databases. Please add suggestions for other databases to * the inline docs. * * The field 'changed' is used by the garbage collection. Depending on @@ -50,7 +48,6 @@ * * * @author Ulf Wendel <ulf...@ph...>, Sebastian Bergmann <sb...@se...> -* @version $Id: phplib.php 174777 2004-12-15 09:09:33Z dufuz $ * @package Cache * @see save() */ @@ -104,7 +101,7 @@ /** * Creates an instance of a phplib db class to use it for storage. * - * @param mixed If empty the object tries to used the + * @param mixed $options If empty the object tries to used the * preconfigured class variables. If given it * must be an array with: * db_class => name of the DB class to use Modified: trunk/lib/pear/Cache/Container/shm.php =================================================================== --- trunk/lib/pear/Cache/Container/shm.php 2024-04-16 08:11:34 UTC (rev 11084) +++ trunk/lib/pear/Cache/Container/shm.php 2025-02-09 18:37:38 UTC (rev 11085) @@ -15,8 +15,6 @@ // | Authors: Ulf Wendel <ulf...@ph...> | // | Sebastian Bergmann <sb...@se...> | // +----------------------------------------------------------------------+ -// -// $Id: shm.php 186977 2005-05-25 10:00:41Z dufuz $ require_once 'lib/pear/Cache/Container.php'; @@ -29,7 +27,6 @@ * caching algorithm using PHP. * * @author Ulf Wendel <ulf...@ph...> -* @version $Id: shm.php 186977 2005-05-25 10:00:41Z dufuz $ * @package Cache */ class Cache_Container_shm extends Cache_Container @@ -104,7 +101,7 @@ /** * Creates a shared memory container * - * @param array shm_key, sem_key, shm_size, sem_perm, shm_perm + * @param array $options shm_key, sem_key, shm_size, sem_perm, shm_perm */ function __construct($options = '') { Modified: trunk/lib/pear/Cache/Container/trifile.php =================================================================== --- trunk/lib/pear/Cache/Container/trifile.php 2024-04-16 08:11:34 UTC (rev 11084) +++ trunk/lib/pear/Cache/Container/trifile.php 2025-02-09 18:37:38 UTC (rev 11085) @@ -16,8 +16,6 @@ // | Sebastian Bergmann <sb...@se...> | // | Ian Eure <ie...@ph...> | // +----------------------------------------------------------------------+ -// -// $Id: trifile.php 184642 2005-04-18 19:05:01Z dufuz $ require_once 'lib/pear/Cache/Container/file.php'; Modified: trunk/lib/pear/Cache/Container.php =================================================================== --- trunk/lib/pear/Cache/Container.php 2024-04-16 08:11:34 UTC (rev 11084) +++ trunk/lib/pear/Cache/Container.php 2025-02-09 18:37:38 UTC (rev 11085) @@ -16,8 +16,6 @@ // | Sebastian Bergmann <sb...@se...> | // | Christian Stocker <ch...@ph...> | // +----------------------------------------------------------------------+ -// -// $Id: Container.php 293863 2010-01-23 03:46:52Z clockwerx $ require_once 'lib/pear/Cache/Error.php'; @@ -39,7 +37,6 @@ * not recommended! * * @author Ulf Wendel <ulf...@ph...> -* @version $Id: Container.php 293863 2010-01-23 03:46:52Z clockwerx $ * @package Cache * @access public * @abstract @@ -48,7 +45,7 @@ { /** - * Flag indicating wheter to preload datasets. + * Flag indicating whether to preload datasets. * * See the class description for more details. * @@ -129,7 +126,7 @@ /** - * Options that can be set in every derived class using it's constructor. + * Options that can be set in every derived class using its constructor. * * @var array */ @@ -139,8 +136,8 @@ /** * Loads a dataset from the cache. * - * @param string dataset ID - * @param string cache group + * @param string $id dataset ID + * @param string $group cache group * @return mixed dataset value or null on failure * @access public */ @@ -165,8 +162,8 @@ /** * Returns the userdata field of a cached data set. * - * @param string dataset ID - * @param string cache group + * @param string $id dataset ID + * @param string $group cache group * @return string userdata * @access public */ @@ -191,9 +188,9 @@ /** * Checks if a dataset is expired. * - * @param string dataset ID - * @param string cache group - * @param integer maximum age timestamp + * @param string $id dataset ID + * @param string $group cache group + * @param integer $max_age maximum age timestamp * @return boolean * @access public */ @@ -236,8 +233,8 @@ /** * Checks if a dataset is cached. * - * @param string dataset ID - * @param string cache group + * @param string $id dataset ID + * @param string $group cache group * @return boolean */ function isCached($id, $group) @@ -258,8 +255,8 @@ /** * Fetches a dataset from the storage medium. * - * @param string dataset ID - * @param string cache group + * @param string $id dataset ID + * @param string $group cache group * @return array format: [expire date, cached data, user data] * @throws Cache_Error * @abstract @@ -272,11 +269,11 @@ /** * Stores a dataset. * - * @param string dataset ID - * @param mixed data to store - * @param mixed userdefined expire date - * @param string cache group - * @param string additional userdefined data + * @param string $id dataset ID + * @param mixed $data data to store + * @param mixed $expire userdefined expire date + * @param string $group cache group + * @param string $userdata additional userdefined data * @return boolean * @throws Cache_Error * @access public @@ -293,8 +290,8 @@ /** * Removes a dataset. * - * @param string dataset ID - * @param string cache group + * @param string $id dataset ID + * @param string $group cache group * @return boolean * @access public * @abstract @@ -308,7 +305,7 @@ /** * Flushes the cache - removes all caches datasets from the cache. * - * @param string If a cache group is given only the group will be flushed + * @param string $group If a cache group is given only the group will be flushed * @return integer Number of removed datasets, -1 on failure * @access public * @abstract @@ -322,8 +319,8 @@ /** * Checks if a dataset exists. * - * @param string dataset ID - * @param string cache group + * @param string $id dataset ID + * @param string $group cache group * @return boolean * @access public * @abstract @@ -350,8 +347,8 @@ /** * Does a speculative preload of a dataset * - * @param string dataset ID - * @param string cache group + * @param string $id dataset ID + * @param string $group cache group * @return boolean */ function preload($id, $group) @@ -381,13 +378,13 @@ * Flushes the internal preload buffer. * * save(), remove() and flush() must call this method - * to preevent differences between the preloaded values and + * to prevent differences between the preloaded values and * the real cache contents. * - * @param string dataset ID, if left out the preloaded values will be flushed. + * @param string $id dataset ID, if left out the preloaded values will be flushed. * If given the preloaded values will only be flushed if they are * equal to the given id and group - * @param string cache group + * @param string $group cache group * @see preload() */ function flushPreload($id = '', $group = 'default') @@ -406,8 +403,8 @@ /** * Imports the requested datafields as object variables if allowed * - * @param array List of fields to be imported as object variables - * @param array List of allowed datafields + * @param array $requested List of fields to be imported as object variables + * @param array $allowed List of allowed datafields */ function setOptions($requested, $allowed) { @@ -421,7 +418,7 @@ /** * Encodes the data for the storage container. * - * @var mixed data to encode + * @return mixed data to encode */ function encode($data) { @@ -436,7 +433,7 @@ /** * Decodes the data from the storage container. * - * @var mixed + * @return mixed */ function decode($data) { @@ -451,7 +448,7 @@ /** * Translates human readable/relative times in unixtime * - * @param mixed can be in the following formats: + * @param mixed $expires can be in the following formats: * human readable : yyyymmddhhmm[ss]] eg: 20010308095100 * relative in seconds (1) : +xx eg: +10 * relative in seconds (2) : x < 946681200 eg: 10 @@ -471,10 +468,10 @@ } elseif ($expires < 100000000000) { //if integer is < 100000000000 (= in 3140 years), // it must be an absolut unixtime - // (since the "human readable" definition asks for a higher number) + // (since the "human-readable" definition asks for a higher number) return $expires; } else { - // else it's "human readable"; + // else it's "human-readable"; $year = substr($expires, 0, 4); $month = substr($expires, 4, 2); $day = substr($expires, 6, 2); Modified: trunk/lib/pear/Cache/Error.php =================================================================== --- trunk/lib/pear/Cache/Error.php 2024-04-16 08:11:34 UTC (rev 11084) +++ trunk/lib/pear/Cache/Error.php 2025-02-09 18:37:38 UTC (rev 11085) @@ -14,8 +14,6 @@ // +----------------------------------------------------------------------+ // | Authors: Ulf Wendel <ulf...@ph...> | // +----------------------------------------------------------------------+ -// -// $Id: Error.php 174777 2004-12-15 09:09:33Z dufuz $ require_once 'lib/pear/PEAR.php'; @@ -38,9 +36,9 @@ /** * Creates an cache error object. * - * @param string error message - * @param string file where the error occured - * @param string linenumber where the error occured + * @param string $msg error message + * @param string $file file where the error occurred + * @param string $line line number where the error occurred */ function __construct($msg, $file = __FILE__, $line = __LINE__) { Modified: trunk/lib/pear/Cache/Function.php =================================================================== --- trunk/lib/pear/Cache/Function.php 2024-04-16 08:11:34 UTC (rev 11084) +++ trunk/lib/pear/Cache/Function.php 2025-02-09 18:37:38 UTC (rev 11085) @@ -14,8 +14,6 @@ // +----------------------------------------------------------------------+ // | Authors: Sebastian Bergmann <sb...@se...> | // +----------------------------------------------------------------------+ -// -// $Id: Function.php 174777 2004-12-15 09:09:33Z dufuz $ require_once 'lib/pear/Cache.php'; @@ -65,7 +63,6 @@ * @module Function_Cache * @modulegroup Function_Cache * @package Cache -* @version $Revision: 174777 $ * @access public */ class Cache_Function extends Cache @@ -75,9 +72,9 @@ /** * Constructor * - * @param string Name of container class - * @param array Array with container class options - * @param integer Number of seconds for which to cache + * @param string $container Name of container class + * @param array $container_options Array with container class options + * @param integer $expires Number of seconds for which to cache */ function __construct($container = 'file', $container_options = array('cache_dir' => '.', Modified: trunk/lib/pear/Cache/Graphics.php =================================================================== --- trunk/lib/pear/Cache/Graphics.php 2024-04-16 08:11:34 UTC (rev 11084) +++ trunk/lib/pear/Cache/Graphics.php 2025-02-09 18:37:38 UTC (rev 11085) @@ -14,8 +14,6 @@ // +----------------------------------------------------------------------+ // | Authors: Ulf Wendel <ulf...@ph...> | // +----------------------------------------------------------------------+ -// -// $Id: Graphics.php 178289 2005-01-26 09:47:28Z dufuz $ require_once 'lib/pear/Cache.php'; @@ -66,7 +64,6 @@ * the output buffer. Modify it if required! * * @author Ulf Wendel <ulf...@ph...> -* @version $Id: Graphics.php 178289 2005-01-26 09:47:28Z dufuz $ * @package Cache */ class Cache_Graphics extends Cache @@ -117,7 +114,7 @@ /** * Mapping from supported image type to a ImageType() constant. * - * Referr to the PHP manual for more informations on ImageType() + * Refer to the PHP manual for more information on ImageType() * * @var array * @link http://www.php.net/ImageType @@ -142,13 +139,13 @@ * Returns the content of a cached image file. * * This function can be used to send the image directly to the browser. - * Make sure that you send a correspondending header before sending the image itself. + * Make sure that you send a correspondding header before sending the image itself. * * Always try to get the image from the cache before you compute it. See * the class docs for an example. * - * @param string Image-ID - * @param string Image type: gif, jpg, png, wbmp + * @param string $id Image-ID + * @param string $format Image type: gif, jpg, png, wbmp * @return string Image file contents if a cached file exists otherwise an empty string * @see cacheImage() */ @@ -165,8 +162,8 @@ * Always try to get the image from the cache before you compute it. See * the class docs for an example. * - * @param string Image-ID - * @param string Image type: gif, jpg, png, wbmp + * @param string $id Image-ID + * @param string $format Image type: gif, jpg, png, wbmp * @return array [ full path to the image file, image url ] * @throw Cache_Error * @see cacheImageLink() @@ -186,18 +183,18 @@ /** * Create an image from the given image handler, cache it and return the file content. * - * Always try to retrive the image from the cache before you compute it. + * Always try to retrieve the image from the cache before you compute it. * * Warning: this function uses the output buffer. If you expect collisions * modify the code. * - * @param string Image-ID. Used as a part of the cache filename. + * @param string $id Image-ID. Used as a part of the cache filename. * Use md5() to generate a "unique" ID for your image * based on characteristic values such as the color, size etc. - * @param string Image handler to create the image from. - * @param string Image type: gif, jpg, png, wbmp. Also used as filename suffix. + * @param string $img Image handler to create the image from. + * @param string $format Image type: gif, jpg, png, wbmp. Also used as filename suffix. * If an unsupported type is requested the functions tries to - * fallback to a supported type before throwing an exeption. + * fall back to a supported type before throwing an exception. * @return string Image content returned by ImageGIF/... * @throws Cache_Error * @access public @@ -256,15 +253,15 @@ /** * Create an image from the given image handler, cache it and return a url and the file path of the image. * - * Always try to retrive the image from the cache before you compute it. + * Always try to retrieve the image from the cache before you compute it. * - * @param string Image-ID. Used as a part of the cache filename. + * @param string $id Image-ID. Used as a part of the cache filename. * Use md5() to generate a "unique" ID for your image * based on characteristic values such as the color, size etc. - * @param string Image handler to create the image from. - * @param string Image type: gif, jpg, png, wbmp. Also used as filename suffix. + * @param string $img Image handler to create the image from. + * @param string $format Image type: gif, jpg, png, wbmp. Also used as filename suffix. * If an unsupported type is requested the functions tries to - * fallback to a supported type before throwing an exeption. + * fall back to a supported type before throwing an exception. * @return array [ full path to the image file, image url ] * @throws Cache_Error * @access public @@ -316,8 +313,8 @@ * Make sure that the URL matches the cache directory, * otherwise you'll get broken links. * - * @param string - * @access public + * @param string $cache_url + * @access public * @see setCacheDir() */ function setCacheURL($cache_url) @@ -333,8 +330,8 @@ /** * Sets the directory where to cache generated Images * - * @param string - * @access public + * @param string $cache_dir + * @access public * @see setCacheURL() */ function setCacheDir($cache_dir) Modified: trunk/lib/pear/Cache/HTTP_Request.php =================================================================== --- trunk/lib/pear/Cache/HTTP_Request.php 2024-04-16 08:11:34 UTC (rev 11084) +++ trunk/lib/pear/Cache/HTTP_Request.php 2025-02-09 18:37:38 UTC (rev 11085) @@ -14,8 +14,6 @@ // +----------------------------------------------------------------------+ // | Authors: Fabien MARTY <fab...@fr...> | // +----------------------------------------------------------------------+ -// -// $Id: HTTP_Request.php 174777 2004-12-15 09:09:33Z dufuz $ require_once 'lib/pear/Cache.php'; require_once 'lib/pear/HTTP/Request.php'; @@ -34,9 +32,9 @@ * You want to get news from another site through RSS remote files. But you * don't want to access to to the remote site at every time you display * its news on your site. Because, if the remote site is down or slow... -* So you you need a class which makes a local cache copy of the remote file. +* So you need a class which makes a local cache copy of the remote file. * Every x hours, the cache is updated. But if the remote site is down, the -* local cache copy is keeped (you can also get error messages if you want). +* local cache copy is kept (you can also get error messages if you want). * * So you need this class! * @@ -56,7 +54,6 @@ * ?> * * @author Fabien MARTY <fab...@fr...> -* @version $Id: HTTP_Request.php 174777 2004-12-15 09:09:33Z dufuz $ * @package Cache */ Modified: trunk/lib/pear/Cache/Output.php =================================================================== --- trunk/lib/pear/Cache/Output.php 2024-04-16 08:11:34 UTC (rev 11084) +++ trunk/lib/pear/Cache/Output.php 2025-02-09 18:37:38 UTC (rev 11085) @@ -16,8 +16,6 @@ // | Christian Stocker <ch...@ph...> | // | Vinai Kopp <ko...@ne...> | // +----------------------------------------------------------------------+ -// -// $Id: Output.php 178289 2005-01-26 09:47:28Z dufuz $ require_once 'lib/pear/Cache.php'; @@ -28,9 +26,9 @@ * output can increase the overall speed dramatically, especially if you use * a Shared Memory storage container. * -* As you can see in the example the usage is extemely simple. To cache a script +* As you can see in the example the usage is extremely simple. To cache a script * simple put some few lines of code in front of your script and some at the end. -* A preferrable place for this are the auto_prepend and auto_append files (=> php.ini). +* A preferable place for this are the auto_prepend and auto_append files (=> php.ini). * * Usage example: * @@ -90,7 +88,6 @@ * Have fun! * * @authors Ulf Wendel <ulf...@ph...> -* @version $ID: $ * @package Cache * @access public */ @@ -125,8 +122,8 @@ /** * starts the output buffering and returns an empty string or returns the cached output from the cache. * - * @param string dataset ID - * @param string cache group + * @param string $id dataset ID + * @param string $group cache group * @return string * @access public */ @@ -186,8 +183,8 @@ * Sends the data to the user. * This is for compatibility with OutputCompression * - * @param string - * @access public + * @param string $content + * @access public */ function printContent($content = '') { Modified: trunk/lib/pear/Cache/OutputCompression.php =================================================================== --- trunk/lib/pear/Cache/OutputCompression.php 2024-04-16 08:11:34 UTC (rev 11084) +++ trunk/lib/pear/Cache/OutputCompression.php 2025-02-09 18:37:38 UTC (rev 11085) @@ -19,7 +19,7 @@ require_once 'lib/pear/Cache/Output.php'; /** -* Cache using Output Buffering and contnet (gz) compression. +* Cache using Output Buffering and content (gz) compression. ** Usage example: * * // place this somewhere in a central config file @@ -50,7 +50,6 @@ * * Based upon a case study from Christian Stocker and inspired by jpcache. * -* @version $Id: OutputCompression.php 178289 2005-01-26 09:47:28Z dufuz $ * @author Ulf Wendel <ulf...@ph...>, Christian Stocker <ch...@ph...> * @access public * @package Cache @@ -81,9 +80,9 @@ /** * Sets the storage details and the content encoding used (if not autodetection) * - * @param string Name of container class - * @param array Array with container class options - * @param string content encoding mode - auto => test which encoding the user accepts + * @param string $container Name of container class + * @param array $container_options Array with container class options + * @param string $encoding content encoding mode - auto => test which encoding the user accepts */ function __construct($container, $container_options = '', $encoding = 'auto') { @@ -174,8 +173,8 @@ /** * Sends the compressed data to the user. * - * @param string - * @access public + * @param string $content + * @access public */ function printContent($content = '') { @@ -219,7 +218,7 @@ /** * Sets the encoding to be used. * - * @param string "auto" means autodetect for every client + * @param string $encoding "auto" means autodetect for every client * @access public * @see $encoding */ @@ -260,7 +259,7 @@ * Import variables from special namespaces. * * @access private - * @param string Type of variable (server, session, post) + * @param string $variable Type of variable (server, session, post) * @return array */ function &_importGlobalVariable($variable) Modified: trunk/lib/pear/Cache.php =================================================================== --- trunk/lib/pear/Cache.php 2024-04-16 08:11:34 UTC (rev 11084) +++ trunk/lib/pear/Cache.php 2025-02-09 18:37:38 UTC (rev 11085) @@ -27,7 +27,7 @@ * cache script runs. The idea behind the cache is quite simple. If you have * the same input parameters for whatever tasks/algorithm you use you'll * usually get the same output. So why not caching templates, functions calls, -* graphic generation etc. Caching certain actions e.g. XSLT tranformations +* graphic generation etc. Caching certain actions e.g. XSLT transformations * saves you lots of time. * * The design of the cache reminds of PHPLibs session implementation. A @@ -121,8 +121,8 @@ /** * - * @param string Name of container class - * @param array Array with container class options + * @param string $container Name of container class + * @param array $container_options Array with container class options */ function __construct($container, $container_options = '') { @@ -155,7 +155,7 @@ /** * Enables or disables caching. * - * @param boolean The new caching state. + * @param boolean $state The new caching state. * @access public */ function setCaching($state) @@ -166,8 +166,8 @@ /** * Returns the requested dataset it if exists and is not expired * - * @param string dataset ID - * @param string cache group + * @param string $id dataset ID + * @param string $group cache group * @return mixed cached data or NULL on failure * @access public */ @@ -184,10 +184,10 @@ /** * Stores the given data in the cache. * - * @param string dataset ID used as cache identifier - * @param mixed data to cache - * @param integer lifetime of the cached data in seconds - 0 for endless - * @param string cache group + * @param string $id dataset ID used as cache identifier + * @param mixed $data data to cache + * @param integer $expires lifetime of the cached data in seconds - 0 for endless + * @param string $group cache group * @return boolean * @access public */ @@ -201,11 +201,11 @@ /** * Stores a dataset without additional userdefined data. * - * @param string dataset ID - * @param mixed data to store - * @param string additional userdefined data - * @param mixed userdefined expire date - * @param string cache group + * @param string $id dataset ID + * @param mixed $cachedata data to store + * @param string $userdata additional userdefined data + * @param mixed $expires userdefined expire date + * @param string $group cache group * @return boolean * @throws Cache_Error * @access public @@ -221,8 +221,8 @@ /** * Loads the given ID from the cache. * - * @param string dataset ID - * @param string cache group + * @param string $id dataset ID + * @param string $group cache group * @return mixed cached data or NULL on failure * @access public */ @@ -236,8 +236,8 @@ /** * Returns the userdata field of a cached data set. * - * @param string dataset ID - * @param string cache group + * @param string $id dataset ID + * @param string $group cache group * @return string userdata * @access public * @see extSave() @@ -252,8 +252,8 @@ /** * Removes the specified dataset from the cache. * - * @param string dataset ID - * @param string cache group + * @param string $id dataset ID + * @param string $group cache group * @return boolean * @access public */ @@ -267,7 +267,7 @@ /** * Flushes the cache - removes all data from it * - * @param string cache group, if empty all groups will be flashed + * @param string $group cache group, if empty all groups will be flashed * @return integer number of removed datasets */ function flush($group = 'default') { @@ -282,8 +282,8 @@ * * Note: this does not say that the cached data is not expired! * - * @param string dataset ID - * @param string cache group + * @param string $id dataset ID + * @param string $group cache group * @return boolean * @access public */ @@ -297,9 +297,9 @@ /** * Checks if a dataset is expired * - * @param string dataset ID - * @param string cache group - * @param integer maximum age for the cached data in seconds - 0 for endless + * @param string $id dataset ID + * @param string $group cache group + * @param integer $max_age maximum age for the cached data in seconds - 0 for endless * If the cached data is older but the given lifetime it will * be removed from the cache. You don't have to provide this * argument if you call isExpired(). Every dataset knows @@ -321,7 +321,7 @@ * This is a quick but dirty hack to get a "unique" ID for a any kind of variable. * ID clashes might occur from time to time although they are extreme unlikely! * - * @param mixed variable to generate a ID for + * @param mixed $variable variable to generate a ID for * @return string "unique" ID * @access public */ @@ -333,7 +333,7 @@ /** * Calls the garbage collector of the storage object with a certain probability * - * @param boolean Force a garbage collection run? + * @param boolean $force Force a garbage collection run? * @see $gc_probability, $gc_time */ function garbageCollection($force = false) { Modified: trunk/lib/pear/DB/common.php =================================================================== --- trunk/lib/pear/DB/common.php 2024-04-16 08:11:34 UTC (rev 11084) +++ trunk/lib/pear/DB/common.php 2025-02-09 18:37:38 UTC (rev 11085) @@ -430,8 +430,8 @@ * </li> * <li> * other (including strings and numeric strings) -> - * the data with single quotes escaped by preceeding - * single quotes, backslashes are escaped by preceeding + * the data with single quotes escaped by preceding + * single quotes, backslashes are escaped by preceding * backslashes, then the whole string is encapsulated * between single quotes * </li> @@ -467,7 +467,7 @@ * Formats a boolean value for use within a query in a locale-independent * manner. * - * @param boolean the boolean value to be quoted. + * @param boolean $boolean the boolean value to be quoted. * @return string the quoted string. * @see DB_common::quoteSmart() * @since Method available since release 1.7.8. @@ -483,7 +483,7 @@ * Formats a float value for use within a query in a locale-independent * manner. * - * @param float the float value to be quoted. + * @param float $float the float value to be quoted. * @return string the quoted string. * @see DB_common::quoteSmart() * @since Method available since release 1.7.8. @@ -543,7 +543,7 @@ * DB_FETCHMODE_OBJECT mode is selected. * If no class is specified by default a cast * to object from the assoc array row will be - * done. There is also the posibility to use + * done. There is also the possibility to use * and extend the 'DB_row' class. * * @see DB_FETCHMODE_ORDERED, DB_FETCHMODE_ASSOC, DB_FETCHMODE_OBJECT @@ -842,7 +842,7 @@ // {{{ autoPrepare() /** - * Automaticaly generates an insert or update query and pass it to prepare() + * Automatically generates an insert or update query and pass it to prepare() * * @param string $table the table name * @param array $table_fields the array of field names @@ -870,7 +870,7 @@ // {{{ autoExecute() /** - * Automaticaly generates an insert or update query and call prepare() + * Automatically generates an insert or update query and call prepare() * and execute() with it * * @param string $table the table name @@ -883,7 +883,7 @@ * include the "WHERE" keyword. * * @return mixed a new DB_result object for successful SELECT queries - * or DB_OK for successul data manipulation queries. + * or DB_OK for successful data manipulation queries. * A DB_Error object on failure. * * @uses DB_common::autoPrepare(), DB_common::execute() @@ -925,7 +925,7 @@ * NOTES: * - This belongs more to a SQL Builder class, but this is a simple * facility. - * - Be carefull! If you don't give a $where param with an UPDATE + * - Be careful! If you don't give a $where param with an UPDATE * query, all the records of the table will be updated! * * @param string $table the table name @@ -1004,7 +1004,7 @@ * parameters or 1 placeholder per array element. * * @return mixed a new DB_result object for successful SELECT queries - * or DB_OK for successul data manipulation queries. + * or DB_OK for successful data manipulation queries. * A DB_Error object on failure. * * {@internal ibase and oci8 have their own execute() methods.}} @@ -1204,7 +1204,7 @@ * parameters or 1 placeholder per array element. * * @return mixed a new DB_result object for successful SELECT queries - * or DB_OK for successul data manipulation queries. + * or DB_OK for successful data manipulation queries. * A DB_Error object on failure. * * @see DB_result, DB_common::prepare(), DB_common::execute() @@ -1239,7 +1239,7 @@ * Generates and executes a LIMIT query * * @param string $query the query - * @param intr $from the row to start to fetching (0 = the first row) + * @param int $from the row to start to fetching (0 = the first row) * @param int $count the numbers of rows to fetch * @param mixed $params array, string or numeric data to be used in * execution of the statement. Quantity of items @@ -1248,7 +1248,7 @@ * parameters or 1 placeholder per array element. * * @return mixed a new DB_result object for successful SELECT queries - * or DB_OK for successul data manipulation queries. + * or DB_OK for successful data manipulation quer... [truncated message content] |