Skip to content

Commit

Permalink
fix init bug
Browse files Browse the repository at this point in the history
  • Loading branch information
phpgao committed Jun 5, 2015
1 parent 9945b66 commit 52f18fd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,14 @@ public static function config(Typecho_Widget_Helper_Form $form)
*/
public static function configHandle($config, $is_init)
{
if ($is_init != true) {
self::init();
if ($is_init != true && $config['cache_driver'] != '0') {

$driver_name = $config['cache_driver'];
$class_name = "typecho_$driver_name";
$file_path = "driver/$class_name.class.php";
require_once 'driver/cache.interface.php';
require_once $file_path;
self::$cache = $class_name::getInstance(self::$plugin_config);

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

0 comments on commit 52f18fd

Please sign in to comment.