![]() |
Xataface 2.0
Xataface Application Framework
|
00001 <?php 00002 class dataface_actions_manage_output_cache { 00003 function handle(&$params){ 00004 00005 $app =& Dataface_Application::getInstance(); 00006 $context=array(); 00007 if ( !is_array(@$app->_conf['_output_cache']) or !(@$app->_conf['_output_cache']['enabled']) ){ 00008 00009 $context['enabled'] = false; //return PEAR::raiseError('The output cache is currently disabled. You can enable it by adding an [_output_cache] section to your conf.ini file with a value \'enabled=1\''); 00010 00011 } else { 00012 $context['enabled'] = true; 00013 } 00014 00015 00016 00017 if ( @$_POST['--clear-cache'] ){ 00018 // We should clear the cache 00019 @mysql_query("delete from `__output_cache`", df_db()); 00020 $app->redirect($app->url('').'&--msg='.urlencode('The output cache has been successfully cleared.')); 00021 } 00022 00023 $res = mysql_query("select count(*) from `__output_cache`", df_db()); 00024 if ( !$res ) throw new Exception(mysql_error(df_db()), E_USER_ERROR); 00025 list($numrows) = mysql_fetch_row($res); 00026 $context['numrows'] = $numrows; 00027 00028 df_display($context, 'manage_output_cache.html'); 00029 00030 00031 00032 00033 } 00034 }