Index: library/Zend/Loader.php
===================================================================
--- library/Zend/Loader.php	(revision 9275)
+++ library/Zend/Loader.php	(working copy)
@@ -42,14 +42,22 @@
      *
      * If the file was not found in the $dirs, or if no $dirs were specified,
      * it will attempt to load it from PHP's include_path.
+     * 
+     * If the class you are going to load may be user-defined, you should set
+     * $tryUserAutoloaders to true. User-defined classes may have an application
+     * specific prefix, and thus they could *only* be loaded with user-defined
+     * autoloaders.
      *
      * @param string $class      - The full class name of a Zend component.
      * @param string|array $dirs - OPTIONAL Either a path or an array of paths
      *                             to search.
+     * @param boolean $tryUserAutoloaders - Whether to use user-defined
+     *                                      autoloaders when this method fails
+     *                                      to load the class.
      * @return void
      * @throws Zend_Exception
      */
-    public static function loadClass($class, $dirs = null)
+    public static function loadClass($class, $dirs = null, $tryUserAutoloaders = false)
     {
         if (class_exists($class, false) || interface_exists($class, false)) {
             return;
@@ -83,6 +91,13 @@
             include_once $file;
         }
 
+        if ((!class_exists($class, false) && !interface_exists($class, false))
+        && $tryUserAutoloaders) {
+            // We couldn't load the requested class, but we're allowed to try
+            // with user-defined autoloaders.
+            spl_autoload_call($class);
+        }
+
         if (!class_exists($class, false) && !interface_exists($class, false)) {
             require_once 'Zend/Exception.php';
             throw new Zend_Exception("File \"$file\" does not exist or class \"$class\" was not found in the file");
Index: library/Zend/Db/Table/Rowset/Abstract.php
===================================================================
--- library/Zend/Db/Table/Rowset/Abstract.php	(revision 9275)
+++ library/Zend/Db/Table/Rowset/Abstract.php	(working copy)
@@ -116,7 +116,7 @@
         if (isset($config['rowClass'])) {
             $this->_rowClass   = $config['rowClass'];
         }
-        @Zend_Loader::loadClass($this->_rowClass);
+        @Zend_Loader::loadClass($this->_rowClass, null, true);
         if (isset($config['data'])) {
             $this->_data       = $config['data'];
         }
Index: library/Zend/Db/Table/Row/Abstract.php
===================================================================
--- library/Zend/Db/Table/Row/Abstract.php	(revision 9275)
+++ library/Zend/Db/Table/Row/Abstract.php	(working copy)
@@ -799,7 +799,7 @@
         
         if (is_string($dependentTable)) {
             try {
-                @Zend_Loader::loadClass($dependentTable);
+                @Zend_Loader::loadClass($dependentTable, null, true);
             } catch (Zend_Exception $e) {
                 require_once 'Zend/Db/Table/Row/Exception.php';
                 throw new Zend_Db_Table_Row_Exception($e->getMessage());
@@ -852,7 +852,7 @@
 
         if (is_string($parentTable)) {
             try {
-                @Zend_Loader::loadClass($parentTable);
+                @Zend_Loader::loadClass($parentTable, null, true);
             } catch (Zend_Exception $e) {
                 require_once 'Zend/Db/Table/Row/Exception.php';
                 throw new Zend_Db_Table_Row_Exception($e->getMessage());
@@ -906,7 +906,7 @@
 
         if (is_string($intersectionTable)) {
             try {
-                @Zend_Loader::loadClass($intersectionTable);
+                @Zend_Loader::loadClass($intersectionTable, null, true);
             } catch (Zend_Exception $e) {
                 require_once 'Zend/Db/Table/Row/Exception.php';
                 throw new Zend_Db_Table_Row_Exception($e->getMessage());
@@ -924,7 +924,7 @@
 
         if (is_string($matchTable)) {
             try {
-                @Zend_Loader::loadClass($matchTable);
+                @Zend_Loader::loadClass($matchTable, null, true);
             } catch (Zend_Exception $e) {
                 require_once 'Zend/Db/Table/Row/Exception.php';
                 throw new Zend_Db_Table_Row_Exception($e->getMessage());
@@ -991,7 +991,7 @@
 
         $rowsetClass = $matchTable->getRowsetClass();
         try {
-            @Zend_Loader::loadClass($rowsetClass);
+            @Zend_Loader::loadClass($rowsetClass, null, true);
         } catch (Zend_Exception $e) {
             require_once 'Zend/Db/Table/Row/Exception.php';
             throw new Zend_Db_Table_Row_Exception($e->getMessage());
Index: library/Zend/Db/Table/Abstract.php
===================================================================
--- library/Zend/Db/Table/Abstract.php	(revision 9275)
+++ library/Zend/Db/Table/Abstract.php	(working copy)
@@ -1046,7 +1046,7 @@
             'stored'   => true
         );
 
-        @Zend_Loader::loadClass($this->_rowsetClass);
+        @Zend_Loader::loadClass($this->_rowsetClass, null, true);
         return new $this->_rowsetClass($data);
     }
 
@@ -1091,7 +1091,7 @@
             'stored'  => true
         );
 
-        @Zend_Loader::loadClass($this->_rowClass);
+        @Zend_Loader::loadClass($this->_rowClass, null, true);
         return new $this->_rowClass($data);
     }
 

