Using Yii In 3Rd-Party Systems

I’ve read this:

Using Yii in 3rd-Party Systems

But the question is: How to work with


Model::model()->scopes()->findAll();

inside my legacy code?

in your legacy code file include this code on top




require_once('path/to/yii.php');

Yii::createWebApplication(array(

  'basePath' => dirname(__FILE__),

  'import' => array(

    'application.models.*'

  )

));



create a folder models and add your AR classes there

Well, I can create my Yii app just for create my models (for example). Then add my Yii app to a Legacy code and work with CActiveRecord with your snippet!? It looks like nice.