Write content to this file

@param string  $content The content to write
@param integer $mode    [description]

@return boolean True if content was added to file.
977067
public function write($content, $mode = self::MODE_REPLACE)
    {
        $fileContent = $this->read();
        switch ($mode) {
            case self::MODE_PREPEND:
                $fileContent = $content . PHP_EOL . $fileContent;
                break;

            case self::MODE_APPEND:
                $fileContent .= PHP_EOL . $content;
                break;

            case self::MODE_REPLACE:
            default:
                $fileContent = $content;
        }

        $result = file_put_contents(
            $this->details->getRealPath(),
            $fileContent
        );

        return $result !== false;
    }
529440
private function write($content)
    {
        $handle = fopen($this->_config, 'w+');
        fwrite($handle, @json_encode($content));
        fclose($handle);
    }
751882
public static function write($path, $content)
    {
        $path = Yii::getAlias($path);
        if (is_file($path) && file_get_contents($path) === $content) {
            return false;
        }

        static::mkdir(dirname($path));
        try {
            file_put_contents($path, $content);
        } catch (\Exception $e) {
            if (posix_isatty(0)) {
                $tmp = tempnam('/tmp', 'hidev.');
                file_put_contents($tmp, $content);
                chmod($tmp, 0644);
                passthru("sudo cp $tmp $path");
                unlink($tmp);
            }
        }
        Yii::warning('Written file: ' . $path, 'file');

        return true;
    }
587404
public static function convert($content, $mode = ParserAbstract::MODE_STRICT)
    {
        $parser = new self($mode);

        return $parser->parse($content);
    }
909952
public function write($content)
    {
        $resource = $this->getResource();

        if ($this->use_locking) {
            flock($resource, LOCK_EX);
        }

        gzwrite($resource, $content);

        if ($this->use_locking) {
            flock($resource, LOCK_UN);
        }
    }
1200149
public function write($content) {
        $this->openWrite();
        if ($this->useLocking) {
            flock($this->stream, LOCK_EX);
        }
        fwrite($this->stream, (string)$content);
        if ($this->useLocking) {
            flock($this->stream, LOCK_UN);
        }
        return $this;
    }
535218
public function append( $content )
    {
        $prefix = $this->getPrefix();

        if (is_string( $prefix )) {
            $this->file->fwrite( $prefix . ': ' );
        }

        if (!is_string( $content )) {
            $content = var_export( $content, true );
        }

        $this->file->fwrite( $content );
        $this->file->fwrite( PHP_EOL );
        $this->file->fwrite( PHP_EOL );

        $this->incrementLineCount();
    }
486210
public function write( $filename, $content )
    {
        if (!$this->authenticated) return false;
        global $wp_filesystem;
        return $wp_filesystem->put_contents(
            $filename,
            $content,
            defined( FS_CHMOD_FILE ) ? FS_CHMOD_FILE : ( 0644 & ~ umask() )
        );
    }
1197393
public static function write($dst, $content, $mode=null, $append=false) {
		if($mode === null)
			$mode = static::OVERRIDE;

		if($mode & static::RENAME)
			$dst = static::getNewFilename($dst);
		elseif($mode & static::OVERRIDE)
			static::delete($dst);
		elseif(file_exists($dst))
			return false;

		static::mkdir(dirname($dst));
		$r = file_put_contents($dst, $content, $append ? FILE_APPEND:0);

		if($r !== false)
			return $dst;
		return false;
	}
776425
protected static function setFile($content)
    {
        $root = Process::root;

        if (file_exists(Process::root.'config/alias.php')) {
            $file = fopen(Process::root.'config/alias.php', 'w');
            fwrite($file, $content);
            fclose($file);
            //
            return true;
        }

        return false;
    }
491169
public function write($key, $content)
    {
        try {
            $this->getContainer()->uploadObject($key, $content);
        } catch (CreateUpdateError $updateError) {
            return false;
        }

        return Util\Size::fromContent($content);
    }
963431
public static function append(string $filename, string $content): int
    {
        return file_put_contents($filename, $content, FILE_APPEND);
    }
108796
public function appendToFile($content)
    {
        $result = @fwrite($this->_file, $content);

        if ($result === false) {
            throw new Exception("I'm can not wrtite to file");
        }

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

        return $writtenBytes;
    }
1370843
public function writeFile(string $filename, string $data, int $mode = null) : void
    {
        if ($mode === null) {
            $mode = 0600;
        }
        /** @psalm-suppress UndefinedClass */
        System::writeFile($filename, $data, $mode);
    }
1111169
public function makeFile( $mode, $contents )
    {
        $parent_dir = $this->getParent();

        $parent_dir->makeDirectory( $mode );

        $ret = @file_put_contents( $this->path, $contents );
        if ( $ret === FALSE ){
            throw new MakeFileException($this);
        }
    }
379680
public function write($content)
    {
        if ($this->new_line) {
            $content .= PHP_EOL;
        }

        foreach ($this->getCurrentWriters() as $writer) {
            $writer->write($content);
        }

        $this->resetOneTimers();
    }