protected function getOptionsFromConfig(Config $config)
    {
        $options = [];

        foreach (static::$metaOptions as $option) {
            if (! $config->has($option)) {
                continue;
            }
            $options[static::$metaMap[$option]] = $config->get($option);
        }

        if ($visibility = $config->get('visibility')) {
            // For local reference
            // $options['visibility'] = $visibility;
            // For external reference
            $options['x-oss-object-acl'] = $visibility === AdapterInterface::VISIBILITY_PUBLIC ? OssClient::OSS_ACL_TYPE_PUBLIC_READ : OssClient::OSS_ACL_TYPE_PRIVATE;
        }

        if ($mimetype = $config->get('mimetype')) {
            // For local reference
            // $options['mimetype'] = $mimetype;
            // For external reference
            $options['Content-Type'] = $mimetype;
        }

        return $options;
    }
protected function getOptionsFromConfig(Config $config)
    {
        $options = [];

        foreach (static::$metaOptions as $option) {
            if (! $config->has($option)) {
                continue;
            }
            $options[static::$metaMap[$option]] = $config->get($option);
        }

        if ($visibility = $config->get('visibility')) {
            // For local reference
            // $options['visibility'] = $visibility;
            // For external reference
            $options['x-oss-object-acl'] = $visibility === AdapterInterface::VISIBILITY_PUBLIC ? OssClient::OSS_ACL_TYPE_PUBLIC_READ : OssClient::OSS_ACL_TYPE_PRIVATE;
        }

        if ($mimetype = $config->get('mimetype')) {
            // For local reference
            // $options['mimetype'] = $mimetype;
            // For external reference
            $options['Content-Type'] = $mimetype;
        }

        return $options;
    }
protected function getOptionsFromConfig ( Config $ config ) { $ options = [ ] ; foreach ( static :: $ metaOptions as $ option ) { if ( ! $ config -> has ( $ option ) ) { continue ; } $ options [ static :: $ metaMap [ $ option ] ] = $ config -> get ( $ option ) ; } if ( $ visibility = $ config -> get ( 'visibility' ) ) { // For local reference // $options['visibility'] = $visibility; // For external reference $ options [ 'x-oss-object-acl' ] = $ visibility === AdapterInterface :: VISIBILITY_PUBLIC ? OssClient :: OSS_ACL_TYPE_PUBLIC_READ : OssClient :: OSS_ACL_TYPE_PRIVATE ; } if ( $ mimetype = $ config -> get ( 'mimetype' ) ) { // For local reference // $options['mimetype'] = $mimetype; // For external reference $ options [ 'Content-Type' ] = $ mimetype ; } return $ options ; }
Retrieve options from a Config instance. done

@param Config $config

@return array
Retrieve options from a Config instance . done