public static function putContents($filename, $contents)
    {
        $result = file_put_contents($filename, $contents, \LOCK_EX | \LOCK_NB);
        if ($result === false) {
            throw new \RuntimeException("Cannot write the file: " . $filename);
        }
    }
public static function putContents($filename, $contents)
    {
        $result = file_put_contents($filename, $contents, \LOCK_EX | \LOCK_NB);
        if ($result === false) {
            throw new \RuntimeException("Cannot write the file: " . $filename);
        }
    }
public static function putContents ( $ filename , $ contents ) { $ result = file_put_contents ( $ filename , $ contents , \ LOCK_EX | \ LOCK_NB ) ; if ( $ result === false ) { throw new \ RuntimeException ( "Cannot write the file: " . $ filename ) ; } }
Write to a file, and throw a RuntimeException if it cannot be done.

@param string $filename The path to the file
@param string $contents The data to write to the file

@return void
Write to a file and throw a RuntimeException if it cannot be done .