public static function factory($driver, array $options = []) { if (!$driver instanceof DriverInterface) { $driver = Driver::factory($driver, $options); } return new Pool($driver); }
public static function normalizeKey($key, $prefix = null) { $key = Driver::normalizeKey($key); $key = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $key); $key = rtrim($key, DIRECTORY_SEPARATOR); $key = explode(DIRECTORY_SEPARATOR, $key); $key = array_map(function ($value) { return filter_var($value, FILTER_SANITIZE_STRING) === $value ? $value : md5($value); }, $key); $key = implode($key, DIRECTORY_SEPARATOR); return $key; }