Ejemplo n.º 1
0
 /**
  * Used for loading "fly" events
  *
  * @param string $add
  */
 function cache($add = null, $cache_id = null)
 {
     if (!self::$_is_shutdown_called) {
         $bol = register_shutdown_function(array('CoreEvents', 'saveSCache'));
         self::$_is_shutdown_called = true;
         self::$use_cache = true;
         if (!headers_sent()) {
             //flush();
         }
     }
     $ajax = ajax();
     if ($cache_id) {
         if ($cache_id == 'actions') {
             self::$actions[] = $add;
         } else {
             self::$cache[$cache_id] = $add;
         }
     } else {
         self::$cache[] = $add;
     }
     if ($add == null) {
         return self::$cache;
     }
 }