-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
39 lines (32 loc) · 1.06 KB
/
index.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
<?php
//debugging/ developing?
$symvcDebug = true;
//autoload Container, DI classes and Model classes
function __autoload($class){
if($class == 'Container'){
require 'components/Container/Container.php';
}
else if(strpos($class, 'sfService') === 0){
require 'components/dependency-injection/lib/'.$class.'.php';
}
else{
require 'application/Model/'.$class.'.php';
}
}
//create the container
$container = new Container();
//if debugging create symvcConfig class otherwise just include it
if($symvcDebug){
$container->parseYaml();
require_once 'application/config/symvcConfig.php';
}else{
require_once 'application/config/symvcConfig.php';
}
//create a sfServiceContainerBuilder
$sc = $container->serviceContainerBuilder();
//register services here
//....
//....
//register the controller and pass it the service container and any get/post variables
$container->registerController($sc, $_POST, $_GET);
?>