Resolves parameters and adds to Slim's config singleton.

@param array  $content
@param string $resource

@return void
323563
protected function addConfig(array $content, $resource)
    {
        foreach ($content as $key => $value) {
            $parameterBag = self::$parameters[$resource];

            $value = $parameterBag->unescapeValue($parameterBag->resolveValue($value));

            if (is_array($value) && !is_numeric($key)) {
                $key = array($key => $value);
                $value = true;
            }

            self::$slim->config($key, $value);
        }
    }
1107694
private function addFromString($filename, $content)
    {
        $this->repository->addFromString($this->getInternalPath().$filename, $content);
    }
1151682
public static function expandParameterArrays($content, array $parameters)
    {
        return preg_replace_callback('/\?/', function () use (& $parameters) {
            $parameter = current(each($parameters));
            return is_array($parameter) ? Compiler::toPlaceholders($parameter) : '?';
        }, $content);

    }
933424
private function saveContent($file, $content)
    {
        if (file_put_contents($file, $content, LOCK_EX) === false) {
            throw new RuntimeException('Plugin Manager is not able to save ' . $file . '.'); // @codeCoverageIgnore
        }
    }
1199560
public function setContent($content)
    {

        if ($content instanceof FileInterface) {
            $content = $content->load();
        }

        if (is_file($content) && is_readable($content)) {
            $content = file_get_contents($content);
        }

        $this->rawContent = $content;
        $this->parser->setContent($this->rawContent);
    }
1086930
public function indexContent(Content $content)
    {
        $document = $this->mapper->mapContent($content);

        $this->gateway->index($document);
    }
733262
protected function saveContent(string $hash, string $content): void
    {
        $this->adapter->save($this->namespace, $hash, $content);
        $this->cache[$hash] = $content;
    }
652469
public function setContent(string $content): void {
		
		// there's two options here:  that the concatenation of $this->root_path
		// and $content is a file and we pass that to our view or that it isn't
		// and we pass the $content argument to the view directly assuming that
		// it's a string of content.
		
		$temp = $this->root_path . DIRECTORY_SEPARATOR . $content;
		$this->view->setContent(is_file($temp) ? $temp : $content);
	}
1283478
public static function fileConfig($resource)
    {
        self::$config = new Config($resource, new ConfigLoader());
        self::$config->load();
        self::$config->configure();
    }
