[PATCH] foldmarkers in pear/DB/DB/*.php

From: Date: Tue, 11 Mar 2003 19:59:45 +0000
Subject: [PATCH] foldmarkers in pear/DB/DB/*.php
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-14206@lists.php.net to get a copy of this message
could someone please review and eventually, commit this? -- If you cc me or remove the list(s) completely I'll most likely ignore your message. see http://www.eyrie.org./~eagle/faqs/questions.html

Index: DB/DB/dbase.php =================================================================== RCS file: /repository/pear/DB/DB/dbase.php,v retrieving revision 1.2 diff -u -r1.2 dbase.php --- DB/DB/dbase.php 4 Jan 2003 11:54:49 -0000 1.2 +++ DB/DB/dbase.php 11 Mar 2003 19:52:34 -0000 @@ -62,6 +62,9 @@ $this->errorcode_map = array(); } + // }}} + // {{{ connect() + function connect($dsninfo, $persistent = false) { if (!DB::assertExtension('dbase')) { @@ -80,6 +83,9 @@ return DB_OK; } + // }}} + // {{{ disconnect() + function disconnect() { $ret = dbase_close($this->connection); @@ -87,6 +93,9 @@ return $ret; } + // }}} + // {{{ &query() + function &query($query = null) { // emulate result resources @@ -94,6 +103,9 @@ return new DB_result($this, $this->result++); } + // }}} + // {{{ fetchInto() + function fetchInto($res, &$row, $fetchmode, $rownum = null) { if ($rownum === null) { @@ -110,14 +122,23 @@ return DB_OK; } + // }}} + // {{{ numCols() + function numCols($foo) { return dbase_numfields($this->connection); } + // }}} + // {{{ numRows() + function numRows($foo) { return dbase_numrecords($this->connection); } + + // }}} + } -?> \ No newline at end of file +?> Index: DB/DB/ibase.php =================================================================== RCS file: /repository/pear/DB/DB/ibase.php,v retrieving revision 1.7 diff -u -r1.7 ibase.php --- DB/DB/ibase.php 7 Feb 2003 20:09:51 -0000 1.7 +++ DB/DB/ibase.php 11 Mar 2003 19:52:36 -0000 @@ -26,11 +26,17 @@ class DB_ibase extends DB_common { + + // {{{ properties + var $connection; var $phptype, $dbsyntax; var $autocommit = 1; var $manip_query = array(); + // }}} + // {{{ constructor + function DB_ibase() { $this->DB_common(); @@ -70,6 +76,9 @@ ); } + // }}} + // {{{ connect() + function connect($dsninfo, $persistent = false) { if (!DB::assertExtension('interbase')) { @@ -112,6 +121,9 @@ return DB_OK; } + // }}} + // {{{ disconnect() + function disconnect() { $ret = @ibase_close($this->connection); @@ -119,6 +131,9 @@ return $ret; } + // }}} + // {{{ simpleQuery() + function simpleQuery($query) { $ismanip = DB::isManip($query); @@ -136,6 +151,7 @@ return DB::isManip($query) ? DB_OK : $result; } + // }}} // {{{ modifyLimitQuery() /** @@ -182,6 +198,7 @@ } // }}} + // {{{ fetchInto() function fetchInto($result, &$ar, $fetchmode, $rownum = null) { @@ -206,6 +223,9 @@ return DB_OK; } + // }}} + // {{{ freeResult() + function freeResult($result) { if (is_resource($result)) { @@ -219,12 +239,18 @@ return true; } + // }}} + // {{{ freeQuery() + function freeQuery($query) { ibase_free_query($query); return true; } + // }}} + // {{{ numCols() + function numCols($result) { $cols = ibase_num_fields($result); @@ -234,6 +260,9 @@ return $cols; } + // }}} + // {{{ prepare() + function prepare($query) { $this->last_query = $query; @@ -243,6 +272,9 @@ return $stmt; } + // }}} + // {{{ execute() + function execute($stmt, $data = false) { $result = ibase_execute($stmt, $data); @@ -255,27 +287,40 @@ return DB::isManip($this->manip_query[(int)$stmt]) ? DB_OK : new DB_result($this, $result); } + // }}} + // {{{ autoCommit() + function autoCommit($onoff = false) { $this->autocommit = $onoff ? 1 : 0; return DB_OK; } + // }}} + // {{{ commit() + function commit() { return ibase_commit($this->connection); } + // }}} + // {{{ rollback() + function rollback($trans_number) { return ibase_rollback($this->connection, $trans_number); } + // }}} + // {{{ transactionInit() + function transactionInit($trans_args = 0) { return $trans_args ? ibase_trans($trans_args, $this->connection) : ibase_trans(); } + // }}} // {{{ nextId() /** * Get the next value in a sequence. Index: DB/DB/ifx.php =================================================================== RCS file: /repository/pear/DB/DB/ifx.php,v retrieving revision 1.7 diff -u -r1.7 ifx.php --- DB/DB/ifx.php 4 Jan 2003 11:54:50 -0000 1.7 +++ DB/DB/ifx.php 11 Mar 2003 19:52:38 -0000 @@ -34,11 +34,16 @@ class DB_ifx extends DB_common { + // {{{ properties + var $connection; var $affected = 0; var $dsn = array(); var $fetchmode = DB_FETCHMODE_ORDERED; /* Default fetch mode */ + // }}} + // {{{ constructor + function DB_ifx() { $this->phptype = 'ifx'; @@ -63,6 +68,8 @@ ); } + // }}} + // {{{ connect() /** * Connect to a database and log in as the specified user. * @@ -92,6 +99,8 @@ return DB_OK; } + // }}} + // {{{ disconnect() /** * Log out and disconnect from the database. * @@ -104,6 +113,8 @@ return $ret; } + // }}} + // {{{ simpleQuery() /** * Send a query to Informix and return the results as a * Informix resource identifier. @@ -139,6 +150,7 @@ return DB_OK; } + // }}} // {{{ nextResult() /** @@ -156,7 +168,7 @@ } // }}} - + // {{{ affectedRows() /** * Gets the number of rows affected by the last query. * if the last query was a select, returns an _estimate_ value. @@ -168,6 +180,8 @@ return $this->affected; } + // }}} + // {{{ fetchRow() /** * Fetch and return a row of data (it uses fetchInto for that) * @param $result Informix result identifier @@ -188,6 +202,8 @@ return $arr; } + // }}} + // {{{ fetchInto() /** * Fetch a row and return as array. * @@ -219,11 +235,16 @@ return DB_OK; } + // }}} + // {{{ numRows() + function numRows($result) { return $this->raiseError(DB_ERROR_NOT_CAPABLE); } + // }}} + // {{{ numCols() /** * Get the number of columns in a result set. * @@ -239,6 +260,8 @@ return $cols; } + // }}} + // {{{ freeResult() /** * Free the internal resources associated with $result. * @@ -262,6 +285,9 @@ return true; } + // }}} + // {{{ ifxraiseError() + function ifxraiseError($errno = null) { if ($errno === null) { @@ -272,6 +298,8 @@ $this->errorNative()); } + // }}} + // {{{ errorCode() /** * Map native error codes to DB's portable ones. Requires that * the DB implementation's constructor fills in the $errorcode_map @@ -292,6 +320,8 @@ return DB_ERROR; } + // }}} + // {{{ errorNative() /** * Get the native error message of the last error (if any) that * occured on the current connection. @@ -303,6 +333,7 @@ return ifx_error() . ' ' . ifx_errormsg(); } + // }}} // {{{ getSpecialQuery() /** @@ -323,4 +354,4 @@ // }}} } -?> \ No newline at end of file +?> Index: DB/DB/msql.php =================================================================== RCS file: /repository/pear/DB/DB/msql.php,v retrieving revision 1.4 diff -u -r1.4 msql.php --- DB/DB/msql.php 4 Jan 2003 11:54:50 -0000 1.4 +++ DB/DB/msql.php 11 Mar 2003 19:52:38 -0000 @@ -26,11 +26,16 @@ class DB_msql extends DB_common { + // {{{ properties + var $connection; var $phptype, $dbsyntax; var $prepare_tokens = array(); var $prepare_types = array(); + // }}} + // {{{ constructor + function DB_msql() { $this->DB_common(); @@ -44,6 +49,9 @@ ); } + // }}} + // {{{ connect() + function connect($dsninfo, $persistent = false) { if (!DB::assertExtension('msql')) @@ -73,6 +81,9 @@ return DB_OK; } + // }}} + // {{{ disconnect() + function disconnect() { $ret = @msql_close($this->connection); @@ -80,6 +91,9 @@ return $ret; } + // }}} + // {{{ simpleQuery() + function simpleQuery($query) { $this->last_query = $query; @@ -93,6 +107,8 @@ return DB::isManip($query) ? DB_OK : $result; } + + // }}} // {{{ nextResult() /** @@ -110,6 +126,7 @@ } // }}} + // {{{ fetchRow() function fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) { @@ -123,6 +140,9 @@ return $arr; } + // }}} + // {{{ fetchInto() + function fetchInto($result, &$ar, $fetchmode, $rownum=null) { if ($rownum !== null) { @@ -145,6 +165,9 @@ return DB_OK; } + // }}} + // {{{ freeResult() + function freeResult($result) { if (is_resource($result)) { @@ -158,6 +181,9 @@ return true; } + // }}} + // {{{ numCols() + function numCols($result) { $cols = @msql_num_fields($result); @@ -167,6 +193,9 @@ return $cols; } + // }}} + // {{{ numRows() + function numRows($result) { $rows = @msql_num_rows($result); @@ -176,6 +205,9 @@ return $rows; } + // }}} + // {{{ affected() + /** * Gets the number of rows affected by a query. * @@ -187,6 +219,7 @@ return @msql_affected_rows($this->connection); } + // }}} // {{{ getSpecialQuery() /** @@ -207,4 +240,4 @@ // }}} } -?> \ No newline at end of file +?> Index: DB/DB/mssql.php =================================================================== RCS file: /repository/pear/DB/DB/mssql.php,v retrieving revision 1.6 diff -u -r1.6 mssql.php --- DB/DB/mssql.php 21 Jan 2003 18:11:57 -0000 1.6 +++ DB/DB/mssql.php 11 Mar 2003 19:52:39 -0000 @@ -26,6 +26,8 @@ class DB_mssql extends DB_common { + // {{{ properties + var $connection; var $phptype, $dbsyntax; var $prepare_tokens = array(); @@ -34,6 +36,9 @@ var $autocommit = true; var $_db = null; + // }}} + // {{{ constructor + function DB_mssql() { $this->DB_common(); @@ -51,6 +56,9 @@ ); } + // }}} + // {{{ connect() + function connect($dsninfo, $persistent = false) { if (!DB::assertExtension('mssql') && !DB::assertExtension('sybase') @@ -87,6 +95,9 @@ return DB_OK; } + // }}} + // {{{ disconnect() + function disconnect() { $ret = @mssql_close($this->connection); @@ -94,6 +105,9 @@ return $ret; } + // }}} + // {{{ simpleQuery() + function simpleQuery($query) { $ismanip = DB::isManip($query); @@ -120,6 +134,8 @@ return $ismanip ? DB_OK : $result; } + // }}} + // {{{ nextResult() /** @@ -137,6 +153,7 @@ } // }}} + // {{{ &fetchRow() function &fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) { @@ -150,6 +167,9 @@ return $arr; } + // }}} + // {{{ fetchInto() + function fetchInto($result, &$ar, $fetchmode, $rownum=null) { if ($rownum !== null) { @@ -174,6 +194,9 @@ return DB_OK; } + // }}} + // {{{ freeResult() + function freeResult($result) { if (is_resource($result)) { @@ -187,6 +210,9 @@ return true; } + // }}} + // {{{ numCols() + function numCols($result) { $cols = @mssql_num_fields($result); @@ -196,6 +222,9 @@ return $cols; } + // }}} + // {{{ numRows() + function numRows($result) { $rows = @mssql_num_rows($result); @@ -205,6 +234,9 @@ return $rows; } + // }}} + // {{{ autoCommit() + /** * Enable/disable automatic commits */ @@ -286,6 +318,8 @@ } return $result; } + + // }}} // {{{ nextId() /** @@ -351,6 +385,7 @@ return $this->query("DROP TABLE $seqname"); } // }}} + // {{{ errorCode() function errorCode() { @@ -364,6 +399,9 @@ return $error_code; } + // }}} + // {{{ mssqlRaiseError() + function mssqlRaiseError($code = null) { if ($code !== null) { @@ -375,6 +413,9 @@ return $this->raiseError($code, null, null, null, mssql_get_last_message()); } + // }}} + // {{{ tableInfo() + /** * Returns information about a table or a result set @@ -488,6 +529,7 @@ return $res; } + // }}} // {{{ getSpecialQuery() /** @@ -513,4 +555,4 @@ // }}} } -?> \ No newline at end of file +?> Index: DB/DB/mysql4.php =================================================================== RCS file: /repository/pear/DB/DB/mysql4.php,v retrieving revision 1.2 diff -u -r1.2 mysql4.php --- DB/DB/mysql4.php 4 Jan 2003 11:54:50 -0000 1.2 +++ DB/DB/mysql4.php 11 Mar 2003 19:52:41 -0000 @@ -595,6 +595,7 @@ // }}} + // {{{ _BCsequence() /** * Backwards compatibility with old sequence emulation implementation * (clean up the dupes) @@ -638,6 +639,7 @@ } return true; } + // }}} // {{{ quote() Index: DB/DB/oci8.php =================================================================== RCS file: /repository/pear/DB/DB/oci8.php,v retrieving revision 1.5 diff -u -r1.5 oci8.php --- DB/DB/oci8.php 4 Jan 2003 11:54:50 -0000 1.5 +++ DB/DB/oci8.php 11 Mar 2003 19:52:42 -0000 @@ -653,6 +653,7 @@ } // }}} + // {{{ tableInfo() function tableInfo($result, $mode = null) { @@ -766,9 +767,12 @@ } return $res; } + + // }}} + } // Local variables: // tab-width: 4 // c-basic-offset: 4 // End: -?> \ No newline at end of file +?> Index: DB/DB/storage.php =================================================================== RCS file: /repository/pear/DB/DB/storage.php,v retrieving revision 1.4 diff -u -r1.4 storage.php --- DB/DB/storage.php 4 Jan 2003 11:54:50 -0000 1.4 +++ DB/DB/storage.php 11 Mar 2003 19:52:44 -0000 @@ -35,6 +35,8 @@ */ class DB_storage extends PEAR { + // {{{ properties + /** the name of the table (or view, if the backend database supports updates in views) we hold data from */ var $_table = null; @@ -65,6 +67,9 @@ valid, false if not */ var $_validator = null; + // }}} + // {{{ constructor + /** * Constructor * @@ -91,6 +96,9 @@ $this->_validator = $validator; } + // }}} + // {{{ _makeWhere() + /** * Utility method to build a "WHERE" clause to locate ourselves in * the table. @@ -137,6 +145,9 @@ return $whereclause; } + // }}} + // {{{ setup() + /** * Method used to initialize a DB_storage object from the * configured table. @@ -169,6 +180,9 @@ return DB_OK; } + // }}} + // {{{ insert() + /** * Create a new (empty) row in the configured table for this * object. @@ -197,6 +211,9 @@ $this->setup($newpk); } + // }}} + // {{{ toString() + /** * Output a simple description of this DB_storage object. * @return string object description @@ -242,6 +259,9 @@ return $info; } + // }}} + // {{{ dump() + /** * Dump the contents of this object to "standard output". */ @@ -255,6 +275,9 @@ } } + // }}} + // {{{ &create() + /** * Static method used to create new DB storage objects. * @param $data assoc. array where the keys are the names @@ -273,6 +296,9 @@ return $obj; } + // }}} + // {{{ loadFromQuery() + /** * Loads data into this object from the given query. If this * object already contains table data, changes will be saved and @@ -322,6 +348,9 @@ } */ + // }}} + // {{{ set() + /** * Modify an attriute value. */ @@ -359,6 +388,9 @@ null, true); } + // }}} + // {{{ &get() + /** * Fetch an attribute value. * @@ -376,6 +408,9 @@ return null; } + // }}} + // {{{ _DB_storage() + /** * Destructor, calls DB_storage::store() if there are changes * that are to be kept. @@ -390,6 +425,9 @@ $this->_table = null; } + // }}} + // {{{ store() + /** * Stores changes to this object in the database. * @@ -415,6 +453,9 @@ return DB_OK; } + // }}} + // {{{ remove() + /** * Remove the row represented by this object from the database. * @@ -439,6 +480,8 @@ $this->_changes = array(); return DB_OK; } + + // }}} } ?>
« previous php.pear.dev (#14206) next »