Exemplo n.º 1
0
/**
 * Display the 'Empty Cache' page.
 */
function pageEmptyCache()
{
    global $PIVOTX;
    // check if the user has the required userlevel to view this page.
    $PIVOTX['session']->minLevel(PIVOTX_UL_NORMAL);
    $PIVOTX['template']->assign('title', __('Empty Cache'));
    $PIVOTX['template']->assign('heading', __("Clear PivotX's internal cache for stored files."));
    $deletecounter = wipeSmartyCache();
    $html = sprintf(__('deleted %s cache files in %s seconds.'), $deletecounter, timeTaken());
    $html = '<p>' . $html . '</p>';
    $PIVOTX['template']->assign("html", $html);
    renderTemplate('generic.tpl');
}
Exemplo n.º 2
0
 /**
  * Set configuration item
  */
 public static function setConfig($key, $value)
 {
     global $PIVOTX;
     $config = self::getOfflineConfiguration($PIVOTX['paths']['db_path']);
     $clear_cache = false;
     if ($key == 'online') {
         if ($value == '') {
             $value = false;
         } else {
             $value = true;
             if (!$config['online']) {
                 $clear_cache = true;
             }
         }
     }
     $config[$key] = $value;
     if ($clear_cache) {
         $deletecounter = wipeSmartyCache();
         $message = sprintf(__('deleted %s cache files in %s seconds.'), $deletecounter, timeTaken());
         debug($message);
     }
     self::writeConfiguration($PIVOTX['paths']['db_path'], $config);
 }
Exemplo n.º 3
0
 /**
  * Set a list of extensions that are activated.
  *
  * @param array $identifiers
  */
 function setActivated($identifiers)
 {
     global $PIVOTX;
     if (!is_array($identifiers)) {
         return false;
     }
     $filenames = array();
     // Check if we already have the full list of all extensions, otherwise get it..
     if ($this->full_list == false) {
         $this->scanExtensions();
     }
     // Get the filenames for each of the extensions..
     foreach ($identifiers as $identifier) {
         // iterate through the $this->list
         foreach ($this->full_list as $type => $extensions) {
             foreach ($extensions as $extension) {
                 if ($extension['name'] == $identifier || $extension['identifier'] == $identifier) {
                     $filenames[$identifier][] = $extension['file'];
                 }
             }
         }
     }
     // Store in config.
     $PIVOTX['config']->set('extensions_active', implode('|', $identifiers));
     $PIVOTX['config']->set('extensions_filenames', serialize($filenames));
     // Clear the cache.
     wipeSmartyCache();
     $this->active = $identifiers;
 }