public static function adapter($name, $params = [], $key = null)
	{
		$key = $key ?: $name . '.' . md5(serialize($params));

		if (!isset(self::$adapters[$key]))
		{
			// Import filesystem plugins
			Plugin::import('filesystem');

			// Get the adapter
			$plugin  = 'plgFilesystem' . ucfirst($name);
			$adapter = $plugin::init($params);

			self::$adapters[$key] = new Flysystem($adapter);
		}

		// Return the filesystem connection
		return self::$adapters[$key];
	}
public static function adapter($name, $params = [], $key = null)
	{
		$key = $key ?: $name . '.' . md5(serialize($params));

		if (!isset(self::$adapters[$key]))
		{
			// Import filesystem plugins
			Plugin::import('filesystem');

			// Get the adapter
			$plugin  = 'plgFilesystem' . ucfirst($name);
			$adapter = $plugin::init($params);

			self::$adapters[$key] = new Flysystem($adapter);
		}

		// Return the filesystem connection
		return self::$adapters[$key];
	}
public static function adapter ( $ name , $ params = [ ] , $ key = null ) { $ key = $ key ? : $ name . '.' . md5 ( serialize ( $ params ) ) ; if ( ! isset ( self :: $ adapters [ $ key ] ) ) { // Import filesystem plugins Plugin :: import ( 'filesystem' ) ; // Get the adapter $ plugin = 'plgFilesystem' . ucfirst ( $ name ) ; $ adapter = $ plugin :: init ( $ params ) ; self :: $ adapters [ $ key ] = new Flysystem ( $ adapter ) ; } // Return the filesystem connection return self :: $ adapters [ $ key ] ; }
Returns the appropriate adapter

@param   string  $name    The adapter name to instantiate
@param   array   $params  Any initialization parameters
@param   string  $key     A custom key under which to store the adapter
@return  object
Returns the appropriate adapter