668963
public function add($content)
    {
        // Load
        $json = $this->load();

        // Create JSON elements Array:
        foreach ($content["elements"] as $key => $value) {
            // delete columns and labels of irre-fields from elements
            if ($key == "columns" || $key == "labels") {
                foreach ($value as $index => $column) {
                    if (!$content["tca"][$index]["inlineParent"]) {
                        $contentColumns[] = $column;
                    } else {
                        unset($value[$index]);
                        unset($value[$index]);
                    }
                    if ($key === 'labels'
                        && empty($column)
                        && isset($json[$content['type']]['tca'][$content['elements']['columns'][$index]])
                    ) {
                        // If using a mask field with empty label, we have to set the "default" label
                        $label = '';
                        foreach ($json[$content['type']]['elements'] as $element) {
                            if (in_array($content['elements']['columns'][$index], $element['columns'], true)) {
                                $i = array_search($content['elements']['columns'][$index], $element['columns'], true);
                                if (!empty($element['labels'][$i])) {
                                    $label = $element['labels'][$i];
                                    break;
                                }
                            }
                        }
                        $value[$index] = $label;
                    }
                }
            }
            $json[$content["type"]]["elements"][$content["elements"]["key"]][$key] = $value;
        }

        $contentColumns = array();
        $columns = array();

        // delete columns and labels of irre-fields from elements
        if ($content["elements"]["columns"]) {
            foreach ($content["elements"]["columns"] as $index => $column) {
                if (!$content["tca"][$index]["inlineParent"]) {
                    $contentColumns[] = $column;
                } else {
                    unset($content["elements"]["columns"][$index]);
                    unset($content["elements"]["labels"][$index]);
                }
                $columns[] = $column;
            }
        }

        // Create JSON sql Array:
        if (is_array($content["sql"])) {
            foreach ($content["sql"] as $table => $sqlArray) {
                foreach ($sqlArray as $index => $type) {
                    $fieldname = "tx_mask_" . $columns[$index];
                    $json[$table]["sql"][$fieldname][$table][$fieldname] = $type;
                }
            }
        }

        // Create JSON tca Array:
        if (is_array($content["tca"])) {


            foreach ($content["tca"] as $key => $value) {
                $inlineField = false;

                // if this field is inline-field
                if ($value["inlineParent"]) {
                    $type = $value["inlineParent"];
                    $inlineField = true;
                } else {
                    $type = $content["type"];
                }

                $json[$type]["tca"][$columns[$key]] = $value;

                // add rte flag if inline and rte
                if ($inlineField) {
                    if ($content["elements"]["options"][$key] == "rte") {
                        $json[$type]["tca"][$columns[$key]]["rte"] = "1";
                    }
                }

                // Only add columns to elements if it is no inlinefield
                if (!$inlineField) {
                    $json[$type]["elements"][$content["elements"]["key"]]["columns"][$key] = "tx_mask_" . $columns[$key];
                }
                $json[$type]["tca"]["tx_mask_" . $columns[$key]] = $json[$type]["tca"][$columns[$key]];
                $json[$type]["tca"]["tx_mask_" . $columns[$key]]["key"] = $columns[$key];

                if ($inlineField) {
                    $json[$type]["tca"]["tx_mask_" . $columns[$key]]["order"] = $key;
                }

                unset($json[$type]["tca"][$columns[$key]]);
            }
        }

        // sort content elements by key before saving
        $this->sortJson($json);
        $this->write($json);
    }
1311735
public function parse(array $tag, $content) {

        // If more than 1 http:// is found in the string, possible XSS attack
        if ((mb_substr_count($content, 'http://') + mb_substr_count($content, 'https://')) > 1) {
            return null;
        }

        $tag['attributes']['src'] = $content;

        if (!empty($tag['attributes']['default'])) {
            list($width, $height) = explode('x', $tag['attributes']['default']);

            $tag['attributes']['width'] = $width;
            $tag['attributes']['height'] = $height;
        }

        if (empty($tag['attributes']['alt'])) {
            $tag['attributes']['alt'] = '';
        }

        return parent::parse($tag, $content);
    }
310766
static function configure($resource) {
		foreach( static::lookup_methods() as $type => $cb )
			$resource->addLookup($cb, $type);
		$refcnt =& self::$refcnt[static::class];
		if ( ! $refcnt++ ) static::on_setup();
	}
207658
public function addContent($content, $key = null)
    {
        if (!is_null($key)) {
            $this->contents[$key] = $content;
        } else {
            $this->contents[] = $content;
        }

        return $this;
    }
30298
private function saveContentInCache($item, array $content)
    {
        if (null !== $this->cache && null !== $item) {
            $item->set($this->contentCache);
            $this->cache->save($item);
        }

        return $content;
    }
207716
public function putContent($content)
    {
        // write to io stream
        $this->size = fwrite($this->inputStream, $content);
        // rewind file pointer
        rewind($this->inputStream);
    }
954953
public function setContent( $content )
	{
		if( $this->content === (string) $content )
			return FALSE;
		$this->content = (string) $content;
		return TRUE;
	}
954818
private function setContent($content)
    {
        $this->content = $content;

        if (empty($this->contentType)) {
            return;
        }

        //Remove charset from Content-Type
        if (strpos($this->contentType, ';') !== false) {
            list($mime, $charset) = array_map('trim', explode(';', $this->contentType));

            $this->contentType = $mime;
            $charset = str_replace(['"', "'"], '', substr(strstr($charset, '='), 1));
            $this->content = Utils::toUtf8($content, trim($charset));
        }
    }