Skip to content

Commit 52f18fd

Browse files
committed
fix init bug
1 parent 9945b66 commit 52f18fd

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Plugin.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,14 @@ public static function config(Typecho_Widget_Helper_Form $form)
124124
*/
125125
public static function configHandle($config, $is_init)
126126
{
127-
if ($is_init != true) {
128-
self::init();
127+
if ($is_init != true && $config['cache_driver'] != '0') {
128+
129+
$driver_name = $config['cache_driver'];
130+
$class_name = "typecho_$driver_name";
131+
$file_path = "driver/$class_name.class.php";
132+
require_once 'driver/cache.interface.php';
133+
require_once $file_path;
134+
self::$cache = $class_name::getInstance(self::$plugin_config);
129135

130136
try {
131137
if ($config['is_clean'] == '1') self::$cache->flush();

0 commit comments

Comments
 (0)