Esempio n. 1
0
 public static function init($with_cache = true)
 {
     if (!WITHOUT_CACHE && $with_cache && defined('CACHE_ADAPTER') && constant('CACHE_ADAPTER')) {
         self::$_instance_name = CACHE_ADAPTER;
         self::$_enable = true;
     } else {
         self::$_instance_name = 'base_cache_nocache';
         self::$_enable = false;
     }
     self::$_instance = null;
 }
Esempio n. 2
0
 public static function init($with_cache = true)
 {
     if (!WITHOUT_CACHE && $with_cache && defined('CACHE_STORAGE') && constant('CACHE_STORAGE')) {
         self::$_instance_name = CACHE_STORAGE;
         self::$_enable = true;
     } else {
         self::$_instance_name = 'base_cache_nocache';
         //todo:增加无cache类,提高无cache情况下程序的整体性能
         self::$_enable = false;
     }
     self::$_instance = null;
 }