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