After building and testing a REST implementation (using the RESTfullyii extension) on localhost, I moved it to a site. Now, the front page displays fine, and I know I am connecting to the database for logins etc, but when I go to a page that calls one of the models set up for REST (which works fine on localhost…) I get this error:
Fatal error: Class ‘ERestController’ not found in /home/garuda/public_html/www.sullivaniii.com/yii1.1/protected/controllers/AlbumController.php on line 3
class AlbumController extends ERestController
ERestController is one of the components of the RESTfullyii extension and should be loaded by this part of /protected/config/main.php:
// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
'ext.restfullyii.components.*',
'application.modules.user.models.*',
'application.modules.user.components.*',
'application.modules.rights.*',
'application.modules.rights.components.*',
),
My guess is that the components of the extension are not loading, but I don’t know why… if this is a baseUrl issue, why do other pages work???
Just a bump to see if anyone here might be able to help troubleshoot this. It works fine on localhost, and I can use the Chrome Advanced REST client to check the server response etc.
But for some reason, the exact same code breaks on every controller that extends the ERestController class. It seems that the class isn’t loading even though it is supposed to, and instead I get a Fatal Error, with very little useable info as to why.
Any idea how to determine whether the import in config/main.php is working??
As long as all the folders are placed correctly and it points to the right place you shouldn’t get that error. Sometimes it can be something minor like capital letters, live servers are usually case sensitive unless specified otherwise.
Interesting… The extension unzips into a folder named RESTfullyii. I changed that to restfullyii, and now I get a different error - but the components are starting to load… this time it is:
Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /home/garuda/public_html/www.sullivaniii.com/yii1.1/protected/extensions/restfullyii/components/ERestController.php on line 218
Found out the problem and fixed it. It seems that RESTfullyii wants php > 5.3 - but that isn’t mentioned in the requirements… and since yii 1.1 doesn’t have that requirement, it probably should be mentioned! I will contact the extension author…