cvs: pear /MDB2/MDB2/Driver/Datatype oci8.php
| From: | Lukas Smith | Date: | Thu, 28 Jul 2005 09:28:04 +0000 |
| Subject: | cvs: pear /MDB2/MDB2/Driver/Datatype oci8.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-33404@lists.php.net to get a copy of this message | ||
lsmith Thu Jul 28 05:28:04 2005 EDT
Modified files:
/pear/MDB2/MDB2/Driver/Datatype oci8.php
Log:
- revert last few commits in order to make a bug fix release
- fixed typo in _getTimestampDeclaration()
http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/Datatype/oci8.php?r1=1.26&r2=1.27&ty=u
Index: pear/MDB2/MDB2/Driver/Datatype/oci8.php
diff -u pear/MDB2/MDB2/Driver/Datatype/oci8.php:1.26 pear/MDB2/MDB2/Driver/Datatype/oci8.php:1.27
--- pear/MDB2/MDB2/Driver/Datatype/oci8.php:1.26 Tue Jul 12 07:01:46 2005
+++ pear/MDB2/MDB2/Driver/Datatype/oci8.php Thu Jul 28 05:28:03 2005
@@ -42,7 +42,7 @@
// | Author: Lukas Smith <smith@backendmedia.com> |
// +----------------------------------------------------------------------+
-// $Id: oci8.php,v 1.26 2005/07/12 11:01:46 lsmith Exp $
+// $Id: oci8.php,v 1.27 2005/07/28 09:28:03 lsmith Exp $
require_once 'MDB2/Driver/Datatype/Common.php';
@@ -70,6 +70,7 @@
if (is_null($value)) {
return null;
}
+ $db =& $GLOBALS['_MDB2_databases'][$this->db_index];
switch ($type) {
case 'date':
return substr($value, 0, strlen('YYYY-MM-DD'));
@@ -108,11 +109,7 @@
*/
function _getTypeDeclaration($field)
{
- $db =& $this->getDBInstance();
- if (PEAR::isError($db)) {
- return $db;
- }
-
+ $db =& $GLOBALS['_MDB2_databases'][$this->db_index];
switch ($field['type']) {
case 'text':
$length = (isset($field['length']) ? $field['length'] : (($length =
$db->options['default_text_field_length']) ? $length : 4000));
@@ -165,12 +162,8 @@
*/
function _getIntegerDeclaration($name, $field)
{
+ $db =& $GLOBALS['_MDB2_databases'][$this->db_index];
if (isset($field['unsigned']) && $field['unsigned']) {
- $db =& $this->getDBInstance();
- if (PEAR::isError($db)) {
- return $db;
- }
-
$db->warning = "unsigned integer field \"$name\" is being declared as
signed integer";
}
$default = isset($field['default']) ? ' DEFAULT '.
@@ -208,6 +201,7 @@
*/
function _getTextDeclaration($name, $field)
{
+ $db =& $GLOBALS['_MDB2_databases'][$this->db_index];
$type = $this->_getTypeDeclaration($field);
$default = isset($field['default']) ? ' DEFAULT '.
$this->quote($field['default'], 'text') : '';
@@ -241,6 +235,7 @@
*/
function _getCLOBDeclaration($name, $field)
{
+ $db =& $GLOBALS['_MDB2_databases'][$this->db_index];
$notnull = (isset($field['notnull']) && $field['notnull']) ?
' NOT NULL' : '';
return $name.' '.$this->_getTypeDeclaration($field).$notnull;
}
@@ -271,6 +266,7 @@
*/
function _getBLOBDeclaration($name, $field)
{
+ $db =& $GLOBALS['_MDB2_databases'][$this->db_index];
$notnull = (isset($field['notnull']) && $field['notnull']) ?
' NOT NULL' : '';
return $name.' '.$this->_getTypeDeclaration($field).$notnull;
}
@@ -299,6 +295,7 @@
*/
function _getDateDeclaration($name, $field)
{
+ $db =& $GLOBALS['_MDB2_databases'][$this->db_index];
$default = isset($field['default']) ? ' DEFAULT '.
$this->quote($field['default'], 'date') : '';
$notnull = (isset($field['notnull']) && $field['notnull']) ?
' NOT NULL' : '';
@@ -329,8 +326,9 @@
*/
function _getTimestampDeclaration($name, $field)
{
+ $db =& $GLOBALS['_MDB2_databases'][$this->db_index];
$default = isset($field['default']) ? ' DEFAULT '.
- $this->quoteTimstamp($field['default']) : '';
+ $this->quote($field['default'], 'timestamp') : '';
$notnull = (isset($field['notnull']) && $field['notnull']) ?
' NOT NULL' : '';
return $name.' '.$this->_getTypeDeclaration($field).$default.$notnull; }
@@ -358,6 +356,7 @@
*/
function _getTimeDeclaration($name, $field)
{
+ $db =& $GLOBALS['_MDB2_databases'][$this->db_index];
$default = isset($field['default']) ? ' DEFAULT '.
$this->quote($field['default'], 'time') : '';
$notnull = (isset($field['notnull']) && $field['notnull']) ?
' NOT NULL' : '';
@@ -388,6 +387,7 @@
*/
function _getFloatDeclaration($name, $field)
{
+ $db =& $GLOBALS['_MDB2_databases'][$this->db_index];
$default = isset($field['default']) ? ' DEFAULT '.
$this->quote($field['default'], 'float') : '';
$notnull = (isset($field['notnull']) && $field['notnull']) ?
' NOT NULL' : '';
@@ -418,6 +418,7 @@
*/
function _getDecimalDeclaration($name, $field)
{
+ $db =& $GLOBALS['_MDB2_databases'][$this->db_index];
$default = isset($field['default']) ? ' DEFAULT '.
$this->quote($field['default'], 'decimal') : '';
$notnull = (isset($field['notnull']) && $field['notnull']) ?
' NOT NULL' : '';
@@ -540,11 +541,7 @@
*/
function _quoteDecimal($value)
{
- $db =& $this->getDBInstance();
- if (PEAR::isError($db)) {
- return $db;
- }
-
+ $db =& $GLOBALS['_MDB2_databases'][$this->db_index];
return $db->escape($value);
}
@@ -561,14 +558,10 @@
*/
function writeLOBToFile($lob, $file)
{
+ $db =& $GLOBALS['_MDB2_databases'][$this->db_index];
$lob_data = stream_get_meta_data($lob);
$lob_index = $lob_data['wrapper_data']->lob_index;
if (!@$this->lobs[$lob_index]['value']->writelobtofile($file)) {
- $db =& $this->getDBInstance();
- if (PEAR::isError($db)) {
- return $db;
- }
-
return $db->raiseError();
}
return MDB2_OK;
@@ -588,11 +581,6 @@
{
if (!isset($lob['loaded'])) {
if (!is_object($lob['ressource'])) {
- $db =& $this->getDBInstance();
- if (PEAR::isError($db)) {
- return $db;
- }
-
return $db->raiseError(MDB2_ERROR, null, null,
'attemped to retrieve LOB from non existing or NULL column');
}