Use this simple yiic console command to clear the application cache(s) and/or assets. You can supply multiple caches comma seperated to --cacheID
I will appreciate comments and suggestions on that as well as any hint how to make this better.
Yii 1.1 or above
Make sure that the user who is executing this command has the permissions to delete the assets. This can be done by using the same user who created the assets, using sudo or by setting sticky flags on your assets folder.
You can not use this command to clear the APC Cache as cli mode and apache mode use different environments for it.
This extension comes with two php files.
The AbstractCommand class extents CConsoleCommand with a new getHelp method that collects and prints globaloptions and action options. It also adds printf() and verbose() to be used as output methods that behave like printf but autoadd PHP_EOL and honor the global option verbose.
The ClearcacheCommand class can be used to clear the cache(c) and assets of your application.
Update your config imports section
'import' => array( 'application.commands.*', ),
./protected/yiic clearcache cache ./protected/yiic clearcache cache --cacheID=apcCache ./protected/yiic clearcache cache --cacheID=fileCache,memCached
$ ./protected/yiic clearcache help Info: Usage: ./protected/yiic clearcache <action> Actions: all [--cacheID=cache] [--assetPath=] cache [--cacheID=cache] assets [--assetPath=] help Global options: [verbose=0]
Available as zipped download.