文件追加写入
@access public
@param string $filename  文件名
@param string $content  追加的文件内容
@return boolean
971968
public function append($filename,$content,$type=''){
        if($old_content = $this->read($filename,$type)){
            $content =  $old_content.$content;
        }
        return $this->put($filename,$content,$type);
    }
1312905
public boolean add(String fileName) {
      writeLock.lock();
      try {
         return filenames.add(fileName);
      } finally {
         writeLock.unlock();
      }
   }
1107694
private function addFromString($filename, $content)
    {
        $this->repository->addFromString($this->getInternalPath().$filename, $content);
    }
969623
public static function detectByContent($content)
	{
		if (!class_exists('Finfo'))
		{
			return;
		}

		$finfo = new Finfo(FILEINFO_MIME_TYPE);
		$mimeType = $finfo->buffer($content);

		return $mimeType ?: null;
	}
724868
public function writeFile($file, $content)
    {
        $this->ensureDir(dirname($file));

        file_put_contents($file, $content);
    }
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;
    }
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);
    }
785129
public function input($filename, $content)
    {
        $this->_currentFile = $filename;
        return preg_replace_callback(
            $this->_pattern,
            array($this, '_replace'),
            $content
        );
    }
661410
protected function _updateFile($fileName, $content)
    {
        $oldContent = null;
        if (file_exists($fileName)) {
            $oldContent = file_get_contents($fileName);
        }

        if ($content !== $oldContent) {
            file_put_contents($fileName, $content);
        }

        return $fileName;
    }
379771
public static function write($filename, $content, $mode = 0666)
    {
        self::ensureFileSystem()->dumpFile($filename, $content, $mode);
    }
118239
public function append($filename, $content)
    {
        if ($this->exists($filename) && $this->isFile($filename)) {
            return file_put_contents($filename, $content, FILE_APPEND);
        }

        throw new FileNotFoundException('File not found in the path [ ' . $filename . ' ].');
    }
1185989
public function put($file, $content)
    {
        $stream = $this->readStream($file);
        fwrite($stream, $content);
        rewind($stream);

        $result = $this->writeStream($file, $stream);
        fclose($stream);

        return $result;
    }
221182
public static function writeFile($filename, $content, $type = 1)
    {
        if ($type == 1) {
            is_file($filename) && self::delFile($filename); //删除文件
            self::createFile($filename);
            self::writeFile($filename, $content, 2);
            return true;
        } else {
            if (!is_writable($filename)) return false;
            $handle = fopen($filename, 'a');
            if (!$handle) return false;
            $result = fwrite($handle, $content);
            if (!$result) return false;
            fclose($handle);
            return true;
        }
    }
520138
public function addFile($filename, $localname = null)
    {
        if ((file_exists($this->filename) && !is_writable($this->filename))
            || !file_exists($filename)) {
            return false;
        }
        return $this->zipArchive->addFile($filename, $localname);
    }
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);
	}
472178
public static function append(string $file, string $content): int
    {
        if (!self::exists(dirname($file))) {
            self::mkDir(dirname($file));
        }
        return file_put_contents($file, $content, FILE_APPEND);
    }
81123
public static function appendContents($filename, $contents)
    {
        $result = file_put_contents($filename, $contents, \LOCK_EX | \LOCK_NB | \FILE_APPEND);
        if ($result === false) {
            throw new \RuntimeException("Cannot append to the file: " . $filename);
        }
    }