Write the manifest array to a file.
@param string $file
@param array $manifest
19787
public function write($file, array $manifest)
    {
        $file = $this->vendorPath . '/' . $file;
        $array = var_export($manifest, true);
        file_put_contents($file, "<?php\n\nreturn $array;\n");
        $this->opcacheInvalidate($file);
    }
50099
protected function writeCacheFile($file, $content)
  {
    parent::writeCacheFile($file, $content);

    // Compile cached-file into bytecode-cache
    if (function_exists('apc_compile_file') === true) {
      apc_compile_file($file);
    }
  }
280039
protected function addResourceFile(string $file): void
    {
        if (!is_file($file)) {
            throw new \InvalidArgumentException("$file is not a file");
        }
        
        $contents = file_get_contents($file);
        
        if ($contents === false) {
            throw new \RuntimeException("Error reading file at $file.");
        }
        
        $this->addResourceString($contents);
    }
507813
public function write($file, $content = "", $mode = "w+")
    {

        $stream = $this->getFileStream($file, $mode);

        //Write the contents
        fwrite($stream, $content);
        fclose($stream);

        return true;
    }
88967
public function update(Manifest $manifest)
    {
        try {
            $this->fs->mirror(
                $this->pluginsDirectory . DIRECTORY_SEPARATOR . $manifest->getName() . DIRECTORY_SEPARATOR . 'public',
                $this->rootPath . DIRECTORY_SEPARATOR . 'www' . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . $manifest->getName()
            );
        } catch (IOException $e) {
            throw new RuntimeException(
                sprintf('Unable to copy assets for plugin %s', $manifest->getName()), $e->getCode(), $e
            );
        }
    }
181469
private function write_to($file, $data)
  {
    $handler = fopen($file, "w");
    fwrite($handler, $data);
    fclose($handler);
  }
486115
public static function write($file, $buffer)
    {
        @set_time_limit((int) ini_get('max_execution_time'));

        // If the destination directory doesn't exist we need to create it
        if (!is_dir(dirname($file))) {
            Folder::create(dirname($file));
        }

        $file = Path::clean($file);

        return is_int(file_put_contents($file, $buffer)) ? true : false;
    }
44640
def write_manifest(self, manifest_path=None, encrypted=None):
        
        manifest_path = manifest_path or self.manifest_path
        self.manifest['env']['PREDIXPY_VERSION'] = str(predix.version)

        with open(manifest_path, 'w') as output_file:
            if encrypted or self.encrypted:
                self.manifest['env']['PREDIXPY_ENCRYPTED'] = self.manifest_key
                content = self._get_encrypted_manifest()
            else:
                content = self.manifest   # shallow reference
                if 'PREDIXPY_ENCRYPTED' in content['env']:
                    del(content['env']['PREDIXPY_ENCRYPTED'])

            yaml.safe_dump(content, output_file,
                    default_flow_style=False, explicit_start=True)
            output_file.close()
831799
protected function saveConfig(array $config, $file)
    {
        $file = $this->vendorDir . '/' . $file;
        if (!file_exists(dirname($file))) {
            mkdir(dirname($file), 0777, true);
        }
        $array = var_export($config, true);
        file_put_contents($file, "<?php\n\nreturn $array;\n");
        $this->opcacheInvalidate($file);
    }
458925
def write_file(filename, contents):
    
    contents = "\n".join(contents)

    # assuming the contents has been vetted for utf-8 encoding
    contents = contents.encode("utf-8")

    with open(filename, "wb") as f:  # always write POSIX-style manifest
        f.write(contents)
781546
private function addToComponentManifest($version, array $component)
    {
        $manifest = $this->getManifest($this->manifest());
        $index = $this->getManifestComponentModuleIndex($manifest, $component['id']);

        array_unshift($manifest['modules'][$index]['versions'], 'v'. $version);

        $content = json_encode($manifest, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) ."\n";
        $result = file_put_contents($this->manifest(), $content);
        $this->setManifest($manifest);

        if (!$result) {
            throw new \RuntimeException('File write failed');
        }
    }
1227933
public function withTag($file)
    {
        $extension = pathinfo($file, PATHINFO_EXTENSION);

        try {
            $manifest = $this->readManifestFile();
        } catch (\Exception $e) {
            Craft::log(printf($e->getMessage()), LogLevel::Info, true);
            return $file;
        }

        // if no manifest, return the regular asset
        if (!$manifest) {
            if ($extension == 'js') {
                return '<script src="' . $this->buildPath . '/' . $file . '"></script>';
            }

            return '<link rel="stylesheet" href="' . $file . '">';
        }

        if ($extension == 'js') {
            return '<script src="' . $this->buildPath . '/' . $manifest[$file] . '"></script>';
        }

        return '<link rel="stylesheet" href="' . $this->buildPath . '/' . $manifest[$file] . '">';
    }
946851
public static function generateFile($file, array $content) {
		$string = static::buildIniString($content);

		return (bool)file_put_contents($file, $string);
	}
715608
public function appendToFile($file, $content)
    {
        if (! file_exists($file)) {
            throw new \Exception('File is missing');
        }
        file_put_contents($file, $content, FILE_APPEND);
    }
634703
public void writeManifest(final Manifest manifest) throws IOException {
        JarEntry entry = new JarEntry("META-INF/MANIFEST.MF");
        writeEntry(entry, new EntryWriter() {
            @Override
            public void write(OutputStream outputStream) throws IOException {
                manifest.write(outputStream);
            }
        });
    }
1329205
function writeManifest (archive, manifest, cb) {
  manifest = generateManifest(manifest)
  return writeFile(archive, DAT_MANIFEST_FILENAME, JSON.stringify(manifest, null, 2), cb)
}
1333370
def _write_output_manifest(self, manifest, filestore_root):
        
        output = os.path.basename(manifest)
        fieldnames, source_manifest = self._parse_manifest(manifest)
        if 'file_path' not in fieldnames:
            fieldnames.append('file_path')
        with atomic_write(output, overwrite=True) as f:
            delimiter = b'\t' if USING_PYTHON2 else '\t'
            writer = csv.DictWriter(f, fieldnames, delimiter=delimiter, quoting=csv.QUOTE_NONE)
            writer.writeheader()
            for row in source_manifest:
                row['file_path'] = self._file_path(row['file_sha256'], filestore_root)
                writer.writerow(row)
            if os.path.isfile(output):
                logger.warning('Overwriting manifest %s', output)
        logger.info('Rewrote manifest %s with additional column containing path to downloaded files.', output)