Modify the runtime configuration of the helper.
Used as a get/set for the ini file values.

@param \MiniAsset\AssetConfig $config The config instance to set.
@return \MiniAsset\AssetConfig|null Either the current config object or null.
179787
public function assetConfig($config = null)
    {
        if ($config === null) {
            return $this->config;
        }
        $this->config = $config;
    }
1142485
public function setConfig(array $config)
    {
        if (!isset($config['thumbnailer'])) {
            $this->_thumbnailer = new Thumbnailer();
        } elseif (class_exists($config['thumbnailer'])) {
            $this->_thumbnailer = new $config['thumbnailer'];
        } else {
            throw new ConfigurationException('Class ' . $config['thumbnailer'] . ' does not exist.');
        }

        if (!($this->_thumbnailer instanceof ThumbnailerInterface)) {
            throw new ConfigurationException('Class ' . get_class($this->_thumbnailer) . ' must implement the interface \ysaroka\autothumb\ThumbnailerInterface.');
        }

        if (!isset($config['document_root'])) {
            throw new ConfigurationException('"document_root" key is required.');
        }

        if (!is_dir(realpath($config['document_root']))) {
            throw new ConfigurationException('"document_root": directory "' . $config['document_root'] . '" does not exist.');
        }

        if (!isset($config['types']) || count($config['types']) == 0) {
            throw new ConfigurationException('"types" key is required and should not be empty.');
        }

        foreach ($config['types'] as $type => $params) {
            if (!preg_match('#^[\w\d]+$#', $type)) {
                throw new ConfigurationException('"type": type name "' . $type . '" must contain only words and numbers.');
            }

            if (!isset($params['width'])) {
                $config['types'][$type]['width'] = 100;
            }

            if (!isset($params['height'])) {
                $config['types'][$type]['height'] = 100;
            }

            if (!isset($params['crop'])) {
                $config['types'][$type]['crop'] = true;
            }

            if (!isset($params['stretch'])) {
                $config['types'][$type]['stretch'] = false;
            }

            if (!isset($params['watermark'])) {
                $config['types'][$type]['watermark'] = false;
            } elseif (file_exists($params['watermark']) && !is_dir($params['watermark'])) {
                $config['types'][$type]['watermark'] = realpath($params['watermark']);
                if (isset($params['watermark_pos']) && defined('\ysaroka\autothumb\ThumbnailerInterface::POS_' . strtoupper($params['watermark_pos']))) {
                    $config['types'][$type]['watermark_pos'] = constant('\ysaroka\autothumb\ThumbnailerInterface::POS_' . strtoupper($params['watermark_pos']));
                } else {
                    $config['types'][$type]['watermark_pos'] = ThumbnailerInterface::POS_BOTTOM_RIGHT;
                }
            } else {
                throw new ConfigurationException('Image file "watermark": "' . $params['watermark'] . '" for type "' . $type . '" does not exist.');
            }
        }

        if (isset($config['allowed_extensions']) && is_array($config['allowed_extensions']) && count($config['allowed_extensions']) > 0) {
            $this->_allowedExtensions = $config['allowed_extensions'];
        }

        $this->_documentRoot = realpath($config['document_root']);
        $this->_types = $config['types'];

        return $this;
    }
326517
public final function set_config($config) {
        global $DB;
        foreach ($config as $key => $value) {
            // try set it in $this first
            try {
                $this->set($key, $value);
                continue;
            } catch (portfolio_exception $e) { }
            if (!in_array($key, $this->get_allowed_config())) {
                $a = (object)array('property' => $key, 'class' => get_class($this));
                throw new portfolio_export_exception($this->get('exporter'), 'invalidconfigproperty', 'portfolio', null, $a);
            }
            if (!isset($this->config->{$key})) {
                $DB->insert_record('portfolio_instance_config', (object)array(
                    'instance' => $this->id,
                    'name' => $key,
                    'value' => $value,
                ));
            } else if ($this->config->{$key} != $value) {
                $DB->set_field('portfolio_instance_config', 'value', $value, array('name' => $key, 'instance' => $this->id));
            }
            $this->config->{$key} = $value;
        }
    }
749394
public function saveOptions($config = null)
    {
        if ($config === null) {
            return $this->getConfig('saveOptions');
        }

        return $this->setConfig('saveOptions', $config);
    }
1067897
public function setConfig(Config $config)
    {
        $this->checkConfigConsistency($config);

        $this->config = $config;

        return $this;
    }
1011146
public function setConfig(array $config = [])
    {
        $config = $config + $this->config;

        foreach ($this->defaults as $key => $value) {
            if (!array_key_exists($key, $config)) {
                $config[$key] = $value;
            }
        }

        $this->config = $config;

        return $this;
    }
759597
public function configure(array $config)
    {
        return $this
            ->setGLSShipmentDeposit($config[Config::T8700])
            ->setCustomerCode($config[Config::T8915])
            ->setContactId($config[Config::T8914])
            ->clean();
    }
1247908
public static function config($config)
    {
        foreach ($config as $key => $value) {
            self::$config[$key] = $value;
        }

        //Re-set the admin url if shop url is changed
        if(isset($config['ShopUrl'])) {
            self::setAdminUrl();
        }

        //If want to keep more wait time than .5 seconds for each call
        if (isset($config['AllowedTimePerCall'])) {
            static::$timeAllowedForEachApiCall = $config['AllowedTimePerCall'];
        }

        return new ShopifySDK;
    }
1221366
public function setConfig(array $config)
    {
        if (empty($config)) {
            return $this;
        }

        foreach ($this->configurable as $setting) {
            if ( ! isset($config[$setting])) {
                continue;
            }

            if (property_exists($this, $setting)) {
                $this->$setting = $config[$setting];
            }
        }

        return $this;
    }
440231
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;
    }
945210
public function setConfig(array $config)
    {
        foreach ($config as $key => $value) {
            $this->_config[$key] = $value;
        }

        return $this;
    }
193351
public static function getInstance(Configuration $config = null)
    {
        if (!self::$instance) {
            self::$instance = new self($config);
        }

        return self::$instance;
    }
2447
public function setConfig($config)
    {
        $configObject = $this->getConfig();

        if (is_object($config)) {
            $config = get_object_vars($config);
        }

        foreach ((array)$config as $key => $value) {
            $configObject->$key = $value;
        }

        return $this;
    }
751413
public function getConfiguration(array $config, ContainerBuilder $container)
    {
        $configuration = new Configuration($this->getMainConfigParser(), $this->suggestionCollector);
        $configuration->setSiteAccessConfigurationFilters($this->siteaccessConfigurationFilters);

        return $configuration;
    }
816044
protected function getOptionsFromConfig(Config $config)
    {
        $options = $this->options;
        foreach (static::$mappingOptions as $option => $ossOption) {
            if (! $config->has($option)) {
                continue;
            }
            $options[$ossOption] = $config->get($option);
        }

        return $options;
    }
1329193
public function setConfig($config = [])
    {
        if (!empty($config) && is_array($config)) {
            $this->config = $config;
        } else {
            $this->config = NULL;
        }
        $this->debug->debug(__FUNCTION__, '$this->config: ' . json_encode($this->config));

        return $this;
    }
1129655
public function getConfiguration(array $config, ContainerBuilder $container)
    {
        $reflection = new \ReflectionClass(Configuration::class);
        $container->addResource(new FileResource($reflection->getFileName()));

        return new Configuration();
    }