Store the content folder.

@param string $source
Path on file system to content directory.
@param array $content
Content properties
165509
public function saveContent($source, $content) {
    $dest = "{$this->path}/content/{$content['id']}";

    // Remove any old content
    \H5PCore::deleteFileTree($dest);

    self::copyFileTree($source, $dest);
  }
806561
public function addContents($contents)
    {
        if (current($contents) instanceof Content) {
            foreach ($contents as $content) {
                $this->addContent($content);
            }
        } else {
            foreach ($contents as $key => $value) {
                $this->addContent($key, $value);
            }
        }
    }
475528
public function writeOver($content)
	{
		$this->createPath($this->path);
		file_put_contents($this->getName(), $content);
	}
224910
public function SetContent(Content $content)
    {
        $this->texts = array();
        $wordings = ContentWording::Schema()->FetchByContent(false, $content);
        foreach($wordings as $wording)
        {
            $prefix = Str::Replace('-', '.', $content->GetType());
            $this->texts[$prefix . '.' . $wording->GetPlaceholder()] = $wording->GetText();
        }
    }
630196
protected static function putFile($path, $content): void
    {
        if (file_exists($path) && $content === file_get_contents($path)) {
            return;
        }
        if (!file_exists(dirname($path))) {
            mkdir(dirname($path), 0777, true);
        }
        if (false === file_put_contents($path, $content)) {
            throw new FailedWriteException("Failed write file $path");
        }
    }
1146263
public function write($content) : void
    {
        $this->checkFile();
        $this->checkDir();

        file_put_contents($this->path, $content);
    }
1170729
public function save($file, $content)
    {
        $dir = dirname($file);

        if (!is_dir($dir)) {
            mkdir($dir, 0777);
        }

        if (file_put_contents($file, $content)) {
            chmod($file, 0777);

            return true;
        } else {
            $message = "Cannot open cache file for writing: ";
            //			if (!Nip_Staging::instance()->isPublic()) {
            //				$message .= " [ ".$this->cache_file." ] ";
            //			}
            die($message);
        }
    }
1293081
public function setContent($content)
    {
        $contentAttribute = $this->contentAttribute;
        if ($contentAttribute === false) {
            return;
        }
        if (is_array($contentAttribute)) {
            foreach ($contentAttribute as $key => $value) {
                $this->$value = $content[$key];
            }
            return;
        }
        $this->$contentAttribute = $content;
    }
954953
public function setContent( $content )
	{
		if( $this->content === (string) $content )
			return FALSE;
		$this->content = (string) $content;
		return TRUE;
	}
741918
private function storePageContent($content)
    {
        $key = $this->getCurrentKey();
        $item = new CacheItem($key);

        // When enabled we store original header values with the item
        $isHeadersForwardingEnabled = $this->config->isSendHeaders() && $this->config->isForwardHeaders();

        $this->log(__METHOD__ . ' Header forwarding is ' . ($isHeadersForwardingEnabled ? 'enabled' : 'disabled'));

        $expiresAt = $isHeadersForwardingEnabled
            ? $this->httpHeaders->detectResponseExpires()
            : null;

        $lastModified = $isHeadersForwardingEnabled
            ? $this->httpHeaders->detectResponseLastModified()
            : null;

        $eTagString = $isHeadersForwardingEnabled
            ? $this->httpHeaders->detectResponseETagString()
            : null;

        // Store original Expires header time if set
        if (!empty($expiresAt)) {
            $item->setExpiresAt($expiresAt);
        }

        // Set current time as last modified if none provided
        if (empty($lastModified)) {
            $lastModified = new DateTime();
        }

        /**
         * Set ETag from from last modified time if none provided
         *
         * @link https://github.com/mmamedov/page-cache/issues/1#issuecomment-273875002
         */
        if (empty($eTagString)) {
            $eTagString = md5($lastModified->getTimestamp());
        }

        $item
            ->setContent($content)
            ->setLastModified($lastModified)
            ->setETagString($eTagString);

        $this->getItemStorage()->set($item);

        $logHeaders = sprintf(
            '%s: %s, %s: %s',
            HttpHeaders::HEADER_LAST_MODIFIED,
            $item->getLastModified()->format(HttpHeaders::DATE_FORMAT_CREATE),
            HttpHeaders::HEADER_ETAG,
            $item->getETagString()
        );

        $this->log(__METHOD__ . ' Data stored for key ' . $key . '; Headers {' . $logHeaders . '}');

        // Return page content
        return $content;
    }
452900
public function write($name, $content)
    {
        $name = $this->getRealName($name);
        $directory = sprintf('%s%s', $this->buildDirectory, substr($name, 0, strrpos($name, '/')));
        $name = substr($name, strrpos($name, '/'));

        if (false === file_exists($directory)) {
            $this->filesystem->mkdir($directory);
        }

        file_put_contents(sprintf('%s/%s', $directory, $name), $content);
    }
1107694
private function addFromString($filename, $content)
    {
        $this->repository->addFromString($this->getInternalPath().$filename, $content);
    }
1326778
public function fileContent($content)
    {
        if (is_resource($this->fileContent)) {
            fclose($this->fileContent);
        }

        $this->fileContent = $content;

        if (is_resource($content) && empty($this->fileType)) {
            $this->fileType($this->getTypeFromResource($content));
        }

        return $this;
    }
691534
public function clientWrite($filename, $source)
    {
        $path = $this->clientPath($filename);
        file_put_contents($path, $source);
    }
1161144
public static function append( $path, $content ) 
	{
		if ( !is_dir( dirname( $path ) ) ) 
		{
			if ( !mkdir( dirname( $path ), 0755, true ) ) 
			{
				throw new CCException( "CCFile - could not create directory: ".dirname( $path ) );
			}
		}
		return file_put_contents( $path, $content, LOCK_EX | FILE_APPEND );
	}
360342
public function save($filename, $content) {
        if ($this->driver) {
            return $this->driver->save($filename, $content);
        }

        return false;
    }
765297
private function putContent($file, $content)
    {
        $this->ensureExists(dirname($file));
        touch($file);

        return file_put_contents($file, serialize($content));
    }