예제 #1
0
 public static function getActivePlugins()
 {
     return GNUsocial::getActivePlugins();
 }
예제 #2
0
 /**
  * Create a cache key for data dependent on code
  *
  * For cache elements that are dependent on changes in code, this creates
  * a more-or-less fingerprint of the current running code and adds it to
  * the cache key. In the case of an upgrade of core, or addition or
  * removal of plugins, a new unique fingerprint is generated and used.
  * 
  * There can still be problems with a) differences in versions of the 
  * plugins and b) people running code between official versions. This is
  * usually a problem only for experienced users like developers, who know
  * how to clear their cache.
  *
  * For sites that run code between versions (like the status.net cloud),
  * there's an additional build number configuration setting.
  * 
  * @param string $extra the real part of the key
  *
  * @return string full key
  */
 static function codeKey($extra)
 {
     static $prefix = null;
     if (empty($prefix)) {
         $names = array();
         foreach (GNUsocial::getActivePlugins() as $plugin => $attrs) {
             $names[] = $plugin;
         }
         asort($names);
         // Unique enough.
         $uniq = crc32(implode(',', $names));
         $build = common_config('site', 'build');
         $prefix = GNUSOCIAL_VERSION . ':' . $build . ':' . $uniq;
     }
     return Cache::key($prefix . ':' . $extra);
 }