== Correct Answer Added below ==
ORIGINAL ANSWER
As far as Yii 1.1.* is concerned the best way seems to be to place the overriding versions of the files into a folder such as
/protected/component/overridden/
folder
and then to bind the application to the custom classes by adding them to import configuration in
/protected/config/main.php
.
'import'=>array(
'application.components.CDbConnection',
'application.components.CDbTransaction',
'application.components.CDbConnection',
...
),
This would then call the custom class files even when called by the Framework files.
CORRECT ANSWER - RESOLVED
What I needed was the following at the end of index.php
(in the root of project)
Yii::$classMap= [
'CActiveRecord' => dirname(__FILE__) .
'/protected/components/auditAndOps/CActiveRecord.php',
'CDbCommand' => dirname(__FILE__) .
'/protected/components/auditAndOps/CDbCommand.php',
'CDbTransaction' => dirname(__FILE__) .
'/protected/components/auditAndOps/CDbTransaction.php',
];
Yii::createWebApplication($config)->run();
What this essentially does is to remap the original classMap
locations of the respective Framework files, to my custom files in /protected/components/auditAndOps/