File persistently cached in Yii despite overwrite

Hi,

I have this weird problem with one of our file. It’s named Setup.php and stored under protected/components/

This file is mainly for emails, header, footer generating functions etc. We found out few days back that when we changed the footer layout in this file, the old footer would still show, despite doing a lot of debugging and edits (even removing the footer function itself), it still shows the old one. This is a shocker. I’m aware of cache issues but does Yii cache the whole PHP file? Is this even possible? We are positive the footer used the same function from the same file.

I’m again having this issue with another function in the same file. Determined it’s a problem with the component file and Yii, I would like to seek assistance from the Yii users.

Please let me know your thoughts. Thanks in advance.

Bump. Anyone please?

Uhm, are you running APC or opcache with aggressive settings?

@Da

Thanks for your reply. I’m not sure how to check whether I’m running which you mentioned but I believe I’m using no specific cache options. Below is my component settings from config/main.php:


'components'=>array(       

		'user'=>array(

			'allowAutoLogin'=>true,

                        'class'=>'RWebUser', 

		),

                'authManager'=>array( 

                'class'=>'RDbAuthManager', 

                ), 

                'bootstrap'=>array(

                'class'=>'bootstrap.components.Bootstrap'),

		'db'=>array(

			'connectionString' => 'mysql:host=localhost;dbname=xxxxx',

			'emulatePrepare' => true,

			'username' => 'xxxxx',

			'password' => 'xxxxx',

			'charset' => 'utf8',

			'enableProfiling'=>true,

        	'enableParamLogging' => true

		),

		

		'errorHandler'=>array(

			'errorAction'=>'site/error',

		),

		'log'=>array(

			'class'=>'CLogRouter',

			'routes'=>array(

				array(

					'class'=>'CProfileLogRoute',

		            'levels'=>'profile',

		            'enabled'=>true,

				),

				array(

                    'class'=>'CFileLogRoute',

                    'levels'=>'trace, info',

                    'categories'=>'system.*',

                ),

				array(

		            'class'=>'CWebLogRoute',

		            'categories'=>'system.db.*',

		            'except'=>'system.db.ar.*', 

		        ),

				

				array(

					'class'=>'CWebLogRoute',

				),

				

			),

		),

            

                'ePdf' => array(

                    'class'         => 'ext.yii-pdf.EYiiPdf',

                    'params'        => array(

                        'mpdf'     => array(

                            'librarySourcePath' => 'application.vendor.mpdf.*',

                            'constants'         => array(

                                '_MPDF_TEMP_PATH' => Yii::getPathOfAlias('application.runtime'),

                            ),

                            'class'=>'mpdf',

                        ),

                        'HTML2PDF' => array(

                            'librarySourcePath' => 'application.vendor.html2pdf.*',

                            'classFile'         => 'html2pdf.class.php',

                        )

                    ),

                ),            

            

            

	),

Please let me know if you would like to see anything else. Thanks for your help.

In that case your conclusion that Yii causes this cache problem seems highly unlikely.

@pcfreak: That’s not at all what I meant :lol: I’ve been suspecting some bytecode cache such as APC or opcache preventing the PHP environment from picking up code changes. You’ve just checked if there is a userland cache configured. Have a look at the output of [font=“Courier New”]phpinfo()[/font] and check for any stanzas reading APC (not APCu!), opcache, XCache or IonCube.

Check if there is another "Setup.php" in your site, not under "protected/components/" but somewhere else.

@softark: Pretty much that would’ve been my next advice. Enable profiling to verify the loaded file and the modified one are actually the same :)