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 |
Regular requestAction call using string url:
for ($i = 0; $i < 1000; $i++) {
$this->requestAction('/galleries/galleries/display/hello/world');
}
-------------------------------------------------------------------------------------------------------------------------------------------------
Regular requestAction call using array url:
for ($i = 0; $i < 1000; $i++) {
$this->requestAction(array('plugin' => 'galleries', 'controller' => 'galleries', 'action' => 'display', 'pass' => array('hello', 'world')));
}
-------------------------------------------------------------------------------------------------------------------------------------------------
Alternative requestAction call using string url:
for ($i = 0; $i < 1000; $i++) {
$this->rA('/galleries/galleries/display/hello/world');
}
-------------------------------------------------------------------------------------------------------------------------------------------------
Alternative requestAction call using array url:
for ($i = 0; $i < 1000; $i++) {
$this->rA(array('plugin' => 'galleries', 'controller' => 'galleries', 'action' => 'display', 'pass' => array('hello', 'world')));
}
-------------------------------------------------------------------------------------------------------------------------------------------------
Alternative requestAction by biesbjerg:
function rA($url) {
$url = Router::parse($url);
}
'plugin' => null,
'controller' => null,
'action' => 'index',
'prefix' => null
);
$import = $controller;
$import = $plugin . '.' . $controller;
}
if (!App::import('Controller', $import)) {
return false;
}
$action = $prefix . '_' . $action;
}
$className = Inflector::camelize($controller . 'Controller');
$Ctrl =& new $className();
$Ctrl->plugin = $plugin;
$Ctrl->params['requested'] = true;
$Ctrl->constructClasses();
case 0:
return $Ctrl->{$action}();
case 1:
return $Ctrl->{$action}($pass[0]);
case 2:
return $Ctrl->{$action}($pass[0], $pass[1]);
case 3:
return $Ctrl->{$action}($pass[0], $pass[1], $pass[2]);
case 4:
return $Ctrl->{$action}($pass[0], $pass[1], $pass[2], $pass[3]);
case 5:
return $Ctrl->{$action}($pass[0], $pass[1], $pass[2], $pass[3], $pass[4]);
default:
break;
}
} |
