1: <?php
2:
3: 4: 5: 6: 7: 8: 9: 10:
11:
12:
13:
14: 15: 16:
17: if (!defined('PHP_VERSION_ID')) {
18: $tmp = explode('.', PHP_VERSION);
19: define('PHP_VERSION_ID', ($tmp[0] * 10000 + $tmp[1] * 100 + $tmp[2]));
20: }
21:
22: if (PHP_VERSION_ID < 50200) {
23: throw new Exception('Nette Framework requires PHP 5.2.0 or newer.');
24: }
25:
26: error_reporting(E_ALL | E_STRICT);
27: @set_magic_quotes_runtime(FALSE);
28: iconv_set_encoding('internal_encoding', 'UTF-8');
29: extension_loaded('mbstring') && mb_internal_encoding('UTF-8');
30: @header('X-Powered-By: Nette Framework');
31:
32:
33:
34: 35: 36:
37:
38:
39: class NCFix
40: {
41: static $vars = array();
42:
43: static function uses($args)
44: {
45: self::$vars[] = $args;
46: return count(self::$vars)-1;
47: }
48: }
49:
50: define('NETTE', TRUE);
51: define('NETTE_DIR', dirname(__FILE__));
52: define('NETTE_VERSION_ID', 907);
53: define('NETTE_PACKAGE', 'PHP 5.2 prefixed');
54:
55:
56:
57: require_once dirname(__FILE__) . '/Utils/exceptions.php';
58: require_once dirname(__FILE__) . '/Utils/Framework.php';
59: require_once dirname(__FILE__) . '/Utils/Object.php';
60: require_once dirname(__FILE__) . '/Utils/ObjectMixin.php';
61: require_once dirname(__FILE__) . '/Utils/Callback.php';
62: require_once dirname(__FILE__) . '/Loaders/LimitedScope.php';
63: require_once dirname(__FILE__) . '/Loaders/AutoLoader.php';
64: require_once dirname(__FILE__) . '/Loaders/NetteLoader.php';
65:
66:
67: NNetteLoader::getInstance()->register();
68:
69:
70:
71: 72: 73: 74: 75: 76:
77: function callback($callback, $m = NULL)
78: {
79: return ($m === NULL && $callback instanceof NCallback) ? $callback : new NCallback($callback, $m);
80: }
81:
82:
83:
84: 85: 86:
87: function dump($var)
88: {
89: foreach (func_get_args() as $arg) NDebug::dump($arg);
90: return $var;
91: }
92: