2001-07-30 17:59:25 +02:00
|
|
|
<?php
|
2006-05-29 04:56:16 +02:00
|
|
|
/**
|
2016-05-01 17:56:49 +02:00
|
|
|
* EGroupware Setup
|
2006-05-29 04:56:16 +02:00
|
|
|
*
|
|
|
|
* @link http://www.egroupware.org
|
|
|
|
* @package setup
|
|
|
|
* @author Joseph Engo <jengo@phpgroupware.org>
|
|
|
|
* @author Dan Kuykendall <seek3r@phpgroupware.org>
|
|
|
|
* @author Mark Peters <skeeter@phpgroupware.org>
|
|
|
|
* @author Miles Lott <milos@groupwhere.org>
|
|
|
|
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
|
|
|
* @version $Id$
|
|
|
|
*/
|
2001-07-30 17:59:25 +02:00
|
|
|
|
2012-09-14 18:38:17 +02:00
|
|
|
error_reporting(error_reporting() & ~E_NOTICE & ~E_STRICT);
|
2005-03-25 10:21:23 +01:00
|
|
|
|
2008-08-13 09:19:32 +02:00
|
|
|
// for an old header, we need to setup the reference before including it
|
|
|
|
$GLOBALS['phpgw_info'] =& $GLOBALS['egw_info'];
|
|
|
|
|
|
|
|
$GLOBALS['egw_info'] = array(
|
|
|
|
'flags' => array(
|
|
|
|
'noheader' => True,
|
|
|
|
'nonavbar' => True,
|
|
|
|
'currentapp' => 'setup',
|
|
|
|
'noapi' => True
|
|
|
|
));
|
2020-03-04 21:20:50 +01:00
|
|
|
if(file_exists(__DIR__.'/../../header.inc.php'))
|
2008-08-13 09:19:32 +02:00
|
|
|
{
|
2020-03-04 21:20:50 +01:00
|
|
|
include_once(__DIR__.'/../../header.inc.php');
|
2008-08-13 09:19:32 +02:00
|
|
|
}
|
|
|
|
// for an old header we need to setup a reference for the domains
|
|
|
|
if (!is_array($GLOBALS['egw_domain'])) $GLOBALS['egw_domain'] =& $GLOBALS['phpgw_domain'];
|
2003-08-28 16:31:11 +02:00
|
|
|
|
2008-08-13 09:19:32 +02:00
|
|
|
/* If we included the header.inc.php, but it is somehow broken, cover ourselves... */
|
|
|
|
if(!defined('EGW_SERVER_ROOT') && !defined('EGW_INCLUDE_ROOT'))
|
|
|
|
{
|
|
|
|
if (defined('PHPGW_SERVER_ROOT') && defined('PHPGW_INCLUDE_ROOT')) // pre 1.2 install
|
2003-08-28 16:31:11 +02:00
|
|
|
{
|
2008-08-13 09:19:32 +02:00
|
|
|
define('EGW_SERVER_ROOT',PHPGW_SERVER_ROOT);
|
|
|
|
define('EGW_INCLUDE_ROOT',PHPGW_INCLUDE_ROOT);
|
2003-08-28 16:31:11 +02:00
|
|
|
}
|
2008-08-13 09:19:32 +02:00
|
|
|
else // no install
|
2001-07-30 17:59:25 +02:00
|
|
|
{
|
2011-06-07 10:02:06 +02:00
|
|
|
define('EGW_SERVER_ROOT',realpath('..'));
|
|
|
|
define('EGW_INCLUDE_ROOT',realpath('..'));
|
|
|
|
define('PHPGW_SERVER_ROOT',realpath('..'));
|
|
|
|
define('PHPGW_INCLUDE_ROOT',realpath('..'));
|
2001-07-30 17:59:25 +02:00
|
|
|
}
|
2008-08-13 09:19:32 +02:00
|
|
|
define('EGW_API_INC',EGW_SERVER_ROOT.'/phpgwapi/inc');
|
|
|
|
}
|
2001-07-30 17:59:25 +02:00
|
|
|
|
2016-05-02 16:41:48 +02:00
|
|
|
require_once(EGW_INCLUDE_ROOT . '/api/src/loader/common.php');
|
2001-07-30 17:59:25 +02:00
|
|
|
|
2008-08-13 09:19:32 +02:00
|
|
|
/**
|
|
|
|
* function to handle multilanguage support
|
|
|
|
*
|
|
|
|
*/
|
2020-03-04 21:19:33 +01:00
|
|
|
function lang($key,$vars=null)
|
2008-08-13 09:19:32 +02:00
|
|
|
{
|
2020-03-04 21:19:33 +01:00
|
|
|
if(!is_array($vars))
|
2001-07-30 17:59:25 +02:00
|
|
|
{
|
2020-03-04 21:19:33 +01:00
|
|
|
$vars = func_get_args();
|
|
|
|
array_shift($vars); // remove $key
|
2001-07-30 17:59:25 +02:00
|
|
|
}
|
2020-03-04 21:19:33 +01:00
|
|
|
return $GLOBALS['egw_setup']->translation->translate("$key", $vars);
|
2008-08-13 09:19:32 +02:00
|
|
|
}
|
2001-07-30 17:59:25 +02:00
|
|
|
|
2016-05-26 10:44:48 +02:00
|
|
|
if(file_exists(EGW_SERVER_ROOT.'/api/setup/setup.inc.php'))
|
2008-08-13 09:19:32 +02:00
|
|
|
{
|
2016-05-26 10:44:48 +02:00
|
|
|
include(EGW_SERVER_ROOT.'/api/setup/setup.inc.php'); /* To set the current core version */
|
2008-08-13 09:19:32 +02:00
|
|
|
/* This will change to just use setup_info */
|
2016-05-26 10:44:48 +02:00
|
|
|
$GLOBALS['egw_info']['server']['versions']['current_header'] = $setup_info['api']['versions']['current_header'];
|
2008-08-13 09:19:32 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-05-26 10:44:48 +02:00
|
|
|
$GLOBALS['egw_info']['server']['versions']['api'] = 'Undetected';
|
2008-08-13 09:19:32 +02:00
|
|
|
}
|
2001-07-30 17:59:25 +02:00
|
|
|
|
2008-08-13 09:19:32 +02:00
|
|
|
$GLOBALS['egw_info']['server']['app_images'] = 'templates/default/images';
|
2001-07-30 17:59:25 +02:00
|
|
|
|
2008-08-13 09:19:32 +02:00
|
|
|
CreateObject('setup.setup',True,True); // setup constuctor assigns itself to $GLOBALS['egw_setup'], doing it twice fails on some php4
|
|
|
|
$GLOBALS['phpgw_setup'] =& $GLOBALS['egw_setup'];
|
2012-10-26 10:50:07 +02:00
|
|
|
|
|
|
|
if (!function_exists('version_compare') || version_compare(PHP_VERSION,$GLOBALS['egw_setup']->required_php_version,'<'))
|
|
|
|
{
|
|
|
|
if (isset($_SERVER['HTTP_HOST'])) echo "<pre>\n";
|
|
|
|
echo "EGroupware now requires PHP {$GLOBALS['egw_setup']->required_php_version} or greater.\nYour PHP version is: ".PHP_VERSION."\n";
|
|
|
|
echo 'Please contact your System Administrator.';
|
|
|
|
exit;
|
|
|
|
}
|