-
Notifications
You must be signed in to change notification settings - Fork 0
/
AdminClient.php
47 lines (43 loc) · 1.12 KB
/
AdminClient.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
<?php
error_reporting(E_ALL | E_STRICT);
ini_set("display_errors", 1);
// Autoload given function name.
function includeAll($className)
{
include_once($className . '.php');
}
spl_autoload_register('includeAll');
class AdminClient
{
private static $a,$b,$c,$d;
//client request
public static function request()
{
self::$a=isset($_POST["insert"]);
self::$b=isset($_GET["display"]);
self::$c=isset($_POST["edit"]);
self::$d=isset($_GET["preview"]);
//Use closures to determine course of action
$kappa=function() {$gamma= self::$c ? 'AdminEdit' : 'AdminPreview';
return $gamma;};
$iota = function() use($kappa) {$beta=self::$b ? 'AdminDisplayAll' : $kappa();
return $beta;};
$lambda = function($x) use ($kappa, $iota) {
$alpha = $x ? 'AdminDataEntry' : $iota();
return $alpha;};
self::clearSet();
$clas=$lambda(self::$a);
$job = new $clas();
$context=new AdminContext();
$context->adminInterface($job);
}
private static function clearSet()
{
unset($_POST["insert"]);
unset($_GET["display"]);
unset($_POST["edit"]);
unset($_GET["preview"]);
}
}
AdminClient::request();
?>