library.php
2.53 KB
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
<?php
function n2_exit($exit = false) {
N2Pluggable::doAction('exit');
if ($exit) {
exit;
}
}
defined("NDS") || define('NDS', DIRECTORY_SEPARATOR);
defined("N2LIBRARY") || define('N2LIBRARY', dirname(__FILE__));
defined('N2LIBRARYASSETS') || define('N2LIBRARYASSETS', realpath(N2LIBRARY . NDS . '../media'));
defined('N2GSAP') || define('N2GSAP', 1);
function n2_floatval($string) {
return json_encode(floatval($string));
}
function n2_ob_end_clean_all() {
$handlers = ob_list_handlers();
while (count($handlers) > 0 && $handlers[count($handlers) - 1] != 'ob_gzhandler' && $handlers[count($handlers) - 1] != 'zlib output compression') {
ob_end_clean();
$handlers = ob_list_handlers();
}
}
require_once N2LIBRARY . NDS . 'loader.php';
N2Loader::import("platform", "platform");
N2Loader::import("nextend");
N2Loader::import("libraries.filesystem.filesystem");
N2Loader::import('libraries.string');
N2Loader::import("libraries.mvc.base");
N2Loader::import('libraries.session.session');
N2Loader::import('libraries.plugin.plugin');
N2Loader::import('libraries.base64');
N2Loader::import('libraries.data.data');
N2Loader::import("libraries.router.router");
N2Loader::import('libraries.request');
N2Loader::import('libraries.ajax.ajax');
N2Loader::import("libraries.helpers.system");
N2Loader::import("libraries.mvc.model");
N2Loader::import("libraries.helpers.html");
N2Loader::import('libraries.storage.section');
N2Loader::import('settings');
N2Loader::import('libraries.localization.localization');
N2Loader::import('libraries.translation.translation');
N2Loader::import('libraries.form.form');
N2Loader::import('libraries.form.form');
N2Loader::import('libraries.plugin.plugin');
N2Loader::import('libraries.fonts.renderer');
N2Loader::import('libraries.stylemanager.renderer');
require_once dirname(__FILE__) . '/applications/system/plugins/loadplugin.php';
N2Loader::import("libraryafter", "platform");
if (defined('NEXTEND_CACHE_STORAGE') && isset($_GET['nextendcache']) && !empty($_GET['g']) && !empty($_GET['k'])) {
N2Loader::importAll('libraries.cache');
$sectionStorage = N2Cache::getStorage('database');
$data = $sectionStorage->get($_GET['g'], $_GET['k'], 'web');
if (empty($data)) {
header("HTTP/1.0 404 Not Found");
exit;
}
if (substr($_GET['k'], -4, 4) == '.css') {
header("Content-type: text/css", true);
} else if (substr($_GET['k'], -3, 3) == '.js') {
header("Content-Type: application/javascript", true);
}
echo $data;
exit;
}