Permalink
Browse files

Merge remote-tracking branch 'xpdo/develop' into bug-7798

* xpdo/develop:
  [#7797] Avoid E_NOTICE from array_diff_assoc change in 5.4
  Prefix indexes with table name for sqlite
  Fix xPDOTest::testGetFields for sqlite/sqlsrv
  • Loading branch information...
2 parents d6fb640 + 468b653 commit 000b626dbc5481d71e7236b4d79e9817bcb66c9a @opengeek opengeek committed May 9, 2012
Showing with 8 additions and 6 deletions.
  1. +2 −0 core/xpdo/changelog.txt
  2. +1 −0 core/xpdo/om/sqlite/xpdomanager.class.php
  3. +5 −6 core/xpdo/xpdo.class.php
View
@@ -1,5 +1,7 @@
This file shows the changes in this release of xPDO.
+- [#7797] Avoid E_NOTICE from array_diff_assoc change in 5.4
+- Prefix indexes with table name for sqlite
- Fix lazy loading of fields on demand
- [#7607] xPDOObject->get(array) triggering invalid lazy loading
- xPDOObject/xPDOSimpleObject support for xPDO::getDescendants()
@@ -125,6 +125,7 @@ public function createObjectContainer($className) {
$tableConstraints = array();
if (!empty ($indexes)) {
foreach ($indexes as $indexkey => $indexdef) {
+ $indexkey = $this->xpdo->literal($instance->_table) . '_' . $indexkey;
$indexType = ($indexdef['primary'] ? 'PRIMARY KEY' : ($indexdef['unique'] ? 'UNIQUE' : 'INDEX'));
$index = $indexdef['columns'];
if (is_array($index)) {
View
@@ -615,12 +615,11 @@ public function loadClass($fqn, $path= '', $ignorePkg= false, $transient= false)
} elseif (isset ($this->packages[$this->package])) {
$pqn= $this->package . '.' . $fqn;
if (!$pkgClass= $this->_loadClass($class, $pqn, $included, $this->packages[$this->package]['path'], $transient)) {
- if ($otherPkgs= array_diff_assoc($this->packages, array($this->package => $this->packages[$this->package]))) {
- foreach ($otherPkgs as $pkg => $pkgDef) {
- $pqn= $pkg . '.' . $fqn;
- if ($pkgClass= $this->_loadClass($class, $pqn, $included, $pkgDef['path'], $transient)) {
- break;
- }
+ foreach ($this->packages as $pkg => $pkgDef) {
+ if ($pkg === $this->package) continue;
+ $pqn= $pkg . '.' . $fqn;
+ if ($pkgClass= $this->_loadClass($class, $pqn, $included, $pkgDef['path'], $transient)) {
+ break;
}
}
}

0 comments on commit 000b626

Please sign in to comment.