/** * 初始化,未启用内存保存时默认使用lock表存储 * * @param unknown_type $type */ private static function uk86_init($type) { if (C('cache_open')) { self::$lock = Cache::getInstance('cacheredis'); } else { self::$lock = new Uk86lock(); } if (!isset(self::$processid[$type])) { $ip = sprintf('%u', ip2long(uk86_getIp())); self::$processid[$type] = str_pad($ip, 10, '0') . self::uk86_parsekey($type); self::$lockid[$type] = str_pad($ip, 11, '0') . self::uk86_parsekey($type); } }