views:

108

answers:

3

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 ProjectConfiguration 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.

A: 

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

Peter D
See my edits above - it's definitely disabled.
kewpiedoll99
A: 

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.

jeremy
Thanks a ton - going to try this out now.
kewpiedoll99
Damn! I was pretty hopeful about that. But it doesn't help at all. What I need to understand is why these Doctrine-specific files are being requested for loading. I'll keep investigating. Thanks anyway.
kewpiedoll99
A: 

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

Henrik Bjørnskov