Append.

@param string $filename
@param string $content
@return int
963431
public static function append(string $filename, string $content): int
    {
        return file_put_contents($filename, $content, FILE_APPEND);
    }
337170
public function send($filename, $content)
    {
        $client = $this->getClient();
        $result = new SummaryResult();

        try {
            $zipContent = $this->compress($filename.'.xml', $content);
            $params = [
                'fileName' => $filename.'.zip',
                'contentFile' => $zipContent,
            ];
            $response = $client->call('sendSummary', ['parameters' => $params]);
            $result
                ->setTicket($response->ticket)
                ->setSuccess(true);
        } catch (\SoapFault $e) {
            $result->setError($this->getErrorFromFault($e));
        }

        return $result;
    }
477508
public static function appendToFile(string $filePath, string $content, bool $withoutDuplicates = true): void
	{
		if ($withoutDuplicates && self::fileContains($filePath, $content)) {
			return;
		}

		self::insertIntoFile($filePath, $content, FILE_APPEND);
	}
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);
        }
    }
427848
public function appendContent($content, $code = 200)
    {
        if (!empty($content)) {
            $oldContent = $this->getContent();

            if (!empty($oldContent)) {
                if (!is_scalar($content)) {
                    $content = json_encode($content);
                }

                $this->toHTML();
                $content = $oldContent . $content;
            }

            $this->setContent($content, $code);
        }
        return $this;
    }
687006
public function dumpFile($filename, $content)
    {
        $dir = dirname($filename);

        if (!is_dir($dir)) {
            $this->mkdir($dir);
        }

        if (!is_writable($dir)) {
            throw new IOException(sprintf('Unable to write to the "%s" directory.', $dir), 0, null, $dir);
        }

        // Will create a temp file with 0600 access rights
        // when the filesystem supports chmod.
        $tmpFile = $this->tempnam($dir, basename($filename));

        if (false === @file_put_contents($tmpFile, $content)) {
            throw new IOException(sprintf('Failed to write file "%s".', $filename), 0, null, $filename);
        }

        @chmod($tmpFile, file_exists($filename) ? fileperms($filename) : 0666 & ~umask());

        $this->rename($tmpFile, $filename, true);
    }
1097522
public static function writeFile($fileName, $content, $flags = 0)
    {
        if (Coroutine::isIn()) {
            return Coroutine::writeFile($fileName, $content, $flags);
        } else {
            return false !== file_put_contents($fileName, $content, $flags);
        }
    }
890378
public function update($filename, $content)
    {
        if ($this->exists($filename) && $this->isFile($filename)) {
            return $this->create($filename, $content);
        }

        throw new FileNotFoundException('File not found in the path [ ' . $filename . ' ].');
    }
1129099
public function append($content)
    {
        $content = self::create($content);
        $newnodes = array();
        foreach ($this as $i => $node) {
            /** @var \DOMNode $node */
            foreach ($content as $newnode) {
                /** @var \DOMNode $newnode */
                $newnode = static::importNewnode($newnode, $node, $i);
                $node->appendChild($newnode);
                $newnodes[] = $newnode;
            }
        }
        $content->clear();
        $content->add($newnodes);
        return $this;
    }
1358795
def append(self, filename, content, binary=False):
        """"""

        self._raise_if_none()
        fn = path_join(self.path, filename)

        if binary:
            flags = 'ab'
        else:
            flags = 'a'

        with open(fn, 'a') as f:
            f.write(content)
            return True
673252
public function write($content)
    {
        $this->openForWrite();
        $writtenBytes = $this->file->fwrite($content);

        return $writtenBytes;
    }
978646
public function writeBase64 ($content)
    {
        $parts = explode(',', $content);
        if(count($parts) > 1) {
            $base64_encoded = $parts[1];
            $this->writeOver(base64_decode($base64_encoded));
            return self::FILE_CREATE_SUCCESS;
        } else {
            return self::FILE_CREATE_ERROR;
        }

    }
33670
public function appendSection($name, $content = null)
    {
        $section = $this->getSectionCollection()->findOrCreate($name);

        $content ? $section->appendContent($content) : $section->start();
    }
1251770
public function createFile($filename, $content)
    {
        if (false === $this->createDirectory(dirname($filename))) {
            return false;
        }

        Silencer::call('file_put_contents', $filename, $content);
        Silencer::call('chmod', $filename, 0755);

        return true;
    }
827537
protected function saveInCache($filename, $content)
    {
        if (empty($this->cacheDir) || ! is_dir($this->cacheDir) || ! is_writable($this->cacheDir)) {
            return false;
        }

        $content["_chk"] = filemtime($filename);

        file_put_contents(
            $this->cacheDir . DIRECTORY_SEPARATOR . basename($filename) . ".cache",
            "<?php return " . var_export($content, true) . ";"
        );

        return true;
    }
922336
static function append_file($file_path_and_name, $file_content, $overwrite = false)
    {
        echo ("Appending the file: ".$file_path_and_name.PHP_EOL);
        if ($overwrite) {
            file_put_contents($file_path_and_name, $file_content);
        } else {
            file_put_contents($file_path_and_name, $file_content, FILE_APPEND);
        }
    }
1346747
public function appendContent($content)
    {
        if ($this->isVoid) {
            throw new Exception\RuntimeException(
                'Void elements can\'t contain content.'
            );
        }

        $this->content .= $content;

        return $this;
    }