John Davidson

caching - PHP script to clear cache in Joomla 3.x

0 comments
Message:


I created the following script and put it to cron job on server. Unfortunately it does not work.


include 'includes/defines.php';
include 'includes/framework.php';

$conf = JFactory::getConfig();

$options = array(
'defaultgroup' => '',
'storage' => $conf->get('cache_handler', ''),
'caching' => true,
'cachebase' => $conf->get('cache_path', JPATH_SITE . '/cache')
);

$cache = JCache::getInstance('', $options);
$cache->clean('cachegroup');

Do you have an idea what is wrong?



My Answer:
> 'page',
> 'defaultformat' => 'html',
> 'caching' => 1,
> 'lifetime' => 900,
> 'cachetime' => 900,
> 'cache_handler' => 'file'
> );
> JFactory::getConfig()->set('caching', 0);
> JFactory::getConfig()->set('cachetime', 0);
> JFactory::getConfig()->set('lifetime', 0);
> JFactory::getConfig()->set('cache_handler', 'file');
> JFactory::getApplication()->initialise($options);
> JFactory::getCache('page')->clean();
> JFactory::getCache('view')->clean();
> JFactory::getCache('callback')->clean();
> JFactory::getCache('module')->clean();
> JFactory::getCache('component')->clean();
> JFactory::getCache('system')->clean();
> JFactory::getCache('object')->clean();
> JFactory::getCache('browser')->clean();
> JFactory::getCache('language')->clean();
> JFactory::getCache('menu')->clean();
> JFactory::getCache('template')->clean();
> JFactory::getCache('user')->clean();
> JFactory::getCache('session')->clean();
> JFactory::getCache('request')->clean();
> JFactory::getCache('data')->clean();
> JFactory::getCache('help')->clean();
> JFactory::getCache('module')->clean();
> JFactory::getCache('plugin')->clean();
> JFactory::getCache('system')->clean();
> JFactory::getCache('view')->clean();
> JFactory::getCache('callback')->clean();
> JFactory::getCache('object')->clean();
> JFactory::getCache('browser')->clean();
> JFactory::getCache('language')->clean();
> JFactory::getCache('menu')->clean();
> JFactory::getCache('template')->clean();
> JFactory::getCache('user')->clean();
> JFactory::getCache('session')->clean();
> JFactory::getCache('request')->clean();
> JFactory::getCache('data')->clean();
> JFactory::getCache('help')->clean();
> JFactory::getCache('plugin')->clean();
> JFactory::getCache('system')->clean();
> JFactory::getCache('view')->clean();
> JFactory::getCache('callback')->clean();
> JFactory::getCache('object')->clean();
> JFactory::getCache('browser')->clean();
> JFactory::getCache('language')->clean();
> JFactory::getCache('menu')->clean();
> JFactory::getCache('template')->clean();
> JFactory::getCache('user')->clean();
> JFactory::getCache('session')->clean();
> JFactory::getCache('request')->clean();
> JFactory::getCache('data')->clean();
> JFactory::getCache('help')->clean();
> JFactory::getCache('plugin')->clean();
> JFactory::getCache('system')->clean();
> JFactory::getCache('view')->clean();
> JFactory::getCache('callback')->clean();
> JFactory::getCache('object')->clean();
> JFactory::getCache('browser')->clean();
> JFactory::getCache('language')->clean();
> JFactory::getCache('menu')->clean();
> JFactory::getCache('template')->clean();
> JFactory::getCache('user')->clean();
> JFactory::getCache('session')->clean();
> JFactory::getCache('request')->clean();
> JFactory::getCache('data')->clean();
> JFactory::getCache('help')->clean();
> JFactory::getCache('plugin')->clean();
> JFactory::getCache('system')->clean();
> JFactory::getCache('view')->clean();
> JFactory::getCache('callback')->clean();
> JFactory::getCache('object')->clean();
> JFactory::getCache('browser')->clean();
> JFactory::getCache('language')->clean();
> JFactory::getCache('menu')->clean();
> JFactory::getCache('template')->clean();
> JFactory::getCache('user')->clean();
> JFactory::getCache('session')->clean();
> JFactory::getCache('request')->clean();
> JFactory::getCache('data')->clean();
> JFactory::getCache('help')->clean();
> JFactory::getCache('plugin')->clean();
> JFactory::getCache('system')->clean();
> JFactory::getCache('view')->clean();
> JFactory::getCache('callback')->clean();
> JFactory::getCache('object')->clean();
> JFactory::getCache('browser')->clean();
> JFactory::getCache('language')->clean();
> JFactory::getCache('menu')->clean();
> JFactory::getCache('template')->clean();
> JFactory::getCache('user')->clean();
> JFactory::getCache('session')->clean();
> JFactory::getCache('request')->clean();
> JFactory::getCache('data')->clean();
> JFactory::getCache('help')->clean();
> JFactory::getCache('plugin')->clean();
> JFactory::getCache('system')->clean();
> JFactory::getCache('view')->clean();
> JFactory::getCache('callback')->clean();
> JFactory::getCache('object')->clean();
> JFactory::getCache('browser')->clean();
> JFactory::getCache('language')->clean();
> JFactory::getCache('menu')->clean();
> JFactory::getCache('template')->clean();
> JFactory::getCache('user')->clean();
> JFactory::getCache('session')->clean();
> JFactory::getCache('request')->clean();
> JFactory::getCache('data')->clean();
> JFactory::getCache('help')->clean();
> JFactory::getCache('plugin')->clean();
> JFactory::getCache('system')->clean();
> JFactory::getCache('view')->clean();
> JFactory::getCache('callback')->clean();
> JFactory::getCache('object')->clean();
> JFactory::getCache('browser')->clean();
> JFactory::getCache('language')->clean();
> JFactory::getCache('menu')->clean();
> JFactory::getCache('template')->clean();
> JFactory::getCache('user')->clean();
> JFactory::getCache('session')->clean();
> JFactory::getCache('request')->clean();
> JFactory::getCache('data')->clean();
> JFactory::getCache('help')->clean();
> JFactory::getCache('plugin')->clean();
> JFactory::getCache('system')->clean();
> JFactory::getCache('view')->clean();
> JFactory::getCache('callback')->clean();
> JFactory::getCache('object')->clean();
> JFactory::getCache('browser')->clean();
> JFactory::getCache('language')->clean();
> JFactory::getCache('menu')->clean();
> JFactory::getCache('template')->clean();
> JFactory::getCache('user')->clean();
> JFactory::getCache('session')->clean();
> JFactory::getCache('request')->clean();
> JFactory::getCache('data')->clean();
> JFactory::getCache('help')->clean();
> JFactory::getCache('plugin')->clean();
> JFactory::getCache('system')->clean();
> JFactory::getCache('view')->clean();
> JFactory::getCache('callback')->clean();
> JFactory::getCache('object')->clean();
> JFactory::getCache('browser')->clean();
> JFactory::getCache('language')->clean();
> JFactory::getCache('menu')->clean();
> JFactory::getCache('template')->clean();
> JFactory::getCache('user')->clean();
> JFactory::getCache('session')->clean();
> JFactory::getCache('request')->clean();
> JFactory::getCache('data')->clean();
> JFactory::getCache('help')->clean();
> JFactory::getCache('plugin')->clean();
> JFactory::getCache('system')->clean();
> JFactory::getCache('view')->clean();
> JFactory::getCache('callback')->clean();
> JFactory::getCache('object')->clean();
> JFactory::getCache('browser')->clean();
> JFactory::getCache('language')->clean();
> JFactory::getCache('menu')->clean();
> JFactory::getCache('template')->clean();
> JFactory::getCache('user')->clean();
> JFactory::getCache('session')->clean();
> JFactory::getCache('request')->clean();
> JFactory::getCache('data')->clean();
> JFactory::getCache('help')->clean();
> JFactory::getCache('plugin')->clean();
> JFactory::getCache('system')->clean();
> JFactory::getCache('view')->clean();
> JFactory::getCache('callback')->clean();
> JFactory::getCache('object')->clean();
> JFactory::getCache('browser')->clean();
> JFactory::getCache('language')->clean();
> JFactory::getCache('menu')->clean();
> JFactory::getCache('template')->clean();
> JFactory::getCache('user')->clean();
> JFactory::getCache('session')->clean();
> JFactory::getCache('request')->clean();
> JFactory::getCache('data')->clean();
> JFactory::getCache('help')->clean();
> JFactory::getCache('plugin')->clean();
> JFactory::getCache('system')->clean();
> JFactory::getCache('view')->clean();
> JFactory::getCache('callback')->clean();
> JFactory::getCache('object')->clean();
> JFactory::getCache('browser')->clean();
> JFactory::getCache('language')->clean();
> JFactory::getCache('menu')->clean();
> JFactory::getCache('template')->clean();
> JFactory::getCache('user')->clean();
> JFactory::getCache('session')->clean();
> JFactory::getCache('request')->clean();
> JFactory::getCache('data')->clean();
> JFactory::getCache('help')->clean();
> JFactory::getCache('plugin')->clean();
> JFactory::getCache('system')->clean();
> JFactory::getCache('view')->clean();
> JFactory::getCache('callback')->clean();
> JFactory::getCache('object')->clean();
> JFactory::getCache('browser')->clean();
> JFactory::getCache('language')->clean();
> JFactory::getCache('menu')->clean();
> JFactory::getCache('template')->clean();
> JFactory::getCache('user')->clean();
> JFactory::getCache('session')->clean();
> JFactory::getCache('request')->clean();
> JFactory::getCache('data')->clean();
> JFactory::getCache('help')->clean();
> JFactory::getCache('plugin')->clean();
> JFactory::getCache('system')->clean();
> JFactory::getCache('view')->clean();
> JFactory::getCache('callback')->clean();
> JFactory::getCache('object')->clean();
> JFactory::getCache('browser')->clean();
> JFactory::getCache('language')->clean();
> JFactory::getCache('menu')->clean();
> JFactory::getCache('template')->clean();
> JFactory::getCache('user')->clean();
> JFactory::getCache('session')->clean();
> JFactory::getCache('request')->clean();
> JFactory::getCache('data')->clean();
> JFactory::getCache('help')->clean();
> JFactory::getCache('plugin')->clean();
> JFactory::getCache('system')->clean();
> JFactory::getCache('view')->clean();
> JFactory::getCache('callback')->clean();
> JFactory::getCache('object')->clean();
> JFactory::getCache('browser')->clean();
> JFactory::getCache('language')->clean();
> JFactory::getCache('menu')->clean();
> JFactory::getCache('template')->clean();
> JFactory::getCache('user')->clean();
> JFactory::getCache('session')->clean();
> JFactory::getCache('request')->clean();
> JFactory::getCache('data')->clean();
> JFactory::getCache('help')->clean();
> JFactory::getCache('plugin')->clean();
> JFactory::getCache('system')->clean();
> JFactory::getCache('view')->clean();
> JFactory::getCache('callback')->clean();
> JFactory::getCache('object')->clean();
> JFactory::getCache('browser')->clean();
> JFactory::getCache('language')->clean();
> JFactory::getCache('menu')->clean();
> JFactory::getCache('template')->clean();
> JFactory::getCache('user')->clean();
> JFactory::getCache('session')->clean();
> JFactory::getCache('request')->clean();
> JFactory::getCache('data')->clean();
> JFactory::getCache('help')->clean();
> JFactory::getCache('plugin')->clean();
> JFactory::getCache('system')->clean();
> JFactory::getCache('view')->clean();
> JFactory::getCache('callback')->clean();
> JFactory::getCache('object')->clean();
> JFactory::getCache('browser')->clean();
> JFactory::getCache('language')->clean();
> JFactory::getCache('menu')->clean();
> JFactory::getCache('template')->clean();
> JFactory::getCache('user')->clean();
> JFactory::getCache('session')->clean();
> JFactory::getCache('request')->clean();
> JFactory::getCache('data')->clean();
> JFactory::getCache('help')->clean();
> JFactory::getCache('plugin')->clean();
> JFactory::getCache('system')->clean();
> JFactory::getCache('view')->clean();
> JFactory::getCache('callback')->clean();
> JFactory::getCache('object')->clean();
> JFactory::getCache('browser')->clean();
> JFactory::get

Rate this post

3 of 5 based on 7140 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us