My favorites | Sign in
Project Logo
                
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
<?php
function include_dir($directory) {
foreach(scandir("$directory/") as $file) {
if(!strpos($file,".") == 0 && !is_dir($file)) {
include "$directory/$file";
}
}
}
// get config
include 'app/config.php';
// get core
include_dir('core/');
// for timer, etc
do_hooks('absolute_beginning');
// get helpers
include_dir('helpers');
// connect to database
if(!empty($config['database'])) {
$db = new Database($config['database'],$config['database_print_queries']);
}
// load application
include_dir('app/models');
include_dir('app/helpers');
// decide which controller, action, ident
$url = parse_request($config);
include 'app/routes.php';
// decide which format
if(!empty($_GET['format'])){
$format = $_GET['format'];
} else {
$format = $defaults['format'];
}
// revert to defaults if necessary
if(empty($controller)){$controller=$defaults['controller'];};
if(empty($action)){$action='index';};
// this will be included from wrapper.php
$view = "app/views/$format/$controller/$action.php";
if($action == 'list'){$action='all';}; // 'list' is already a php function
// load, initialize the main class
include "app/controllers/$controller-controller.php";
eval("\$controller = new $controller"."_controller();");
eval("\$controller -> $action();");
// get the show on the road
include "app/views/$format/layout.php";
// finish up
do_hooks('absolute_end');
?>
Show details Hide details

Change log

r60 by bonasaurus1 on Mar 27, 2008   Diff
added syntax highlighting, tweaks
Go to: 
Project members, sign in to write a code review

Older revisions

r47 by bonasaurus1 on Mar 22, 2008   Diff
re-added forum sample
All revisions of this file

File info

Size: 1378 bytes, 47 lines
Hosted by Google Code