Writes the given content into the file.

@param string $key
@param string $content

@return int|bool The number of bytes that were written into the file
491169
public function write($key, $content)
    {
        try {
            $this->getContainer()->uploadObject($key, $content);
        } catch (CreateUpdateError $updateError) {
            return false;
        }

        return Util\Size::fromContent($content);
    }
386718
protected function writeFile(string $filename, string $content): void
    {
        try {
            $f = \fopen($filename, 'w');
            \fwrite($f, $content, \mb_strlen($content));
            \fclose($f);
        } catch (\Throwable $e) {
            throw new WriterException($e->getMessage(), $e->getCode(), $e);
        }
    }
311961
public function saveContent($key, $content)
    {
        $this->master->getFilesystem()->write($key, $content, true);

        foreach ($this->slaves as $slave) {
            $slave->getFilesystem()->write($key, $content, true);
        }
    }
172691
public function addPostFile($key, $file, $content = null)
    {
        $this->setMethod('POST');
        $this->setBody(null);
        if ($content === null && is_file($file)) {
            $content = @file_get_contents($file);
        }
        $this->_postFiles[$key] = [basename($file), $content];
    }
711543
public function addResponseContent(ResponseContent $content, $key = '')
    {
        if (empty($key)) {
            $this->responseContent[] = $content->toArray();
        } else {
            $this->responseContent[$key] = $content->toArray();
        }

        return $this;
    }
655300
public function write($content) {
        if (!$this->running) {
            throw new xml_output_exception('xml_output_not_started');
        }
        $lenc = strlen($content); // Get length in bytes
        if ($lenc == 0) { // 0 length contents, nothing to do
            return;
        }
        // Buffer handling if available
        $tooutput = true; // By default, perform output
        if ($this->usebuffer) { // Buffer
            $this->currentbuffer .= $content;
            $this->currentbuffersize += $lenc;
            if ($this->currentbuffersize < $this->buffersize) {
                $tooutput = false; // Still within the buffer, don't output
            } else {
                $content = $this->currentbuffer; // Prepare for output
                $lenc = $this->currentbuffersize;
                $this->currentbuffer = '';
                $this->currentbuffersize = 0;
            }
        }
        // Output
        if ($tooutput) {
            $this->send($content); // Efectively send the contents
            $this->sentbytes += $lenc;
        }
    }
402592
protected function write($destination, $content)
    {
        $directory = dirname($destination);

        if ( ! $this->files->exists($directory)) {
            $this->files->makeDirectory($directory, 0755, true);
        }

        return (bool) $this->files->put($destination, $content);
    }
421736
public static function put(string $filepath, string $content):int
    {
        if (!file_exists($filepath)) {
            Server::create($filepath, "file");
        }
        file_put_contents($filepath, $content);
        self::open($filepath);
        return (1);
    }
213908
public static function write( $file, $content, $key = null ) 
	{
		return CCFile::write( static::path( $file, $key ), $content );
	}
1038517
public static function write($file = false, $content = false) {

        if ($file && $content) {

            if (file_put_contents($file, $content)) {

                return true;
            }
        }

        return false;
    }
529434
protected function _write($path, $content)
    {
        $File = new File($path);
        $File->write($content);
        $File->exists();
    }
207658
public function addContent($content, $key = null)
    {
        if (!is_null($key)) {
            $this->contents[$key] = $content;
        } else {
            $this->contents[] = $content;
        }

        return $this;
    }
797325
private function write($src, $fileName, $content)
    {

        if (!$this->file->exists($src)) {
            $this->file->makeDirectory($src);
        }
        $this->file->put($fileName, $content);
    }
529440
private function write($content)
    {
        $handle = fopen($this->_config, 'w+');
        fwrite($handle, @json_encode($content));
        fclose($handle);
    }
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 !');
        }
    }
502298
public function write($key, $content)
    {
        $this->init();
        list($containerName, $key) = $this->tokenizeKey($key);

        if (class_exists(CreateBlockBlobOptions::class)) {
            $options = new CreateBlockBlobOptions();
        } else {
            // for microsoft/azure-storage < 1.0
            $options = new CreateBlobOptions();
        }

        if ($this->detectContentType) {
            $contentType = $this->guessContentType($content);

            $options->setContentType($contentType);
        }

        try {
            if ($this->multiContainerMode) {
                $this->createContainer($containerName);
            }

            $this->blobProxy->createBlockBlob($containerName, $key, $content, $options);
        } catch (ServiceException $e) {
            $this->failIfContainerNotFound($e, sprintf('write content for key "%s"', $key), $containerName);

            return false;
        }
        if (is_resource($content)) {
            return Util\Size::fromResource($content);
        }

        return Util\Size::fromContent($content);
    }
370348
public function writeContent($content, $overwrite = false)
    {

        if ($overwrite) {
            $fh = fopen($this->getPath(), 'w');
        } else {
            $fh = fopen($this->getPath(), 'w+');
        }
        fwrite($fh, $content);
        fclose($fh);
    }