|
|
@@ -26,11 +26,6 @@
|
|
|
require_once 'Zend/Db.php';
|
|
|
|
|
|
/**
|
|
|
- * @see Zend_Loader
|
|
|
- */
|
|
|
-require_once 'Zend/Loader.php';
|
|
|
-
|
|
|
-/**
|
|
|
* @category Zend
|
|
|
* @package Zend_Db
|
|
|
* @subpackage Table
|
|
|
@@ -122,7 +117,10 @@ abstract class Zend_Db_Table_Row_Abstract implements ArrayAccess
|
|
|
$this->_table = $config['table'];
|
|
|
$this->_tableClass = get_class($this->_table);
|
|
|
} else if ($this->_tableClass !== null) {
|
|
|
- Zend_Loader::loadClass($this->_tableClass);
|
|
|
+ if (!class_exists($this->_tableClass)) {
|
|
|
+ require_once 'Zend/Loader.php';
|
|
|
+ Zend_Loader::loadClass($this->_tableClass);
|
|
|
+ }
|
|
|
$this->_table = new $this->_tableClass();
|
|
|
}
|
|
|
|
|
|
@@ -551,11 +549,14 @@ abstract class Zend_Db_Table_Row_Abstract implements ArrayAccess
|
|
|
$pkNew = $this->_getPrimaryKey(true);
|
|
|
$pkOld = $this->_getPrimaryKey(false);
|
|
|
foreach ($depTables as $tableClass) {
|
|
|
- try {
|
|
|
- Zend_Loader::loadClass($tableClass);
|
|
|
- } catch (Zend_Exception $e) {
|
|
|
- require_once 'Zend/Db/Table/Row/Exception.php';
|
|
|
- throw new Zend_Db_Table_Row_Exception($e->getMessage());
|
|
|
+ if (!class_exists($tableClass)) {
|
|
|
+ try {
|
|
|
+ require_once 'Zend/Loader.php';
|
|
|
+ Zend_Loader::loadClass($tableClass);
|
|
|
+ } catch (Zend_Exception $e) {
|
|
|
+ require_once 'Zend/Db/Table/Row/Exception.php';
|
|
|
+ throw new Zend_Db_Table_Row_Exception($e->getMessage());
|
|
|
+ }
|
|
|
}
|
|
|
$t = new $tableClass(array('db' => $db));
|
|
|
$t->_cascadeUpdate($this->getTableClass(), $pkOld, $pkNew);
|
|
|
@@ -629,11 +630,14 @@ abstract class Zend_Db_Table_Row_Abstract implements ArrayAccess
|
|
|
$db = $this->_getTable()->getAdapter();
|
|
|
$pk = $this->_getPrimaryKey();
|
|
|
foreach ($depTables as $tableClass) {
|
|
|
- try {
|
|
|
- Zend_Loader::loadClass($tableClass);
|
|
|
- } catch (Zend_Exception $e) {
|
|
|
- require_once 'Zend/Db/Table/Row/Exception.php';
|
|
|
- throw new Zend_Db_Table_Row_Exception($e->getMessage());
|
|
|
+ if (!class_exists($tableClass)) {
|
|
|
+ try {
|
|
|
+ require_once 'Zend/Loader.php';
|
|
|
+ Zend_Loader::loadClass($tableClass);
|
|
|
+ } catch (Zend_Exception $e) {
|
|
|
+ require_once 'Zend/Db/Table/Row/Exception.php';
|
|
|
+ throw new Zend_Db_Table_Row_Exception($e->getMessage());
|
|
|
+ }
|
|
|
}
|
|
|
$t = new $tableClass(array('db' => $db));
|
|
|
$t->_cascadeDelete($this->getTableClass(), $pk);
|
|
|
@@ -882,11 +886,14 @@ abstract class Zend_Db_Table_Row_Abstract implements ArrayAccess
|
|
|
$db = $this->_getTable()->getAdapter();
|
|
|
|
|
|
if (is_string($dependentTable)) {
|
|
|
- try {;
|
|
|
- Zend_Loader::loadClass($dependentTable);
|
|
|
- } catch (Zend_Exception $e) {
|
|
|
- require_once 'Zend/Db/Table/Row/Exception.php';
|
|
|
- throw new Zend_Db_Table_Row_Exception($e->getMessage());
|
|
|
+ if (!class_exists($dependentTable)) {
|
|
|
+ try {
|
|
|
+ require_once 'Zend/Loader.php';
|
|
|
+ Zend_Loader::loadClass($dependentTable);
|
|
|
+ } catch (Zend_Exception $e) {
|
|
|
+ require_once 'Zend/Db/Table/Row/Exception.php';
|
|
|
+ throw new Zend_Db_Table_Row_Exception($e->getMessage());
|
|
|
+ }
|
|
|
}
|
|
|
$dependentTable = new $dependentTable(array('db' => $db));
|
|
|
}
|
|
|
@@ -936,11 +943,14 @@ abstract class Zend_Db_Table_Row_Abstract implements ArrayAccess
|
|
|
$db = $this->_getTable()->getAdapter();
|
|
|
|
|
|
if (is_string($parentTable)) {
|
|
|
- try {
|
|
|
- Zend_Loader::loadClass($parentTable);
|
|
|
- } catch (Zend_Exception $e) {
|
|
|
- require_once 'Zend/Db/Table/Row/Exception.php';
|
|
|
- throw new Zend_Db_Table_Row_Exception($e->getMessage());
|
|
|
+ if (!class_exists($parentTable)) {
|
|
|
+ try {
|
|
|
+ require_once 'Zend/Loader.php';
|
|
|
+ Zend_Loader::loadClass($parentTable);
|
|
|
+ } catch (Zend_Exception $e) {
|
|
|
+ require_once 'Zend/Db/Table/Row/Exception.php';
|
|
|
+ throw new Zend_Db_Table_Row_Exception($e->getMessage());
|
|
|
+ }
|
|
|
}
|
|
|
$parentTable = new $parentTable(array('db' => $db));
|
|
|
}
|
|
|
@@ -991,11 +1001,14 @@ abstract class Zend_Db_Table_Row_Abstract implements ArrayAccess
|
|
|
$db = $this->_getTable()->getAdapter();
|
|
|
|
|
|
if (is_string($intersectionTable)) {
|
|
|
- try {
|
|
|
- Zend_Loader::loadClass($intersectionTable);
|
|
|
- } catch (Zend_Exception $e) {
|
|
|
- require_once 'Zend/Db/Table/Row/Exception.php';
|
|
|
- throw new Zend_Db_Table_Row_Exception($e->getMessage());
|
|
|
+ if (!class_exists($intersectionTable)) {
|
|
|
+ try {
|
|
|
+ require_once 'Zend/Loader.php';
|
|
|
+ Zend_Loader::loadClass($intersectionTable);
|
|
|
+ } catch (Zend_Exception $e) {
|
|
|
+ require_once 'Zend/Db/Table/Row/Exception.php';
|
|
|
+ throw new Zend_Db_Table_Row_Exception($e->getMessage());
|
|
|
+ }
|
|
|
}
|
|
|
$intersectionTable = new $intersectionTable(array('db' => $db));
|
|
|
}
|
|
|
@@ -1009,11 +1022,14 @@ abstract class Zend_Db_Table_Row_Abstract implements ArrayAccess
|
|
|
}
|
|
|
|
|
|
if (is_string($matchTable)) {
|
|
|
- try {
|
|
|
- Zend_Loader::loadClass($matchTable);
|
|
|
- } catch (Zend_Exception $e) {
|
|
|
- require_once 'Zend/Db/Table/Row/Exception.php';
|
|
|
- throw new Zend_Db_Table_Row_Exception($e->getMessage());
|
|
|
+ if (!class_exists($matchTable)) {
|
|
|
+ try {
|
|
|
+ require_once 'Zend/Loader.php';
|
|
|
+ Zend_Loader::loadClass($matchTable);
|
|
|
+ } catch (Zend_Exception $e) {
|
|
|
+ require_once 'Zend/Db/Table/Row/Exception.php';
|
|
|
+ throw new Zend_Db_Table_Row_Exception($e->getMessage());
|
|
|
+ }
|
|
|
}
|
|
|
$matchTable = new $matchTable(array('db' => $db));
|
|
|
}
|
|
|
@@ -1077,11 +1093,14 @@ abstract class Zend_Db_Table_Row_Abstract implements ArrayAccess
|
|
|
);
|
|
|
|
|
|
$rowsetClass = $matchTable->getRowsetClass();
|
|
|
- try {
|
|
|
- Zend_Loader::loadClass($rowsetClass);
|
|
|
- } catch (Zend_Exception $e) {
|
|
|
- require_once 'Zend/Db/Table/Row/Exception.php';
|
|
|
- throw new Zend_Db_Table_Row_Exception($e->getMessage());
|
|
|
+ if (!class_exists($rowsetClass)) {
|
|
|
+ try {
|
|
|
+ require_once 'Zend/Loader.php';
|
|
|
+ Zend_Loader::loadClass($rowsetClass);
|
|
|
+ } catch (Zend_Exception $e) {
|
|
|
+ require_once 'Zend/Db/Table/Row/Exception.php';
|
|
|
+ throw new Zend_Db_Table_Row_Exception($e->getMessage());
|
|
|
+ }
|
|
|
}
|
|
|
$rowset = new $rowsetClass($config);
|
|
|
return $rowset;
|