-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbootstrap.php
42 lines (32 loc) · 1.24 KB
/
bootstrap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
namespace Pmeth\RBI;
error_reporting(E_ALL);
use Respect\Validation\Validator as v;
use Pmeth\Common;
//function classAutoload($class_name) {
// require_once("classes/$class_name.class.php");
//}
//
//spl_autoload_register('classAutoload');
set_include_path('library' . PATH_SEPARATOR . get_include_path());
require('SplClassLoader.php');
$classLoader = new \SplClassLoader();
$classLoader->setIncludePathLookup(true);
$classLoader->setMode(\SplClassLoader::MODE_SILENT);
$classLoader->register();
$request = new Common\Request();
// Start - You can probably comment out the next few lines of code if you don't intend on having logins
$db = new \PDO('mysql:dbname=rbi;host=127.0.0.1', 'root', '');
$user = new Common\User($db, null, null);
$serialized_user = $request->getSessionVar('user');
if ($serialized_user) {
// note: if i do unserialize($serialized_user) instead, it will be an incomplete class.
$user->unserialize($serialized_user);
}
// End - You can probably comment out the next few lines of code if you don't intend on having logins
try {
$myrom = new RBI3AndyBRom("../rbi2008.nes");
//$myrom = new RBI30TeamRom("../RBI2011.nes");
} catch (Exception $e) {
die('An error occurred. Here are the details: ' . $e->getMessage());
}