Setting an alias for application manually shouldn’t be necessary. Just ensure basePath is set up correctly in your config. The application’s constructor will use this value to set up dependent aliases, which is not only the application alias. Normally, you don’t have to change anything. If I look at a default config as generated by yiic, it reads like:
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
Since the config.php is placed under protected/config, basePath is always configured correctly, even if you rename protected to something else.
Just make sure to include the correct config in your entry script. There, you can also validate configuration has been read properly:
// make sure to use the correct config
// test if configuration has been read correctly
If everything is fine, let’s have a look at the extension. What makes me wonder is your require_once. This shouldn’t be needed. If it is an extension developed for yii, the autoloader should find it on its own when it is used. The following should be enough:
If you want to force inclusion of the extension at a certain point in your app, you can use: