public function write(string $uri, $data)
    {
        // Create directory recursively if it doesn't exist
        if ( ! file_exists(dirname($uri))) {
            mkdir(dirname($uri), 0755, true);
        }

        // Write file to target directory
        if ( ! file_put_contents($uri, $data)) {
            throw new ErrorException("Failed to write output to file: ".$uri);
        }

        return true;
    }
public function write(string $uri, $data)
    {
        // Create directory recursively if it doesn't exist
        if ( ! file_exists(dirname($uri))) {
            mkdir(dirname($uri), 0755, true);
        }

        // Write file to target directory
        if ( ! file_put_contents($uri, $data)) {
            throw new ErrorException("Failed to write output to file: ".$uri);
        }

        return true;
    }
public function write ( string $ uri , $ data ) { // Create directory recursively if it doesn't exist if ( ! file_exists ( dirname ( $ uri ) ) ) { mkdir ( dirname ( $ uri ) , 0755 , true ) ; } // Write file to target directory if ( ! file_put_contents ( $ uri , $ data ) ) { throw new ErrorException ( "Failed to write output to file: " . $ uri ) ; } return true ; }
Write the data to the storage engine
@param  string $uri  The URI handle
@param  mixed $data  The data in whatever format encode outputted
@return boolean      Whether it was a successful write or not
Write the data to the storage engine