JamesMoss\Flywheel\Repository::write PHP Method

write() protected method

Writes data to the filesystem.
protected write ( string $path, string $contents ) : boolean
$path string The absolute file path to write to
$contents string The contents of the file to write
return boolean Returns true if write was successful, false if not.
    protected function write($path, $contents)
    {
        $fp = fopen($path, 'w');
        if (!flock($fp, LOCK_EX)) {
            return false;
        }
        $result = fwrite($fp, $contents);
        flock($fp, LOCK_UN);
        fclose($fp);
        return $result !== false;
    }