Xataface  2.0alpha2
Xataface Application Framework
 All Data Structures Namespaces Files Functions Variables Groups Pages
manage_output_cache.php
Go to the documentation of this file.
1 <?php
3  function handle(&$params){
4 
6  $context=array();
7  if ( !is_array(@$app->_conf['_output_cache']) or !(@$app->_conf['_output_cache']['enabled']) ){
8 
9  $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\'');
10 
11  } else {
12  $context['enabled'] = true;
13  }
14 
15 
16 
17  if ( @$_POST['--clear-cache'] ){
18  // We should clear the cache
19  @mysql_query("delete from `__output_cache`", df_db());
20  $app->redirect($app->url('').'&--msg='.urlencode('The output cache has been successfully cleared.'));
21  }
22 
23  $res = mysql_query("select count(*) from `__output_cache`", df_db());
24  if ( !$res ) throw new Exception(mysql_error(df_db()), E_USER_ERROR);
25  list($numrows) = mysql_fetch_row($res);
26  $context['numrows'] = $numrows;
27 
28  df_display($context, 'manage_output_cache.html');
29 
30 
31 
32 
33  }
34 }