-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.php
More file actions
52 lines (42 loc) · 1.09 KB
/
bootstrap.php
File metadata and controls
52 lines (42 loc) · 1.09 KB
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
43
44
45
46
47
48
49
50
51
52
<?php
// Determine the root dir.
$root = dirname(__FILE__);
// Start the session.
session_start();
/**
* Propel, the database management system.
*/
require_once 'propel/Propel.php';
// Initialize Propel with the runtime configuration
Propel::init("$root/build/conf/rla-conf.php");
// Add the generated 'classes' directory to the include path
set_include_path("$root/build/classes" . PATH_SEPARATOR . get_include_path());
/**
* Twig, the template engine.
*/
require_once 'Twig/Autoloader.php';
Twig_Autoloader::register();
$loader = new Twig_Loader_Filesystem("$root/templates");
$twig = new Twig_Environment($loader, array(
'cache' => "$root/.cache",
'debug' => true,
));
/**
* Symfony classloader.
*/
require_once 'Symfony/Component/ClassLoader/UniversalClassLoader.php';
use Symfony\Component\ClassLoader\UniversalClassLoader;
$loader = new UniversalClassLoader();
$loader->useIncludePath(true);
$loader->register();
/**
* Autoloader for the Helper class.
*/
spl_autoload_register(function($class)
{
if ($class == 'Helper')
{
global $root;
require_once "$root/helper.php";
}
});