svn: /pear/packages/DB_DataObject/trunk/ DataObject.php
| From: | Alan Knowles | Date: | Mon, 28 Nov 2011 05:03:52 +0000 |
| Subject: | svn: /pear/packages/DB_DataObject/trunk/ DataObject.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-63120@lists.php.net to get a copy of this message | ||
alan_k Mon, 28 Nov 2011 05:03:52 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=320071
Log:
lower case links and ini during load, when portability set, fix handling in joinAdd
Changed paths:
U pear/packages/DB_DataObject/trunk/DataObject.php
Modified: pear/packages/DB_DataObject/trunk/DataObject.php
===================================================================
--- pear/packages/DB_DataObject/trunk/DataObject.php 2011-11-28 04:55:20 UTC (rev 320070)
+++ pear/packages/DB_DataObject/trunk/DataObject.php 2011-11-28 05:03:52 UTC (rev 320071)
@@ -1991,6 +1991,15 @@
}
}
+ // are table name lowecased..
+ if (!empty($_DB_DATAOBJECT['CONFIG']['portability']) &&
$_DB_DATAOBJECT['CONFIG']['portability'] & 1) {
+ foreach($_DB_DATAOBJECT['INI'][$this->_database] as $k=>$v) {
+ // results in duplicate cols.. but not a big issue..
+ $_DB_DATAOBJECT['INI'][$this->_database][strtolower($k)] = $v;
+ }
+ }
+
+
// now have we loaded the structure..
if (!empty($_DB_DATAOBJECT['INI'][$this->_database][$this->tableName()])) {
@@ -3084,6 +3093,25 @@
}
+ if (!empty($_DB_DATAOBJECT['CONFIG']['portability']) &&
$_DB_DATAOBJECT['CONFIG']['portability'] & 1) {
+ foreach($lcfg[$this->_database] as $k=>$v) {
+
+ $nk = strtolower($k);
+ // results in duplicate cols.. but not a big issue..
+ $lcfg[$this->_database][$nk] = isset($lcfg[$this->_database][$nk])
+ ? $lcfg[$this->_database][$nk] : array();
+
+ foreach($v as $kk =>$vv) {
+ //var_Dump($vv);exit;
+ $vv =explode(':', $vv);
+ $vv[0] = strtolower($vv[0]);
+ $lcfg[$this->_database][$nk][$kk] = implode(':', $vv);
+ }
+
+
+ }
+ }
+ //echo '<PRE>';print_r($lcfg);exit;
// if there is no link data at all on the file!
// we return null.
@@ -3523,7 +3551,7 @@
$ar[1] = explode(',', $ar[1]);
}
- if ($ar[0] != $obj->__table) {
+ if ($ar[0] != $obj->tableName()) {
continue;
}
if ($joinCol !== false) {
@@ -3605,7 +3633,7 @@
if ($ofield === false) {
$this->raiseError(
- "joinAdd: {$obj->__table} has no link with {$this->tableName()}",
+ "joinAdd: {$obj->tableName()} has no link with
{$this->tableName()}",
DB_DATAOBJECT_ERROR_NODATA);
return false;
}