Issues (4868)

setup/inc/functions.inc.php (1 issue)

Severity
1
<?php
2
/**
3
 * EGroupware Setup
4
 *
5
 * @link http://www.egroupware.org
6
 * @package setup
7
 * @author Joseph Engo <[email protected]>
8
 * @author Dan Kuykendall <[email protected]>
9
 * @author Mark Peters <[email protected]>
10
 * @author Miles Lott <[email protected]>
11
 * @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
12
 * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
13
 * @version $Id$
14
 */
15
16
error_reporting(error_reporting() & ~E_NOTICE & ~E_STRICT);
17
18
// for an old header, we need to setup the reference before including it
19
$GLOBALS['phpgw_info'] =& $GLOBALS['egw_info'];
20
21
$GLOBALS['egw_info'] = array(
22
	'flags' => array(
23
		'noheader' => True,
24
		'nonavbar' => True,
25
		'currentapp' => 'setup',
26
		'noapi' => True
27
));
28
if(file_exists(__DIR__.'/../../header.inc.php'))
29
{
30
	include_once(__DIR__.'/../../header.inc.php');
31
}
32
// for an old header we need to setup a reference for the domains
33
if (!is_array($GLOBALS['egw_domain'])) $GLOBALS['egw_domain'] =& $GLOBALS['phpgw_domain'];
34
35
/*  If we included the header.inc.php, but it is somehow broken, cover ourselves... */
36
if(!defined('EGW_SERVER_ROOT') && !defined('EGW_INCLUDE_ROOT'))
37
{
38
	if (defined('PHPGW_SERVER_ROOT') && defined('PHPGW_INCLUDE_ROOT'))	// pre 1.2 install
39
	{
40
		define('EGW_SERVER_ROOT',PHPGW_SERVER_ROOT);
41
		define('EGW_INCLUDE_ROOT',PHPGW_INCLUDE_ROOT);
42
	}
43
	else	// no install
44
	{
45
		define('EGW_SERVER_ROOT',realpath('..'));
46
		define('EGW_INCLUDE_ROOT',realpath('..'));
47
		define('PHPGW_SERVER_ROOT',realpath('..'));
48
		define('PHPGW_INCLUDE_ROOT',realpath('..'));
49
	}
50
	define('EGW_API_INC',EGW_SERVER_ROOT.'/phpgwapi/inc');
51
}
52
53
require_once(EGW_INCLUDE_ROOT . '/api/src/loader/common.php');
54
55
/**
56
 * function to handle multilanguage support
57
 *
58
 */
59
if (!function_exists('lang'))
60
{
61
	function lang($key, $vars = null)
62
	{
63
		if (!is_array($vars))
64
		{
65
			$vars = func_get_args();
66
			array_shift($vars);    // remove $key
67
		}
68
		return $GLOBALS['egw_setup']->translation->translate("$key", $vars);
69
	}
70
}
71
72
if(file_exists(EGW_SERVER_ROOT.'/api/setup/setup.inc.php'))
73
{
74
	include(EGW_SERVER_ROOT.'/api/setup/setup.inc.php'); /* To set the current core version */
75
	/* This will change to just use setup_info */
76
	$GLOBALS['egw_info']['server']['versions']['current_header'] = $setup_info['api']['versions']['current_header'];
77
}
78
else
79
{
80
	$GLOBALS['egw_info']['server']['versions']['api'] = 'Undetected';
81
}
82
0 ignored issues
show
Deprecated Code introduced by
The function CreateObject() has been deprecated: use autoloadable class-names and new ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

82
/** @scrutinizer ignore-deprecated */ 

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
83
$GLOBALS['egw_info']['server']['app_images'] = 'templates/default/images';
84
85
CreateObject('setup.setup',True,True);	// setup constuctor assigns itself to $GLOBALS['egw_setup'], doing it twice fails on some php4
86
$GLOBALS['phpgw_setup'] =& $GLOBALS['egw_setup'];
87
88
if (!function_exists('version_compare') || version_compare(PHP_VERSION,$GLOBALS['egw_setup']->required_php_version,'<'))
89
{
90
	if (isset($_SERVER['HTTP_HOST'])) echo "<pre>\n";
91
	echo "EGroupware now requires PHP {$GLOBALS['egw_setup']->required_php_version} or greater.\nYour PHP version is: ".PHP_VERSION."\n";
92
	echo 'Please contact your System Administrator.';
93
	exit;
94
}
95