English 中文(简体)
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 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.

问题回答

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.





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签