forked from bcosca/fatfree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
114 lines (103 loc) · 2.22 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
$app=require __DIR__.'/lib/base.php';
$app->set('AUTOLOAD','inc/;inc/temp/');
$app->set('CACHE',FALSE);
$app->set('DEBUG',3);
$app->set('EXTEND',TRUE);
$app->set('EXTERNAL','bin/');
$app->set('FONTS','fonts/');
$app->set('GUI','gui/');
$app->set('LOCALES','dict/');
$app->set('PROXY',TRUE);
$app->set('TEMP','temp/');
$app->set('TZ','America/New_York');
$app->set('timer',microtime(TRUE));
$app->set('menu',
array(
'/'=>'Error Handling',
'globals'=>'Globals',
'f3vars'=>'F3 Variables',
'configure'=>'Configuration',
'redirect'=>'Routing',
'ecache'=>'Cache Engine',
'validator'=>'User Input',
'renderer'=>'Output Rendering',
'template'=>'Template Engine',
'axon'=>'SQL/Axon',
'jig'=>'Jig Mapper',
'm2'=>'M2 Mapper',
'matrix'=>'Matrix',
'unicode'=>'Unicode',
'graphics'=>'Graphics',
'geo'=>'Geo',
'google'=>'Google',
'web'=>'Web Tools',
'network'=>'Network',
'misc'=>'Miscellaneous',
'openid'=>'OpenID'
)
);
$app->route('GET /','Main->hotlink');
foreach ($app->get('menu') as $url=>$func)
if ($url!='/')
$app->route('GET /'.$url,'Main->'.$url);
$app->route('GET /error','Main->ehandler');
$app->route('GET /routing','Main->routing');
$app->route('GET /openid2','Main->openid2');
$app->route('GET /captcha',
function() {
Graphics::captcha(180,60,5);
}
);
$app->route('GET /identicon/@id/@size',
function() {
Graphics::identicon(f3::get('PARAMS.id'),f3::get('PARAMS.size'));
}
);
$app->route('GET /invert',
function() {
Graphics::invert('{{@GUI}}test.jpg');
}
);
$app->route('GET /thumb',
function() {
Graphics::thumb('{{@GUI}}large.jpg',256,192);
},60
);
$app->route('GET /screenshot',
function() {
Graphics::screenshot('http://www.yahoo.com',150,200);
}
);
$app->route('GET /google/map',
function() {
Google::staticmap('Brooklyn Bridge',12,'256x256');
}
);
$app->route('GET /minified/@script',
function() use($app) {
Web::minify($app->get('GUI'),array($app->get('PARAMS.script')));
}
);
$app->run();
class Obj {
function hello() {
echo 'hello';
}
}
class CustomObj {
function hello() {
echo 'hello';
}
function __toString() {
return 'CustomObj';
}
}
function first() {
global $flag;
$flag=FALSE;
F3::set('f3flag',FALSE);
}
function second() {
F3::set('f3flag','xyz');
}