src/Service/Cdn.php
protected function callDriver($sMethod, $aArguments = [], $sDriver = null)
    {
        //  Work out which driver we need to use
        if (empty($sDriver)) {
            $oDriver = $this->oEnabledDriver;
        } elseif (array_key_exists($sDriver, $this->aDrivers)) {
            $oDriver = $this->aDrivers[$sDriver];
        } else {
            throw new DriverException('"' . $sDriver . '" is not a valid CDN driver.');
        }

        $oStorageDriver = Factory::service('StorageDriver', 'nails/module-cdn');
        $oInstance      = $oStorageDriver->getInstance($oDriver->slug);

        if (empty($oInstance)) {
            throw new DriverException('Failed to load CDN driver instance.');
        }

        return call_user_func_array([$oInstance, $sMethod], $aArguments);
    }
protected function callDriver($sMethod, $aArguments = [], $sDriver = null)
    {
        //  Work out which driver we need to use
        if (empty($sDriver)) {
            $oDriver = $this->oEnabledDriver;
        } elseif (array_key_exists($sDriver, $this->aDrivers)) {
            $oDriver = $this->aDrivers[$sDriver];
        } else {
            throw new DriverException('"' . $sDriver . '" is not a valid CDN driver.');
        }

        $oStorageDriver = Factory::service('StorageDriver', 'nails/module-cdn');
        $oInstance      = $oStorageDriver->getInstance($oDriver->slug);

        if (empty($oInstance)) {
            throw new DriverException('Failed to load CDN driver instance.');
        }

        return call_user_func_array([$oInstance, $sMethod], $aArguments);
    }
protected function callDriver ( $ sMethod , $ aArguments = [ ] , $ sDriver = null ) { //  Work out which driver we need to use if ( empty ( $ sDriver ) ) { $ oDriver = $ this -> oEnabledDriver ; } elseif ( array_key_exists ( $ sDriver , $ this -> aDrivers ) ) { $ oDriver = $ this -> aDrivers [ $ sDriver ] ; } else { throw new DriverException ( '"' . $ sDriver . '" is not a valid CDN driver.' ) ; } $ oStorageDriver = Factory :: service ( 'StorageDriver' , 'nails/module-cdn' ) ; $ oInstance = $ oStorageDriver -> getInstance ( $ oDriver -> slug ) ; if ( empty ( $ oInstance ) ) { throw new DriverException ( 'Failed to load CDN driver instance.' ) ; } return call_user_func_array ( [ $ oInstance , $ sMethod ] , $ aArguments ) ; }
Routes calls to the driver

@param string $sMethod    The method to call
@param array  $aArguments an array of arguments to pass to the driver
@param string $sDriver    If specified, which driver to call

@return mixed
@throws DriverException
Routes calls to the driver