/**
  * @brief getWidgets 获取可用的组件
  *
  * @return array
  */
 public static function getWidgets()
 {
     $widgets = Logx::readFile(LOGX_WIDGET, 'php');
     $reArray = array();
     foreach ($widgets as $widget) {
         if (substr($widget, -10) == 'Widget.php') {
             $widgetName = str_replace(array(LOGX_WIDGET, 'Widget.php'), array('', ''), $widget);
             $reArray[] = $widgetName;
         }
     }
     return $reArray;
 }
Esempio n. 2
0
 /**
  * @brief __construct 构造函数
  *
  * @param $options 配置信息
  *
  * @return void
  */
 function __construct($options = '')
 {
     if (!defined('CACHE_TIMEOUT')) {
         defined('CACHE_TIMEOUT', 60);
     } else {
         if (!is_integer(CACHE_TIMEOUT) || CACHE_TIMEOUT < 0) {
             throw new LogXException(_t('Cache timeout is an illegal number.'), E_ERROR);
         }
     }
     $this->cache = array();
     $this->type = 'FILE';
     if (!defined('LOGX_CACHE') || !is_dir(LOGX_CACHE)) {
         throw new LogXException(_t('Cache config is illegal.'), E_ERROR);
     }
     $files = Logx::readFile(LOGX_CACHE, 'php');
     foreach ($files as $file) {
         if (substr($file, -10) == '.cache.php') {
             @(include_once $file);
         }
     }
 }