forked from f3-factory/fatfree-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.php
30 lines (24 loc) · 571 Bytes
/
cli.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
<?php
$f3=require('lib/base.php');
$f3->route('GET /',function($f3){
echo 'Home';
if ($f3->exists('GET.color',$color))
echo ' is '.$color;
});
$f3->route('GET /web',function($f3){
echo '<h1>Web</h1>'.$f3->QUERY;
});
$f3->route('GET /log/@cmd',function($f3,$params){
echo $params['cmd'];
});
$f3->route('GET /debug/@cmd',function($f3,$params){
if ($params['cmd']=='uri')
echo rawurldecode($_SERVER['REQUEST_URI']);
if ($params['cmd']=='get') {
$str='';
foreach($f3->get('GET') as $k=>$v)
$str.=($str?',':'')."$k:$v";
echo $str;
}
});
$f3->run();