22 defined(
'XOOPS_ROOT_PATH') or die('Restricted access');
26 var $paths = array(
'XOOPS' => array(),
'www' => array(),
'var' => array(),
'lib' => array(),
'modules' => array(),
'themes' => array());
31 function xos_kernel_Xoops2()
33 $this->paths[
'XOOPS'] = array(XOOPS_PATH, XOOPS_URL .
'browse.php');
34 $this->paths[
'www'] = array(XOOPS_ROOT_PATH, XOOPS_URL);
35 $this->paths[
'var'] = array(XOOPS_VAR_PATH, null);
36 $this->paths[
'lib'] = array(XOOPS_PATH, XOOPS_URL .
'browse.php');
37 $this->paths[
'modules'] = array(XOOPS_ROOT_PATH .
'/modules', XOOPS_URL .
'/modules');
38 $this->paths[
'themes'] = array(XOOPS_ROOT_PATH .
'/themes', XOOPS_URL .
'/themes');
44 function path(
$url, $virtual =
false)
48 @list($root,
$path) = explode(
'/',
$url, 2);
49 if (!isset($this->paths[$root])) {
57 return !isset($this->paths[$root][1] ) ?
'' : ($this->paths[$root][1] .
'/' .
$path);
65 return (
false !== strpos(
$url,
'://') ?
$url : $this->path(
$url,
true));
71 function buildUrl(
$url, $params = array() )
76 $split = explode(
'?',
$url);
77 if (count($split) > 1) {
80 $params = array_merge(
$query, $params);
82 if (!empty($params)) {
83 foreach ($params as $k => $v) {
84 $params[$k] = $k .
'=' . rawurlencode($v);
86 $url .=
'?' . implode(
'&', $params);
96 function pathExists(
$path, $error_type)
98 if (file_exists(
$path)) {
111 function gzipCompression()
116 if (empty(
$_SERVER[
'SERVER_NAME']) || substr(PHP_SAPI, 0, 3) ==
'cli') {
120 if (
xoops_getConfigOption(
'gzip_compression') == 1 && extension_loaded(
'zlib') && !ini_get(
'zlib.output_compression')) {
121 if (@ini_get(
'zlib.output_compression_level') < 0) {
122 ini_set(
'zlib.output_compression_level', 6);
124 ob_start(
'ob_gzhandler');
133 function pathTranslation()
139 if (!isset(
$_SERVER[
'PATH_TRANSLATED']) && isset(
$_SERVER[
'SCRIPT_FILENAME'])) {
141 }
else if (isset(
$_SERVER[
'PATH_TRANSLATED']) && !isset(
$_SERVER[
'SCRIPT_FILENAME'])) {
147 if (empty(
$_SERVER[
'REQUEST_URI'])) {
152 if (isset(
$_SERVER[
'QUERY_STRING'])) {
163 function themeSelect()