Create file

@param string $content
@param Tolkien\Model\Node
@return void
423236
public function createFile($content, $node)
	{
		if(!file_exists(dirname($this->config['dir']['site'] . '/' . $node->getUrl())))
    	mkdir(dirname($this->config['dir']['site'] . '/' . $node->getUrl()), 0777, true);

    file_put_contents($this->config['dir']['site'] . '/' . $node->getUrl(), $content);
	}
656598
protected function saveFile($filename, $content)
    {
        if (!file_exists(dirname($filename))
            && mkdir(dirname($filename), 0777, true) === false
        ) {
            throw new GeneratorException(
                sprintf(
                    "Could not create directory '%s'.",
                    dirname($filename)
                )
            );
        }

        if (file_put_contents($filename, $content) === false) {
            throw new GeneratorException(
                sprintf(
                    "Could not open '%s' for writing.",
                    $filename
                )
            );
        }

        return $this;
    }
1347154
public function create(string $uri, string $content): PhpDocument
    {
        return new PhpDocument(
            $uri,
            $content,
            $this->projectIndex->getIndexForUri($uri),
            $this->parser,
            $this->docBlockFactory,
            $this->definitionResolver
        );
    }
165509
public function saveContent($source, $content) {
    $dest = "{$this->path}/content/{$content['id']}";

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

    self::copyFileTree($source, $dest);
  }
213908
public static function write( $file, $content, $key = null ) 
	{
		return CCFile::write( static::path( $file, $key ), $content );
	}
316279
protected function saveFile($filename, $content)
	{
		$filename = $this->dir . $filename; 
		$f = fopen($filename, "wb");
		if($f)
		{
			if(fwrite($f, $this->processForFile($content)))
			{
				fclose($f);
				chmod($filename, 0600);
				return true;
			}
			fclose($f);
		}
		return false;
	}
1309098
public function setContent($content)
    {
        $this->content = $content;
        $this->setHeader('content-length', strlen($this->content));
    }
1018464
public function dump($file, $content)
    {
        $fileWrited = file_put_contents($file, '<?php return ' . var_export($content, true) . ';');

        if ($fileWrited === false) {
            throw new \Exception('Unable to dump data into php file !');
        }
    }
1311438
public static function create(string $content): Stream
    {
        $resource = \fopen('php://temp', 'rwb+');
        $stream   = self::createFromResource($resource);
        $stream->write($content);

        return $stream;
    }
487413
protected function save($path, $content)
    {
        $newDirMode = 0755;
        $newFileMode = 0644;

        $dir = dirname($path);
        if (!is_dir($dir)) {
            $mask = @umask(0);
            $result = @mkdir($dir, $newDirMode, true);
            @umask($mask);
            if (!$result) {
                return "Unable to create the directory '$dir'.";
            }
        }
        if (@file_put_contents($path, $content) === false) {
            return "Unable to write the file '{$path}'.";
        } else {
            $mask = @umask(0);
            @chmod($path, $newFileMode);
            @umask($mask);
        }

        return true;
    }
846990
private function createLockFile($content = null)
    {
        if ($this->lockFile) {
            if ($content === null || ! is_string($content)) {
                $content = $this->getId();
            }

            file_put_contents($this->lockFile, $content);
        }
    }
959308
public function setInnerHtml($content)
    {
        $content = self::create($content);
        foreach ($this as $node) {
            $node->nodeValue = '';
            foreach ($content as $newnode) {
                /** @var \DOMNode $node */
                /** @var \DOMNode $newnode */
                $newnode = static::importNewnode($newnode, $node);
                $node->appendChild($newnode);
            }
        }
        return $this;
    }
871937
public function save($content)
    {
        $content = $this->_getHeader() . $content;
        $result  = file_put_contents($this->_resultFile, $content);

        if (!$result) {
            throw new Exception('JBZoo/Less: File not save - ' . $this->_resultFile); // @codeCoverageIgnore
        }
    }
505293
public static function createFile($file, $content = '')
    {
        $folder = dirname($file);
        if (!is_dir($folder)) {
            self::createFolder($folder);
        }

        file_put_contents($file, $content);
    }
673252
public function write($content)
    {
        $this->openForWrite();
        $writtenBytes = $this->file->fwrite($content);

        return $writtenBytes;
    }
454502
public function write($content)
    {
        if (!$this->isOpen()) {
            $this->open();
        }

        return fwrite($this->stream, $content);
    }
323159
protected function createText($content)
	{
		return (trim($content) === '')
		     ? $this->createElement('xsl:text', $content)
		     : $this->ownerDocument->createTextNode($content);
	}