1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* Legacy state manager for Panels.
|
5
|
*
|
6
|
* Checks all possible ways (using discovery of patterned method names) in which
|
7
|
* Panels may need to operate in legacy mode,
|
8
|
* sets variables as appropriate, and returns an informational
|
9
|
*
|
10
|
*/
|
11
|
class PanelsLegacyState {
|
12
|
var $legacy = NULL;
|
13
|
|
14
|
function t() {
|
15
|
$func = get_t();
|
16
|
$args = func_get_args();
|
17
|
return call_user_func_array($func, $args);
|
18
|
}
|
19
|
|
20
|
function getStatus() {
|
21
|
if (!isset($this->legacy)) {
|
22
|
$this->determineStatus();
|
23
|
}
|
24
|
return $this->legacy;
|
25
|
}
|
26
|
|
27
|
/**
|
28
|
* Run all compatibility checks.
|
29
|
*/
|
30
|
function determineStatus() {
|
31
|
$this->legacy = array();
|
32
|
foreach(get_class_methods($this) as $method) {
|
33
|
if (strtolower(substr($method, 0, 5)) == 'check') {
|
34
|
$this->legacy[$method] = $this->$method();
|
35
|
}
|
36
|
}
|
37
|
$this->legacy = array_filter($this->legacy);
|
38
|
}
|
39
|
|
40
|
// At this time there are no legacy checks.
|
41
|
}
|