-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.template.php
More file actions
35 lines (29 loc) · 800 Bytes
/
Copy pathconfig.template.php
File metadata and controls
35 lines (29 loc) · 800 Bytes
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
<?php
#Bring in the Composer autoload files
require_once 'vendor/autoload.php';
#Our own autoloader
function model_loader($class) {
$base = dirname(__FILE__);
$class = explode('\\', $class);
require $base . "/" . strtolower($class[0]) . "/$class[1].class.php";
}
spl_autoload_register('model_loader');
session_start();
$host = '';
$dbname = '';
$user = '';
$pass = '';
try {
$DBH = new PDO("mysql:host=$host;dbname=$dbname", $user, $pass);
} catch(PDOException $e) {
echo $e->getMessage();
}
//force PDO to throw errors
$DBH->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
//Create a Mustache instance
$Mustache_Engine = new Mustache_Engine(array(
'loader' => new Mustache_Loader_FilesystemLoader(
dirname(__FILE__) . '/templates'
),
));
?>