Write the contents of the legacy config

@param   string  $file
@return  bool
480157
public function update($file = null)
	{
		$file = ($file ?: $this->file);

		$contents = $this->toString('PHP', array('class' => 'JConfig', 'closingtag' => false));
		$original = '0640';

		if (is_file($file))
		{
			// Track original permissions
			$original = '0' . decoct(fileperms($file) & 0777);

			// First try and make sure the file is writable
			@chmod($file, octdec('0640'));
		}

		$result = file_put_contents($file, $contents);

		if (is_file($file))
		{
			@chmod($file, octdec($original));
		}

		return $result;
	}
1174239
public static function merge($file)
    {
        if (file_exists($file)) {
            $config = c::get('boomcms', []);
            c::set('boomcms', array_merge_recursive(include $file, $config));
        }
    }
927313
public function setGlobPatternFromFile($file)
    {
        if (!is_file($file)) {
            $message = "Glob pattern file {$file} doesn't exist.";
            throw new NonExistentGlobPatternFile($message);
        }

        $globPatternContent = (string) file_get_contents($file);

        $globPatternLines = preg_split(
            '/\\r\\n|\\r|\\n/',
            $globPatternContent
        );

        $globPatterns = [];
        array_filter($globPatternLines, function ($line) use (&$globPatterns) {
            if (trim($line) !== '') {
                $globPatterns[] = trim($line);
            }
        });

        $globPattern = '{' . implode(',', $globPatterns) . '}*';

        try {
            $this->setGlobPattern($globPattern);

            return $this;
        } catch (InvalidGlobPattern $e) {
            $message = "Glob pattern file '{$file}' is invalid.";
            throw new InvalidGlobPatternFile($message);
        }
    }
940203
private function shouldCopyFileInstead($file)
    {
        // Check if it should not be processed.
        if ($this->isExcludedFromVerbatim($file)) {
            return false;
        }

        foreach ($this->copyVerbatimPatterns as $pattern) {
            if (Str::is($pattern, $file)) {
                return true;
            }
        }

        return false;
    }
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;
    }
754384
public function write($file = "")
    {
        $envString = $this->generateEnvString($this->lines);
        file_put_contents($file ? $file : $this->filePath, $envString);
    }
87616
public function ignoredByGlob($file)
    {
        $lfile = $file;
        if (strpos($lfile, './') === 0) {
            $lfile = substr($lfile, 2);
        }
        foreach ($this->ignoreFile as $line) {
            if (strpos($lfile, $line) === 0) {
                return true;
            }
        }
        return false;
    }
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);
	}
593804
public function rmFile($file)
    {

        if (!is_file($file)) {
            $this->errorMsg = "this is not a file";
            return false;
        }
        if (unlink($file)) {
            return true;
        } else {
            $this->errorMsg = "fail to remove the file!";
            return false;
        }
    }
1354698
public function mutateFile(File &$file)
    {
        // If markdown file has a layout associated with it, we need to ensure it gets rendered within that
        if ($file->hasData('layout')) {
            $file->setExt('phtml');     // Templates are managed by the phtml renderer
            $file->setRendered(false);  // Set rendered to false so that within Compile.php's Execute Renderers loop it gets re-rendered
        }
    }
1349855
public static function checkFile($file)
    {
        if (Symphony::Log()) {
            Symphony::Log()->pushDeprecateWarningToLog('General::checkFile()', '`General::checkFileWritable()');
        }
        clearstatcache();
        $dir = dirname($file);

        if (
            (!is_writable($dir) || !is_readable($dir)) // Folder
            || (file_exists($file) && (!is_readable($file) || !is_writable($file))) // File
        ) {
            return false;
        }

        return true;
    }
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);
	}
1236653
private function cacheIsExpired($file)
	{
		if(Config::get('@.TEMPLATE_CACHE_ON') && is_file($file))
		{
			return filemtime($file) + Config::get('@.TEMPLATE_CACHE_EXPIRE') < $_SERVER['REQUEST_TIME'];
		}
		else 
		{
			return true;
		}
	}
999880
public function storeFile($file)
    {
        $filename = md5($this->id);
        $data = file_get_contents($file->tmp_name);

        if ($this->getFileName() == $this->name) {
            $this->name = $file->name;
        }

        $file->append(array(
            'type' => mime_content_type($file->name),
        ));

        $this->mimeType = $file->type;
        $this->setValue('file_name', $file->name);
        $this->fileSize = strlen($data);
        $this->writeData($filename, $data, false);
    }
605683
private function initialize($file)
    {
        if (file_exists($file)) {
            $this->file = realpath($file);
            return false;
        }
        file_put_contents($file, '');
        $this->file = realpath($file);
        return true;
    }
258904
public  function loadConfig($file){
		$config = include $file;
		$this->path = $config['path'];
		$this->compiled = $config['compiled'];
		$this->forceCompile = $config['forceCompile'];
		$this->skipCommentTags = $config['skipCommentTags'];
		$this->source_filename_extension = $config['source_filename_extension'];
		$this->dest_filename_extension = $config['dest_filename_extension'];
		if( !is_dir( $this->path )){
			mkdir( $this->path ,0777,true );
		}
		if( !is_dir( $this->compiled )){
			mkdir( $this->compiled ,0777,true );
		}
	}
259561
protected function _filePutContents($file, $string)
    {
        $result = false;
        $f = @fopen($file, 'ab+');
        if ($f) {
            if ($this->_options['file_locking']) @flock($f, LOCK_EX);
            fseek($f, 0);
            ftruncate($f, 0);
            $tmp = @fwrite($f, $string);
            if (!($tmp === FALSE)) {
                $result = true;
            }
            @fclose($f);
        }
        @chmod($file, $this->_options['cache_file_umask']);
        return $result;
    }