From cb3248a4e6b1dcb8ed2de23764e03238304deb38 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 26 May 2016 10:44:48 +0200 Subject: [PATCH] fix failed package install without phpgwapi installed --- setup/inc/class.setup_cmd_header.inc.php | 8 ++++---- setup/inc/class.setup_header.inc.php | 8 ++++---- setup/inc/functions.inc.php | 8 ++++---- setup/setup-cli.php | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/setup/inc/class.setup_cmd_header.inc.php b/setup/inc/class.setup_cmd_header.inc.php index d7588a7dd0..df42593a66 100644 --- a/setup/inc/class.setup_cmd_header.inc.php +++ b/setup/inc/class.setup_cmd_header.inc.php @@ -51,7 +51,7 @@ class setup_cmd_header extends setup_cmd admin_cmd::__construct($sub_command); // header is 3 levels lower then this command in setup/inc - $this->header_path = dirname(dirname(dirname(__FILE__))).'/header.inc.php'; + $this->header_path = dirname(dirname(__DIR__)).'/header.inc.php'; // if header is a symlink --> work on it's target if (is_link($this->header_path)) @@ -59,7 +59,7 @@ class setup_cmd_header extends setup_cmd $this->header_path = readlink($this->header_path); if ($this->header_path[0] != '/' && $this->header_path[1] != ':') { - $this->header_path = dirname(dirname(dirname(__FILE__))).'/'.$this->header_path; + $this->header_path = dirname(dirname(__DIR__)).'/'.$this->header_path; } } $this->setup_header = new setup_header(); @@ -83,7 +83,7 @@ class setup_cmd_header extends setup_cmd { if ($this->sub_command != 'create') { - throw new Api\Exception\WrongUserinput(lang('eGroupWare configuration file (header.inc.php) does NOT exist.')."\n".lang('Use --create-header to create the configuration file (--usage gives more options).'),1); + throw new Api\Exception\WrongUserinput(lang('EGroupware configuration file (header.inc.php) does NOT exist.')."\n".lang('Use --create-header to create the configuration file (--usage gives more options).'),1); } $this->defaults(false); } @@ -92,7 +92,7 @@ class setup_cmd_header extends setup_cmd if ($this->sub_command == 'create') { throw new Api\Exception\WrongUserinput( - lang('eGroupWare configuration file header.inc.php already exists, you need to use --edit-header or delete it first!'),20); + lang('EGroupware configuration file header.inc.php already exists, you need to use --edit-header or delete it first!'),20); } if ($this->arguments) { diff --git a/setup/inc/class.setup_header.inc.php b/setup/inc/class.setup_header.inc.php index 7e844b5f77..2ca90ab76e 100644 --- a/setup/inc/class.setup_header.inc.php +++ b/setup/inc/class.setup_header.inc.php @@ -65,7 +65,7 @@ class setup_header */ function defaults($domain='default') { - $egw_root = realpath(dirname(__FILE__).'/../..'); + $egw_root = realpath(__DIR__.'/../..'); $GLOBALS['egw_info']['server']['server_root'] = $GLOBALS['egw_info']['server']['include_root'] = $egw_root; define('EGW_SERVER_ROOT',$egw_root); // this is usally already defined by setup and cant be changed define('EGW_INCLUDE_ROOT',$egw_root); @@ -113,9 +113,9 @@ class setup_header { $errors = null; - if (!is_dir($path) || !is_readable($path) || !is_dir($path.'/phpgwapi')) + if (!is_dir($path) || !is_readable($path) || !is_dir($path.'/api')) { - $errors[] = lang("%1 '%2' does NOT exist, is not readable by the webserver or contains no eGroupWare installation!",lang('Server root'),$path); + $errors[] = lang("%1 '%2' does NOT exist, is not readable by the webserver or contains no EGroupware installation!",lang('Server root'),$path); } if(!$GLOBALS['egw_info']['server']['header_admin_password']) { @@ -127,7 +127,7 @@ class setup_header } if (!is_array($GLOBALS['egw_domain']) || !count($GLOBALS['egw_domain'])) { - $errors[] = lang('You need to add at least one eGroupWare domain / database instance.'); + $errors[] = lang('You need to add at least one EGroupware domain / database instance.'); } else { diff --git a/setup/inc/functions.inc.php b/setup/inc/functions.inc.php index 29a88c6cff..e24cbd8a9f 100644 --- a/setup/inc/functions.inc.php +++ b/setup/inc/functions.inc.php @@ -66,15 +66,15 @@ function lang($key,$vars=null) return $GLOBALS['egw_setup']->translation->translate("$key", $vars); } -if(file_exists(EGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php')) +if(file_exists(EGW_SERVER_ROOT.'/api/setup/setup.inc.php')) { - include(EGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php'); /* To set the current core version */ + include(EGW_SERVER_ROOT.'/api/setup/setup.inc.php'); /* To set the current core version */ /* This will change to just use setup_info */ - $GLOBALS['egw_info']['server']['versions']['current_header'] = $setup_info['phpgwapi']['versions']['current_header']; + $GLOBALS['egw_info']['server']['versions']['current_header'] = $setup_info['api']['versions']['current_header']; } else { - $GLOBALS['egw_info']['server']['versions']['phpgwapi'] = 'Undetected'; + $GLOBALS['egw_info']['server']['versions']['api'] = 'Undetected'; } $GLOBALS['egw_info']['server']['app_images'] = 'templates/default/images'; diff --git a/setup/setup-cli.php b/setup/setup-cli.php index 43ef36d784..f5123cb7ed 100755 --- a/setup/setup-cli.php +++ b/setup/setup-cli.php @@ -6,7 +6,7 @@ * @link http://www.egroupware.org * @package setup * @author Ralf Becker - * @copyright (c) 2006-14 by Ralf Becker + * @copyright (c) 2006-16 by Ralf Becker * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @version $Id$ */