2

I recently had to start making small changes to an existing site so I downloaded it and tried to run it but get an error:

Call to undefined method sfContext::getController() in 
/home/user/www/site.com/web/index.php on line 16

I tried to figure out which file is being loaded by inserting these lines with this command in index.php right before the dispatch call.

$reflection = new ReflectionClass('sfContext');
$classFile = $reflection->getFileName();
die($classFile);

sfContext::getInstance()->getController()->dispatch();

And it looks like file loaded is:

/home/user/www/site.com/lib/vendor/symfony1.0/test/unit/sfContextMock.class.php

This symfony1.0 site works fine on original server but not on my local machine. I checked php version and php.ini and they are identical. I cant figure out why wrong class is being loaded or what the problem is.

Here is the index.php file

<?php

define('SF_ROOT_DIR',    realpath(dirname(__FILE__).'/..'));
define('SF_APP',         'front');
define('SF_ENVIRONMENT', 'prod');
define('SF_DEBUG',       true);


require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');

sfContext::getInstance()->getController()->dispatch();
4

1 回答 1

1

您应该更新到可用的最新版本 ( 1.0.22 )。

于 2012-11-12T19:29:16.547 回答