[Solved] Problem With Autoloader

Hello, i’m trying to connect my Yii application using REST, to other application that already have autoloader .

Both applications run in the same machine.

The problem is that after the REST call, Yii try to autoload the classes of the other application.

Can you help me ?

Thanks.

Hi jneto,

I think you should disable Yii autoloader with


spl_autoload_unregister(array('YiiBase','autoload'));

and after then you loaded the external code, you should reenable the autoloader with


spl_autoload_register(array('YiiBase','autoload'));

This article explain this mechanism.

What REST system are you using?

Thanks.

I was using




spl_autoload_unregister(array('YiiBase','autoload'));



but i found that the problem was in the result of the REST call. The result is an array with some objects inside.

The objects belong the the other application and Yii was trying to load the objects classes. I change the results only to arrays and now it works.

The other application is an internal application created with PHP without any framework. It have some webservices (SOAP and REST ) and i use CURL on Yii the make the REST calls.