Commit a6b289eb authored by sept_7's avatar sept_7

[FIX] : better autodetection of tikiroot and tikibase

parent 60784239
......@@ -5277,6 +5277,7 @@ tiki/lib/setup/patches.php -text
tiki/lib/setup/polls.php -text
tiki/lib/setup/prefs.php -text
tiki/lib/setup/sections.php -text
tiki/lib/setup/set_paths.php -text
tiki/lib/setup/site_closed.php -text
tiki/lib/setup/stats.php -text
tiki/lib/setup/theme.php -text
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/lib/setup/absolute_urls.php,v 1.2 2007-10-10 13:30:52 sept_7 Exp $
// $Header: /cvsroot/tikiwiki/tiki/lib/setup/absolute_urls.php,v 1.3 2007-10-10 14:46:38 sept_7 Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for
......@@ -12,28 +12,6 @@ if (strpos($_SERVER['SCRIPT_NAME'],'tiki-setup.php')!=FALSE) {
exit;
}
/* Automatically set params used for absolute URLs - BEGIN */
$tmp = dirname(str_replace(dirname(dirname(dirname(__FILE__))),'',$_SERVER['SCRIPT_FILENAME']));
if ($tmp != '/') {
$dir_level = substr_count($tmp,"/");
} else {
$dir_level = 0;
}
unset($tmp);
$tikiroot = dirname($_SERVER['PHP_SELF']);
$tikipath = dirname($_SERVER['SCRIPT_FILENAME']);
if ($dir_level > 0) {
$tikiroot = preg_replace('#(/[^/]+){'.$dir_level.'}$#','',$tikiroot);
$tikipath = preg_replace('#(/[^/]+){'.$dir_level.'}$#','',$tikipath);
chdir(join('../',array_fill(0,$dir_level+1,'')));
}
if ( substr($tikiroot,-1,1) != '/' ) $tikiroot .= '/';
if ( substr($tikipath,-1,1) != '/' ) $tikipath .= '/';
if ( $https_port == 443 ) $https_port = '';
if ( $http_port == 80 ) $http_port = '';
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/lib/setup/set_paths.php,v 1.1 2007-10-10 14:46:38 sept_7 Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for
// details.
//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER['SCRIPT_NAME'],'tiki-setup.php')!=FALSE) {
header('location: index.php');
exit;
}
/* Automatically set params used for absolute URLs - BEGIN */
$tmp = dirname(str_replace(dirname(dirname(dirname(__FILE__))),'',$_SERVER['SCRIPT_FILENAME']));
if ($tmp != '/') {
$dir_level = substr_count($tmp,"/");
} else {
$dir_level = 0;
}
unset($tmp);
$tikiroot = dirname($_SERVER['PHP_SELF']);
$tikipath = dirname($_SERVER['SCRIPT_FILENAME']);
if ($dir_level > 0) {
$tikiroot = preg_replace('#(/[^/]+){'.$dir_level.'}$#','',$tikiroot);
$tikipath = preg_replace('#(/[^/]+){'.$dir_level.'}$#','',$tikipath);
chdir(join('../',array_fill(0,$dir_level+1,'')));
}
if ( substr($tikiroot,-1,1) != '/' ) $tikiroot .= '/';
if ( substr($tikipath,-1,1) != '/' ) $tikipath .= '/';
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-setup.php,v 1.468 2007-10-10 13:30:51 sept_7 Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-setup.php,v 1.469 2007-10-10 14:46:38 sept_7 Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for
......@@ -12,7 +12,7 @@ if (strpos($_SERVER['SCRIPT_NAME'],'tiki-setup.php')!=FALSE) {
exit;
}
require_once('lib/setup/absolute_urls.php');
require_once('lib/setup/set_paths.php');
require_once('lib/init/initlib.php');
if ( ! isset($_SESSION['votes']) ) $_SESSION['votes'] = array();
......@@ -27,8 +27,6 @@ require_once('lib/setup/tikisetup.class.php');
TikiSetup::prependIncludePath('lib');
TikiSetup::prependIncludePath('lib/pear');
//echo ini_get('include_path');
require_once('lib/setup/timer.class.php');
$tiki_timer = new timer();
$tiki_timer->start();
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-setup_base.php,v 1.139 2007-10-07 16:28:20 nyloth Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-setup_base.php,v 1.140 2007-10-10 14:46:38 sept_7 Exp $
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -13,6 +13,8 @@ if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
die();
}
require_once('lib/setup/set_paths.php');
// ---------------------------------------------------------------------
// basic php conf adjustment
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment