Magrathea Singles

Sometimes we don't need a full project, with lots of pages, two thousand functionalities and an awesome layout.
Sometimes, all we need is a PHP script that does something and, maybe, prints a json file or saves humanity.

If you want to use all Magrathea's power for it, you also can do. Build a Magrathea Single.

All you have to do is to declare the variable $magratheaSingle as true before loading it:


	$magratheaSingle = true; 
	$magrathea_path = "/Users/path/to/Magrathea";

	// for database connection:
	$db = MagratheaDatabase::Instance()->SetConnection("", "mydb", "root", "password123");
	// as we don't have the log files, we ask for it to print the debug
	// but you can ask for log everything somewhere else! (see: MagratheaConfig)

	// from now on, it's with you!

	$sql = "SELECT * FROM tbl_user";
	$rs_user = $db->QueryAll($sql);

	// ...


Magrathea Singles doesn't start databases, config files or Smarty objects, so this is up to you. All classes, functions and other functionalities are available.

Sometimes it's good some simplicity. =)