Exemplo n.º 1
0
 /**
  * 取得 active 的插件列表
  *
  * @return array
  */
 public static function getActivePluginArray()
 {
     // 配置数据缓存 1 个小时
     $activePluginArrayStr = OptionHelper::getOptionValue(PluginHelper::KEY_ACTIVE_PLUGIN_ARRAY, 3600);
     if (empty($activePluginArrayStr)) {
         return;
     }
     return @json_decode($activePluginArrayStr, true);
 }
Exemplo n.º 2
0
 /**
  * 取得系统 Theme 的设置
  *
  * @param string $systemTheme
  *
  * @return mixed
  */
 public static function getSystemThemeDirName($systemTheme)
 {
     return OptionHelper::getOptionValue($systemTheme, 3600);
 }
Exemplo n.º 3
0
 /**
  * 取得插件的 Option 值
  *
  * @param string $optionKey
  * @param bool   $ignoreError
  * true : 如果 $optionKey 不存在则返回  null
  * false:如果 $optionKey 不存在 Debug 模式下会抛出异常
  *
  * @return string
  */
 public static function getOptionValue($optionKey, $ignoreError = false)
 {
     if ($ignoreError && !static::isOptionValueExist($optionKey)) {
         return null;
     }
     $optionKey = static::makeUniqueOptionKey($optionKey);
     // 缓存 1 小时
     return OptionHelper::getOptionValue($optionKey, 3600);
 }