Write the contents of a file.

@param  string $path
@param  string|resource $contents
@param  string $visibility
@return bool
974106
public function put( $path, $contents, $visibility = null )
	{
		if ( $visibility = $this->parseVisibility( $visibility ) )
		{
			$config = ['visibility' => $visibility];
		}
		else
		{
			$config = [];
		}

		if ( is_resource( $contents ) )
		{
			return $this->driver->putStream( $path, $contents, $config );
		}
		else
		{
			return $this->driver->put( $path, $contents, $config );
		}
	}
636071
public function write($path, $contents, array $config = [])
    {
        return $this->fileSystem->write($path, $contents, $config);
    }
682088
public function update($path, $contents, Config $config)
    {
        if (! $config->has('visibility') && ! $config->has('ACL')) {
            $config->set(static::$metaMap['ACL'], $this->getObjectACL($path));
        }
        // $this->delete($path);
        return $this->write($path, $contents, $config);
    }
1318670
public function put($path, $contents)
    {
        $path = self::validatePath($path);
        $fullPath = $this->getMediaPath($path);
        return $this->getStorageDisk()->put($fullPath, $contents);
    }
630196
protected static function putFile($path, $content): void
    {
        if (file_exists($path) && $content === file_get_contents($path)) {
            return;
        }
        if (!file_exists(dirname($path))) {
            mkdir(dirname($path), 0777, true);
        }
        if (false === file_put_contents($path, $content)) {
            throw new FailedWriteException("Failed write file $path");
        }
    }
263043
private static function createAndWriteFile(string $path, string $contents)
    {
        $fileHandle = fopen($path, 'wb');
        if ($fileHandle === false) {
            throw new \RuntimeException('The file "' . $path . '" could not be opened for writing.', 1519851153);
        }

        fwrite($fileHandle, $contents);
        fclose($fileHandle);
    }
315266
public function write($content, $filename, $pathToFile = null, $mode = "w")
    {
        if ($pathToFile == null) {
            $pathToFile = $this->_filePath;
        }

        $this->createDir($pathToFile);

        $fileHandle = fopen($pathToFile."/".$filename, $mode);
        $success = fwrite($fileHandle, $content);
        fclose($fileHandle);

        return $success;
    }
985578
public function write($path, $contents, array $config = []) {
        return $this->getFileSystem()->write($path, $contents, $config);
    }
567075
protected function upload($path, $contents, $opts = []) {
        $location = $this->applyPathPrefix($path);
        try {
            $tmpfile = tmpfile();
            fwrite($tmpfile, $contents);
            $localFile = $this->getStreamUri($tmpfile);

            $obj = $this->client->simpleUpload($localFile, $location, $opts);
            fclose($tmpfile);
            return $this->normalizeResponse($obj);
        } catch (DropboxClientException $e) {
            return false;
        }
    }
766269
public function write($path, $contents, Config $config)
    {
        try {
            $this->getOss()->putObject($this->bucket, $path, $contents, $option = []);

            return true;
        }catch (OssException $e){

        }
        return false;
    }
594773
public function put(string $path, string $contents, array $config = []): bool
    {
        $path = $this->normalizePath($path);
        $config = $this->prepareConfig($config);

        if (! $this->exists($path)) {
            return $this->getAdapter()->update($path, $contents, $config);
        }

        return $this->getAdapter()->write($path, $contents, $config);
    }
1340357
public static function setVisibility(string $path, string $visibility)
    {
        $type = is_dir($path) ? 'dir' : 'file';
        $success = chmod($path, Filesystem::$permissions[$type][$visibility]);

        if ($success === false) {
            return false;
        }

        return true;
    }
684455
public static function put(string $path, string $contents, bool $lock = false): int
    {
        return file_put_contents($path, $contents, $lock ? LOCK_EX : 0);
    }
809848
public function createFile($path, $contents)
    {
        $path = str_replace(DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $path);

        $this->_io->out();

        $fileExists = is_file($path);
        if ($fileExists && empty($this->params['force']) && !$this->interactive) {
            $this->_io->out('<warning>File exists, skipping</warning>.');

            return false;
        }

        if ($fileExists && $this->interactive && empty($this->params['force'])) {
            $this->_io->out(sprintf('<warning>File `%s` exists</warning>', $path));
            $key = $this->_io->askChoice('Do you want to overwrite?', ['y', 'n', 'a', 'q'], 'n');

            if (strtolower($key) === 'q') {
                $this->_io->out('<error>Quitting</error>.', 2);
                $this->_stop();

                return false;
            }
            if (strtolower($key) === 'a') {
                $this->params['force'] = true;
                $key = 'y';
            }
            if (strtolower($key) !== 'y') {
                $this->_io->out(sprintf('Skip `%s`', $path), 2);

                return false;
            }
        } else {
            $this->out(sprintf('Creating file %s', $path));
        }

        $File = new File($path, true);

        try {
            if ($File->exists() && $File->writable()) {
                $File->write($contents);
                $this->_io->out(sprintf('<success>Wrote</success> `%s`', $path));

                return true;
            }

            $this->_io->err(sprintf('<error>Could not write to `%s`</error>.', $path), 2);

            return false;
        } finally {
            $File->close();
        }
    }
55827
public function write($contents) {
		$dir = new Directory($this->getDirname());
		$dir->make();
	
		file_put_contents($this->pathname, $contents);
		return $this;
	}
617427
public function write(string $filename, string $contents): int
    {
        return (int)file_put_contents($filename, $contents);
    }
399123
public static function write($path, $content)
    {
        if (file_exists($path) && is_file($path) && !is_writable($path)) {
            return new PermissionDeniedException("$path is not writable");
        }

        $directory = dirname($path);

        if (!is_writable($directory)) {
            return new PermissionDeniedException("$directory is not writable");
        }

        file_put_contents($path, $content);
    }