mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 14:46:56 +02:00
Fixed installation issues
This commit is contained in:
@@ -9,8 +9,8 @@
|
|||||||
* e107 Main
|
* e107 Main
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/e107_class.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_handlers/e107_class.php,v $
|
||||||
* $Revision: 1.87 $
|
* $Revision: 1.88 $
|
||||||
* $Date: 2009-11-28 15:34:46 $
|
* $Date: 2009-12-02 16:51:02 $
|
||||||
* $Author: secretr $
|
* $Author: secretr $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -259,6 +259,51 @@ class e107
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize environment path constants while installing e107
|
||||||
|
*
|
||||||
|
* @return e107
|
||||||
|
*/
|
||||||
|
public function initInstall($e107_paths, $e107_root_path)
|
||||||
|
{
|
||||||
|
// Do some security checks/cleanup, prepare the environment
|
||||||
|
$this->prepare_request();
|
||||||
|
|
||||||
|
// folder info
|
||||||
|
$this->e107_dirs = $e107_paths;
|
||||||
|
|
||||||
|
// build all paths
|
||||||
|
$this->set_paths();
|
||||||
|
$this->file_path = $this->fix_windows_paths($e107_root_path)."/";
|
||||||
|
|
||||||
|
// set base path, SSL is auto-detected
|
||||||
|
$this->set_base_path(false);
|
||||||
|
|
||||||
|
// set some core URLs (e_LOGIN/SIGNUP)
|
||||||
|
$this->set_urls();
|
||||||
|
|
||||||
|
// cleanup QUERY_STRING and friends, set related constants
|
||||||
|
$this->set_request();
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set mysql data
|
||||||
|
*
|
||||||
|
* @return e107
|
||||||
|
*/
|
||||||
|
public function initInstallSql($e107_config_mysql_info)
|
||||||
|
{
|
||||||
|
// mysql connection info
|
||||||
|
$this->e107_config_mysql_info = $e107_config_mysql_info;
|
||||||
|
|
||||||
|
// various constants - MAGIC_QUOTES_GPC, MPREFIX, ...
|
||||||
|
$this->set_constants();
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get data from the registry
|
* Get data from the registry
|
||||||
* Returns $default if data not found
|
* Returns $default if data not found
|
||||||
|
@@ -9,9 +9,9 @@
|
|||||||
* mySQL Handler
|
* mySQL Handler
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/mysql_class.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_handlers/mysql_class.php,v $
|
||||||
* $Revision: 1.67 $
|
* $Revision: 1.68 $
|
||||||
* $Date: 2009-12-01 20:05:54 $
|
* $Date: 2009-12-02 16:51:00 $
|
||||||
* $Author: e107steved $
|
* $Author: secretr $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(defined('MYSQL_LIGHT'))
|
if(defined('MYSQL_LIGHT'))
|
||||||
@@ -27,10 +27,12 @@ if(defined('MYSQL_LIGHT'))
|
|||||||
elseif(defined('E107_INSTALL'))
|
elseif(defined('E107_INSTALL'))
|
||||||
{
|
{
|
||||||
define('E107_DEBUG_LEVEL', 0);
|
define('E107_DEBUG_LEVEL', 0);
|
||||||
define('e_QUERY', '');
|
//define('e_QUERY', '');
|
||||||
require_once("e107_config.php");
|
//require_once("e107_config.php");
|
||||||
define('MPREFIX', $mySQLprefix);
|
//define('MPREFIX', $mySQLprefix);
|
||||||
|
require('e107_config.php');
|
||||||
|
$sql_info = compact('mySQLserver', 'mySQLuser', 'mySQLpassword', 'mySQLdefaultdb', 'mySQLprefix');
|
||||||
|
e107::getInstance()->initInstallSql($sql_info);
|
||||||
$sql = new db;
|
$sql = new db;
|
||||||
$sql->db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb);
|
$sql->db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb);
|
||||||
}
|
}
|
||||||
@@ -49,8 +51,8 @@ $db_ConnectionID = NULL; // Stores ID for the first DB connection used - which s
|
|||||||
*
|
*
|
||||||
* @package e107
|
* @package e107
|
||||||
* @category e107_handlers
|
* @category e107_handlers
|
||||||
* @version $Revision: 1.67 $
|
* @version $Revision: 1.68 $
|
||||||
* @author $Author: e107steved $
|
* @author $Author: secretr $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class e_db_mysql {
|
class e_db_mysql {
|
||||||
|
@@ -9,9 +9,9 @@
|
|||||||
* e107 Preference Handler
|
* e107 Preference Handler
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/pref_class.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_handlers/pref_class.php,v $
|
||||||
* $Revision: 1.31 $
|
* $Revision: 1.32 $
|
||||||
* $Date: 2009-11-18 01:04:43 $
|
* $Date: 2009-12-02 16:50:58 $
|
||||||
* $Author: e107coders $
|
* $Author: secretr $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
34
install_.php
34
install_.php
@@ -9,9 +9,9 @@
|
|||||||
* Installation file
|
* Installation file
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/install_.php,v $
|
* $Source: /cvs_backup/e107_0.8/install_.php,v $
|
||||||
* $Revision: 1.55 $
|
* $Revision: 1.56 $
|
||||||
* $Date: 2009-11-24 20:40:35 $
|
* $Date: 2009-12-02 16:51:04 $
|
||||||
* $Author: e107steved $
|
* $Author: secretr $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -20,10 +20,10 @@ define('MIN_PHP_VERSION', '5.0');
|
|||||||
define('MIN_MYSQL_VERSION', '4.1.2');
|
define('MIN_MYSQL_VERSION', '4.1.2');
|
||||||
|
|
||||||
// ensure CHARSET is UTF-8 if used
|
// ensure CHARSET is UTF-8 if used
|
||||||
define('CHARSET', 'utf-8');
|
//define('CHARSET', 'utf-8');
|
||||||
|
|
||||||
/* Default Options and Paths for Installer */
|
/* Default Options and Paths for Installer */
|
||||||
$MySQLPrefix = 'e107_';
|
$MySQLprefix = 'e107_';
|
||||||
|
|
||||||
$ADMIN_DIRECTORY = "e107_admin/";
|
$ADMIN_DIRECTORY = "e107_admin/";
|
||||||
$FILES_DIRECTORY = "e107_files/";
|
$FILES_DIRECTORY = "e107_files/";
|
||||||
@@ -48,13 +48,13 @@ if(isset($_GET['object']))
|
|||||||
}
|
}
|
||||||
|
|
||||||
define("e107_INIT", TRUE);
|
define("e107_INIT", TRUE);
|
||||||
define("e_UC_PUBLIC", 0);
|
/*define("e_UC_PUBLIC", 0);
|
||||||
define("e_UC_MAINADMIN", 250);
|
define("e_UC_MAINADMIN", 250);
|
||||||
define("e_UC_READONLY", 251);
|
define("e_UC_READONLY", 251);
|
||||||
define("e_UC_GUEST", 252);
|
define("e_UC_GUEST", 252);
|
||||||
define("e_UC_MEMBER", 253);
|
define("e_UC_MEMBER", 253);
|
||||||
define("e_UC_ADMIN", 254);
|
define("e_UC_ADMIN", 254);
|
||||||
define("e_UC_NOBODY", 255);
|
define("e_UC_NOBODY", 255);*/
|
||||||
|
|
||||||
define("E107_INSTALL",TRUE);
|
define("E107_INSTALL",TRUE);
|
||||||
|
|
||||||
@@ -143,9 +143,8 @@ function check_class($whatever)
|
|||||||
|
|
||||||
|
|
||||||
$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', 'MEDIA_DIRECTORY');
|
$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', 'MEDIA_DIRECTORY');
|
||||||
|
|
||||||
$e107 = e107::getInstance();
|
$e107 = e107::getInstance();
|
||||||
$e107->init($e107_paths, realpath(dirname(__FILE__)));
|
$e107->initInstall($e107_paths, realpath(dirname(__FILE__)));
|
||||||
unset($e107_paths);
|
unset($e107_paths);
|
||||||
|
|
||||||
function include_lan($path, $force = false)
|
function include_lan($path, $force = false)
|
||||||
@@ -922,8 +921,6 @@ class e_install
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$errors = $this->create_tables();
|
$errors = $this->create_tables();
|
||||||
|
|
||||||
|
|
||||||
if ($errors == true)
|
if ($errors == true)
|
||||||
{
|
{
|
||||||
$page = $errors."<br />";
|
$page = $errors."<br />";
|
||||||
@@ -952,21 +949,20 @@ class e_install
|
|||||||
// Basic stuff to get the handlers/classes to work.
|
// Basic stuff to get the handlers/classes to work.
|
||||||
|
|
||||||
|
|
||||||
$udirs = "admin/|plugins/|temp";
|
// $udirs = "admin/|plugins/|temp";
|
||||||
$e_SELF = $_SERVER['PHP_SELF'];
|
// $e_SELF = $_SERVER['PHP_SELF'];
|
||||||
$e_HTTP = preg_replace("#".$udirs."#i", "", substr($e_SELF, 0, strrpos($e_SELF, "/"))."/");
|
// $e_HTTP = preg_replace("#".$udirs."#i", "", substr($e_SELF, 0, strrpos($e_SELF, "/"))."/");
|
||||||
|
|
||||||
define("MAGIC_QUOTES_GPC", (ini_get('magic_quotes_gpc') ? true : false));
|
//define("MAGIC_QUOTES_GPC", (ini_get('magic_quotes_gpc') ? true : false));
|
||||||
// define('CHARSET', 'utf-8');
|
// define('CHARSET', 'utf-8');
|
||||||
// define("e_LANGUAGE", $this->previous_steps['language']);
|
// define("e_LANGUAGE", $this->previous_steps['language']);
|
||||||
define('e_SELF', 'http://'.$_SERVER['HTTP_HOST']) . ($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_FILENAME']);
|
// define('e_SELF', 'http://'.$_SERVER['HTTP_HOST']) . ($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_FILENAME']);
|
||||||
|
|
||||||
$themeImportFile = array();
|
$themeImportFile = array();
|
||||||
$themeImportFile[0] = $this->e107->e107_dirs['THEMES_DIRECTORY'].$this->previous_steps['prefs']['sitetheme']."/install.xml";
|
$themeImportFile[0] = $this->e107->e107_dirs['THEMES_DIRECTORY'].$this->previous_steps['prefs']['sitetheme']."/install.xml";
|
||||||
$themeImportFile[1] = $this->e107->e107_dirs['THEMES_DIRECTORY'].$this->previous_steps['prefs']['sitetheme']."/install/install.xml";
|
$themeImportFile[1] = $this->e107->e107_dirs['THEMES_DIRECTORY'].$this->previous_steps['prefs']['sitetheme']."/install/install.xml";
|
||||||
$themeImportFile[3] = $this->e107->e107_dirs['FILES_DIRECTORY']. "default_install.xml";
|
$themeImportFile[3] = $this->e107->e107_dirs['FILES_DIRECTORY']. "default_install.xml";
|
||||||
|
|
||||||
|
|
||||||
if(vartrue($this->previous_steps['generate_content']))
|
if(vartrue($this->previous_steps['generate_content']))
|
||||||
{
|
{
|
||||||
foreach($themeImportFile as $file)
|
foreach($themeImportFile as $file)
|
||||||
@@ -1029,7 +1025,7 @@ class e_install
|
|||||||
$this->previous_steps['prefs']['siteadmin'] = $this->previous_steps['admin']['display'];
|
$this->previous_steps['prefs']['siteadmin'] = $this->previous_steps['admin']['display'];
|
||||||
$this->previous_steps['prefs']['siteadminemail'] = $this->previous_steps['admin']['email'];
|
$this->previous_steps['prefs']['siteadminemail'] = $this->previous_steps['admin']['email'];
|
||||||
$this->previous_steps['prefs']['install_date'] = time();
|
$this->previous_steps['prefs']['install_date'] = time();
|
||||||
$this->previous_steps['prefs']['siteurl'] = $e_HTTP;
|
$this->previous_steps['prefs']['siteurl'] = e_HTTP;
|
||||||
|
|
||||||
$this->previous_steps['prefs']['sitetag'] = LAN_PREF_2;
|
$this->previous_steps['prefs']['sitetag'] = LAN_PREF_2;
|
||||||
$this->previous_steps['prefs']['sitedisclaimer'] = LAN_PREF_3;
|
$this->previous_steps['prefs']['sitedisclaimer'] = LAN_PREF_3;
|
||||||
@@ -1047,7 +1043,6 @@ class e_install
|
|||||||
$ip = $_SERVER['REMOTE_ADDR'];
|
$ip = $_SERVER['REMOTE_ADDR'];
|
||||||
$userp = "1, '{$this->previous_steps['admin']['display']}', '{$this->previous_steps['admin']['user']}', '', '".md5($this->previous_steps['admin']['password'])."', '', '{$this->previous_steps['admin']['email']}', '', '', 0, ".time().", 0, 0, 0, 0, 0, '{$ip}', 0, '', 0, 1, '', '', '0', '', ".time().", ''";
|
$userp = "1, '{$this->previous_steps['admin']['display']}', '{$this->previous_steps['admin']['user']}', '', '".md5($this->previous_steps['admin']['password'])."', '', '{$this->previous_steps['admin']['email']}', '', '', 0, ".time().", 0, 0, 0, 0, 0, '{$ip}', 0, '', 0, 1, '', '', '0', '', ".time().", ''";
|
||||||
$this->dbqry("REPLACE INTO {$this->previous_steps['mysql']['prefix']}user VALUES ({$userp})" );
|
$this->dbqry("REPLACE INTO {$this->previous_steps['mysql']['prefix']}user VALUES ({$userp})" );
|
||||||
|
|
||||||
mysql_close();
|
mysql_close();
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -1261,7 +1256,6 @@ class e_install
|
|||||||
return nl2br(LANINS_061."\n\n<b>".LANINS_083."\n</b><i>".mysql_error($link)."</i>");
|
return nl2br(LANINS_061."\n\n<b>".LANINS_083."\n</b><i>".mysql_error($link)."</i>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user