private function write($type, $contents, $directory = null)
    {
        // Will contain all of the files put together
        $file = '';

        // Derive the destination path
        $directory = $directory === null ? static::storageFolder() : ($directory . '/');
        $directory .= $type . '/';

        // Do we have one file or multiple?
        if(is_array($contents))
        {
            // Cycle through each of the files
            foreach($contents as $filename)
            {
                // Check if the file exists on it's own
                if(!file_exists($filename))
                {
                    $filename = $directory . $filename;    
                }
                
                // Keep appending the file's contents
                $file .= file_get_contents($filename);
            }
        }
        else
        {
            // Check if the file exists on it's own
            if(!file_exists($contents))
            {
                $contents = $directory . $contents;    
            }
            
            // Otherwise just read in the file
            $file .= file_get_contents($contents);
        }

        $filename = md5($file);

        // Make sure that the folder exists
        if(!file_exists($directory))
        {
            // It doesn't, so make it (allow us to write)
            mkdir($directory, 0777, true);
        }

        // Write the file to disk
        file_put_contents($directory . $filename, $file);

        // Return the file name
        return $filename;
    }