- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 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
<?php
class Control {
const
ENV_VAR = 'REQUEST_URI',
DIR = _SCRIPT,
MAIN = 'default',
FILENAME_MASK = '%s.ctrl.php',
CHAR = '.';
private static function _parametrize(&$var) {
static $params = null;
(null === $params) && ($params =& self::$_params);
((is_numeric($var))
&& (($params[] = $var) || 1)
|| (self::CHAR === $var[0])
&& (($params[] = substr($var, 1)) || 1)
|| (false !== ($dot = strpos($var, self::CHAR)))
&& (($params[substr($var, 0, $dot)] = substr($var, $dot + 1)) || 1))
&& ($var = null);
}
public static function call($name, $_PARAMS = array()) {
static $_TPL = null;
(null === $_TPL) && ($_TPL =& $GLOBALS['_TPL']);
static $_DATA = null;
(null === $_DATA) && ($_DATA =& $GLOBALS['_DATA']);
static $_MY = -1;
(-1 === $_MY) && ($_MY =& $GLOBALS['_MY']);
$filename = self::DIR . '/' . sprintf(self::FILENAME_MASK, basename($name));
return (file_exists($filename) && include($filename));
}
}