public function create($configurations = array())
    {
        // get the default provider name
        $provider = isset($configurations['default']) ? $configurations['default'] : null;

        if (!$provider) {
            throw new MissingConfigurationException('Missing Configurations: Default Provider');
        }

        // prepare the full driver class name
        $driver_class = self::DRIVERS_NAMESPACE.ucwords($provider).'Provider';

        if (!class_exists($driver_class)) {
            throw new UnsupportedProviderException("CDN provider ($provider) is not supported");
        }

        // initialize the driver object and initialize it with the configurations
        $driver_object = App::make($driver_class)->init($configurations);

        return $driver_object;
    }
public function create($configurations = array())
    {
        // get the default provider name
        $provider = isset($configurations['default']) ? $configurations['default'] : null;

        if (!$provider) {
            throw new MissingConfigurationException('Missing Configurations: Default Provider');
        }

        // prepare the full driver class name
        $driver_class = self::DRIVERS_NAMESPACE.ucwords($provider).'Provider';

        if (!class_exists($driver_class)) {
            throw new UnsupportedProviderException("CDN provider ($provider) is not supported");
        }

        // initialize the driver object and initialize it with the configurations
        $driver_object = App::make($driver_class)->init($configurations);

        return $driver_object;
    }
public function create ( $ configurations = array ( ) ) { // get the default provider name $ provider = isset ( $ configurations [ 'default' ] ) ? $ configurations [ 'default' ] : null ; if ( ! $ provider ) { throw new MissingConfigurationException ( 'Missing Configurations: Default Provider' ) ; } // prepare the full driver class name $ driver_class = self :: DRIVERS_NAMESPACE . ucwords ( $ provider ) . 'Provider' ; if ( ! class_exists ( $ driver_class ) ) { throw new UnsupportedProviderException ( "CDN provider ($provider) is not supported" ) ; } // initialize the driver object and initialize it with the configurations $ driver_object = App :: make ( $ driver_class ) -> init ( $ configurations ) ; return $ driver_object ; }
Create and return an instance of the corresponding
Provider concrete according to the configuration.

@param array $configurations

@return mixed

@throws \Vinelab\Cdn\UnsupportedDriverException
Create and return an instance of the corresponding Provider concrete according to the configuration .