示例#1
0
 static function get_plugins()
 {
     if (!empty(self::$plugins)) {
         return self::$plugins;
     }
     $path = JPATH_SITE . DS . 'components' . DS . 'com_fss' . DS . 'plugins' . DS . 'custfield' . DS;
     $plugins = array();
     $files = JFolder::files($path, '(.php$)');
     foreach ($files as $file) {
         $filename = $path . $file;
         $file = str_replace(".php", "", $file);
         $class = $file . "Plugin";
         if (file_exists($filename) && is_readable($filename)) {
             @(include_once $filename);
         }
         if (class_exists($class)) {
             $plugins[$file] = new $class();
         }
     }
     self::$plugins = $plugins;
     return $plugins;
 }