开发者

Loader.php trying to load Doctrine classes, but we use Propel!

We are finding cases where we get the following 500 error:

File xyz.php does not exist or class "xyz" was not found in the file at () in SF_ROOT_DIR/lib/vendor/Zend/Loader.php line 107 ...

where xyz ==

Memcache (when trying to use symfony cc on the command line)

or

sfDoctrineAdminGenerator (when using an old-ish AdminGenerator-generated CMS page).

We use Propel, but Loader.php is trying to load classes used only for Doctrine.

Currently I am using a filthy hack where I request Loader.php to check if the file is either of these two cases, and if so simply return rather than trying to load it. Obviously, this is unacceptable longer term.

Has anybody encountered this, and how did you solve it?

Edited to add:

We have:

class ProjectCon开发者_运维问答figuration extends sfProjectConfiguration
{
  public function setup()
  {
    // for compatibility / remove and enable only the plugins you want
    $this->enableAllPluginsExcept(array('sfDoctrinePlugin'));
  }
}

And we have a propel.ini file in our top level config directory. This has only started in the past four weeks or so, and we've had a stable build for over a year now. I'm pretty sure Doctrine is totally disabled.


The only thing I can think of is to make sure Doctrine is disabled in your project configuration...


Could this be a conflict between Symfony's autoloader and Zend's? Try adding the following to your ProjectConfiguration.class.php:

set_include_path(sfConfig::get('sf_lib_dir') . '/vendor' . PATH_SEPARATOR . get_include_path());
require_once sfConfig::get('sf_lib_dir').'/vendor/Zend/Loader/Autoloader.php';
$loader = Zend_Loader_Autoloader::getInstance();

I use Zend Lucene using the above and it works. If that doesn't help, perhaps something in these Zend and Symfony slides may help.


Clear Cache :) And make sure your index.php have the right include file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