How To Force Inclusion By Config Entry?

When specifiying what to import in config file, doesn’t seem to exist the possibility of forcing it for specific files or dirs.

Then, how can an import be forced by application initial config?

My target is to override an extension models and components,

that’s why I want to force declaring my overridden classes.

I think boostrap patter is the correct one for doing this.

Then is there any other better way?

Thanks anyone

I think I must use preload entry for putting some responsive code… i’ll give a try and tell

You could specify by rooting alias.

for example

instead of

‘cache’ => array(

        'class' => 'CDbCache',



‘cache’ => array(

        'class' => 'application.components.CDbCache',


and write your own class CDbCache into protected/components/CDbCache

either or not extending the core CDbCache

Thanks, but this wasn’t the solution for the exposed problem.

I already knew that a class can be expressed as a path.

Finally, I adopted that solution


// and later



			'class' => 'application.extensions.phpDefinedFunctions'






This code helped to load at import process a class that replaced YumUserIdentity.

The trick has this appearance:


class phpDefinedFunctions extends CApplicationComponent{


if (!array_key_exists('tmp_files',$GLOBALS))

	$GLOBALS['tmp_files'] = array();	

if (!function_exists('destruct_tmp_files')){

	function destruct_tmp_files(){

		while (count($GLOBALS['tmp_files']))	

			file_exists($file=array_shift($GLOBALS['tmp_files'])) && @unlink($file);		




if (!function_exists('include_code')){

	function include_code($code){

		$temp = tmpfile();

		$GLOBALS['tmp_files'][] = array_search('uri', @array_flip(stream_get_meta_data($temp)));

		fwrite($temp, $code);







$parent_class = Yii::getPathOfAlias('application.modules.user.components.YumUserIdentity').'.php';

if (file_exists($parent_class)){


	$parent_class=preg_replace('/class YumUserIdentity/','class YumUserIdentityOld',$parent_class);	

	if (!class_exists('YumUserIdentityOld',$autoload=false)){


		class YumUserIdentity extends YumUserIdentityOld{


			public function __construct($username=null,$password=null)




			public function init(){


				return true;