public static function generateConfig($settings, $variableName, $filePath)
    {
        $varStr = var_export($settings, true);
        
        $output = 
            '<?php' . PHP_EOL .
            '$' . $variableName . ' = ' . $varStr . ';';
        
        # file_put_contents returns num bytes written or boolean false if fail
        $wroteFile = file_put_contents($filePath, $output);
        
        if ($wroteFile === FALSE)
        {
            $msg = "Failed to generate config file. Check permissions!";
            throw new \Exception($msg);
        }
    }