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;
    }
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;
    }
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 ; }
Writes data to the filesystem.

@todo  Abstract this into a filesystem layer.

@param  string $path     The absolute file path to write to
@param  string $contents The contents of the file to write

@return boolean          Returns true if write was successful, false if not.
Writes data to the filesystem .