Leveraging the framework without a webapp

Hey all,

First post here.

I’m considering leveraging Yii for a project I’m working on. What I’d like to do is leverage the framework without actually creating a full-blown webapp, because the only exposed functionality will be an AMFPHP component. I understand that there isn’t an AMFPHP extenstion currently, I’m ok with that. I’d just like to make use of the various session, auth, ActiveRecord, etc. bits that Yii has to offer.

Is it as simple as copying the framework out to my webserver, including the classes I’d like to leverage, and running with it? The only tutorials/examples I’ve been able to find all focus on creating a full-blown webapp.

Thanks much!

MB

You can use "yiic webapp" to create a skeleton first. Then, modify the entry script index.php by replacing the following line




Yii::createWebApplication($config)->run();



with the following:




Yii::createWebApplication($config);



Then, you will be able to use most features of Yii, including AR, session, etc. Note that your code needs to be executed AFTER the above line.

Thank you qiang. :)