Convenience wrapper function for file_put_contents
@param string $file File name to write to
@param string $data Data to write into file
@param HTMLPurifier_Config $config
@return int|bool Number of bytes written if success, or false if failure.
349914
private function _write($file, $data, $config)
    {
        $result = file_put_contents($file, $data);
        if ($result !== false) {
            // set permissions of the new file (no execute)
            $chmod = $config->get('Cache.SerializerPermissions');
            if ($chmod !== null) {
                chmod($file, $chmod & 0666);
            }
        }
        return $result;
    }
872457
private function writeMeta(NodeInterface $file, $path, $contents, Config $config)
    {
        $content = $file->getNode('jcr:content');
        if (!$mimetype = $config->get('mimetype')) {
            if (is_string($contents)) {
                $mimetype = Util::guessMimeType($path, $contents);
            } else {
                $mimetype = null;
            }
        }
        $content->setProperty('jcr:mimeType', $mimetype);

        $type = 'file';
        $result = compact('mimetype', 'type', 'path');

        if ($encoding = $config->get('encoding')) {
            $result['encoding'] = $encoding;
            $content->setProperty('jcr:encoding', $encoding);
        }
        if($timestamp = $config->get('timestamp')) {
            $result['timestamp'] = $timestamp;
            $content->setProperty('jcr:lastModified', $timestamp);
        }

        return $result;
    }
106477
public static function write(string $file = '', string $data = '', bool $doAppend = false): bool
    {
        $result = false;
        $file = static::normalizePath($file);
        if (static::verifyPath($file) && Directory::create(\dirname($file))) {
            $flags = $doAppend ? FILE_APPEND : 0;
            $flags |= static::$writeLocks ? LOCK_EX : 0;

            $result = @\file_put_contents($file, $data, $flags) !== false;
            @\chmod($file, static::$newFileMode);
        }
        return $result;
    }
1274890
protected function _fwrite($data, $length=null)
    {
        if ($length === null ) {
            fwrite($this->_fileHandle, $data);
        } else {
            fwrite($this->_fileHandle, $data, $length);
        }
    }
1123834
public function write($path, $contents, Config $config = null)
    {
        $result = $this->client->putObject($this->bucket, $path, $contents);
        if (!is_null($result)) {
            $type = 'file';
            $size = strlen($contents);

            return compact('contents', 'type', 'size', 'path');
        }

        return false;
    }
945789
public function dump($file, array $data)
    {
        $dir = dirname($file);

        if (!is_dir($dir)) {
            mkdir($dir, 0755, true);
        }

        $fileInfo = new SplFileInfo($file);

        if ($fileInfo->isFile()) {
            if ($fileInfo->isWritable()) {
                $fileObject = $fileInfo->openFile('w');
            } else {
                throw new Exception(sprintf('File "%s" is not writable.', $file));
            }
        } else {
            $fileObject = $fileInfo->openFile('w');
        }

        if (null !== $fileObject->fwrite('<?php return ' . var_export($data, true) . ';')) {
            return true;
        }

        return false;
    }
73433
private function writeToFile($file, $content, $origin = 'n/a')
    {
        return file_put_contents($file, $this->getFileSignature($origin) . $content);
    }
718463
protected function _write($file, $text) {
		$text = implode(PHP_EOL, $text);
		if ($this->settings['outputToTmp']) {
			$filename = pathinfo($file, PATHINFO_FILENAME);
			if (mb_substr($filename, -1, 1) === '_') {
				return false;
			}
			$file = pathinfo($file, PATHINFO_DIRNAME) . DS . $filename . '_.' . pathinfo($file, PATHINFO_EXTENSION);
		}
		return (bool)file_put_contents($file, $text);
	}
1070997
public function writeConfig(string $configFile, array $data): bool
    {
        $path = '/Private/Config/' . ucfirst(Str::lowerCase($configFile)) . '.php';
        if (!File::exist($path) || !File::writable($path)) {
            return false;
        }

        $saveData = '<?php return ' . Arr::exportVar($data) . ';';
        File::write($path, $saveData);
        // overload config values if changed
        $this->load($configFile, true);
        return true;
    }
528398
private static function write($name = '', $type = '', $message = '', $data = array(), $other = array())
    {
        $filePath = isset(self::$config[$name]) ? self::$config[$name] : '';
        if (empty($filePath)) {
            return false;
        }
        $directory = dirname($filePath);
        if (!file_exists($directory)) {
            mkdir($directory, 0777, true);
        }
        $string = sprintf(
            '[%s] %s.%s: %s %s %s%s',
            date('Y-m-d H:i:s'),
            $name,
            $type,
            $message,
            json_encode($data),
            json_encode($other),
            PHP_EOL
        );
        file_put_contents($filePath, $string, FILE_APPEND);
        return true;
    }
1038517
public static function write($file = false, $content = false) {

        if ($file && $content) {

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

                return true;
            }
        }

        return false;
    }
1141216
public function put($file, $content)
    {
        $file = $this->path($file);

        $dirname = dirname($file);

        $this->makeDirectory($dirname);

        return file_put_contents($file, $content);
    }
194521
public function write($file_name, $content = '')
    {
        if (!is_file($file_name)) {
            return false;
        }

        return file_put_contents($file_name, $content, LOCK_EX);
    }
938760
function write($file,array $data=NULL) {
		if (!$this->dir || $this->lazy)
			return count($this->data[$file]=$data);
		$fw=\Base::instance();
		switch ($this->format) {
			case self::FORMAT_JSON:
				$out=json_encode($data,JSON_PRETTY_PRINT);
				break;
			case self::FORMAT_Serialized:
				$out=$fw->serialize($data);
				break;
		}
		return $fw->write($this->dir.'/'.$file,$out);
	}
608929
protected function filePutContents(string $fileName, string $data): bool
    {
        return (bool)@file_put_contents($fileName, $data);
    }
754852
public function write($file = "")
    {
        $iniString = $this->generateIniString($this->config);
        file_put_contents($file ? $file : $this->filePath, $iniString);
    }
483487
public function write(string $data): int
    {
        $length = strlen($data);

        if (0 === $length) {
            return 0;
        }

        $written = @fwrite($this->handle, $data, $length);

        if (false === $written || $written !== $length) {
            $message = 'Could not write to the file.';
            if ($error = error_get_last()) {
                $message .= sprintf(' Errno: %d; %s', $error['type'], $error['message']);
            }
            throw new FileException($message);
        }

        return $written;
    }