<?php
//Let's see if we've got a database set up in settings.ini
try{
	ApplicationSettings::GetSetting("database", "database");
} catch(Exception $e){
	return;
}

include_once 'Model/DBObject.php';

class DBScriptRunner{
	public static function RunAllScripts(){
		$schemas=glob("DB Scripts/*.sql");

		$PDO=DBObject::GetPDO();
		foreach ($schemas as $schema)
			$PDO->query(file_get_contents($schema));
	}
	
	public static function RunScript($file) {
		$PDO=DBObject::GetPDO();
		$PDO->query(file_get_contents("DB Scripts/".$file));
	}
}