From f5f676bc3e6fcb307a865887deb1e0ba35bb2c6b Mon Sep 17 00:00:00 2001 From: aSeptik Date: Mon, 17 Feb 2014 11:16:16 +0100 Subject: [PATCH] Fix import_configuration via API ex. cron-job or command-line Fix import_configuration via API ex. cron-job or command-line as seen on line 1772 comment. --- install.php | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/install.php b/install.php index 3c142fad1..af959e385 100644 --- a/install.php +++ b/install.php @@ -1736,7 +1736,14 @@ function create_tables_unattended() { return false; } - @include('e107_config.php'); + + if(file_exists('e107_config.php')) + { + @include('e107_config.php'); + } else { + return false; + } + //If mysql info not set, config file is not created properly if(!isset($mySQLuser) || !isset($mySQLpassword) || !isset($mySQLdefaultdb) || !isset($mySQLprefix)) { @@ -1749,7 +1756,7 @@ function create_tables_unattended() return false; } - $einstall = new e_install; + $einstall = new e_install(); $einstall->previous_steps['mysql']['server'] = $mySQLserver; $einstall->previous_steps['mysql']['user'] = $mySQLuser; $einstall->previous_steps['mysql']['password'] = $mySQLpassword; @@ -1768,12 +1775,12 @@ function create_tables_unattended() $einstall->previous_steps['prefs']['sitename'] = isset($_GET['sitename']) ? urldecode($_GET['sitename']) : LANINS_113; $einstall->previous_steps['prefs']['sitetheme'] = isset($_GET['theme']) ? urldecode($_GET['theme']) : 'jayya'; - @include_once("./{$HANDLERS_DIRECTORY}e107_class.php"); - $e107_paths = compact('ADMIN_DIRECTORY', 'FILES_DIRECTORY', 'IMAGES_DIRECTORY', 'THEMES_DIRECTORY', 'PLUGINS_DIRECTORY', 'HANDLERS_DIRECTORY', 'LANGUAGES_DIRECTORY', 'HELP_DIRECTORY', 'CACHE_DIRECTORY', 'DOWNLOADS_DIRECTORY', 'UPLOADS_DIRECTORY'); - $e107 = e107::getInstance(); - $e107->init($e107_paths, realpath(dirname(__FILE__))); + //@include_once("./{$HANDLERS_DIRECTORY}e107_class.php"); + //$e107_paths = compact('ADMIN_DIRECTORY', 'FILES_DIRECTORY', 'IMAGES_DIRECTORY', 'THEMES_DIRECTORY', 'PLUGINS_DIRECTORY', 'HANDLERS_DIRECTORY', 'LANGUAGES_DIRECTORY', 'HELP_DIRECTORY', 'CACHE_DIRECTORY', 'DOWNLOADS_DIRECTORY', 'UPLOADS_DIRECTORY'); + //$e107 = e107::getInstance(); + //$e107->init($e107_paths, realpath(dirname(__FILE__))); - $einstall->e107 = &$e107; + //$einstall->e107 = &$e107; //FIXME - does not appear to work for import_configuration. ie. tables are blank except for user table.