1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 21:27:25 +02:00

Various install fixes, now produces a site at least.

This commit is contained in:
mcfly
2010-01-23 02:07:50 +00:00
parent 3150b31d46
commit a90d5a0373
2 changed files with 30 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
<?php <?php
/* /*
* e107 website system * e107 website system
* *
@@ -9,9 +9,9 @@
* Database utilities * Database utilities
* *
* $Source: /cvs_backup/e107_0.8/e107_handlers/db_table_admin_class.php,v $ * $Source: /cvs_backup/e107_0.8/e107_handlers/db_table_admin_class.php,v $
* $Revision: 1.14 $ * $Revision: 1.15 $
* $Date: 2009-12-01 20:05:53 $ * $Date: 2010-01-23 02:07:50 $
* $Author: e107steved $ * $Author: mcfly_e107 $
*/ */
/* /*
@@ -35,6 +35,10 @@ class db_table_admin
function get_current_table($table_name, $prefix = "") function get_current_table($table_name, $prefix = "")
{ {
global $sql; global $sql;
if(!isset($sql))
{
$sql = new db;
}
if (!$prefix) if (!$prefix)
{ {
@@ -67,7 +71,7 @@ class db_table_admin
* Given the name of a file, returns an array, with each element being a table creation definition. * Given the name of a file, returns an array, with each element being a table creation definition.
* Tracks the last file read - only reads it once * Tracks the last file read - only reads it once
* If the file name is an empty string, uses a previously read/set buffer * If the file name is an empty string, uses a previously read/set buffer
* *
* @param string $table_name - If specified, returns only that table's info; otherwise returns a list of all tables * @param string $table_name - If specified, returns only that table's info; otherwise returns a list of all tables
* The table name must include a prefix where appropriate (although not required with standard E107 table definition files) * The table name must include a prefix where appropriate (although not required with standard E107 table definition files)
* @return string|array * @return string|array
@@ -235,7 +239,7 @@ class db_table_admin
if(E107_DBG_SQLDETAILS) if(E107_DBG_SQLDETAILS)
{ {
$mes = e107::getMessage(); $mes = e107::getMessage();
$mes->add("db_table_admin_class.php :: parse_field_defs() Line: 230 - Unknown definition {$i}: ".$fd[$i], E_MESSAGE_DEBUG); $mes->add("db_table_admin_class.php :: parse_field_defs() Line: 230 - Unknown definition {$i}: ".$fd[$i], E_MESSAGE_DEBUG);
} }
} }
$i++; $i++;

View File

@@ -9,16 +9,16 @@
* Installation file * Installation file
* *
* $Source: /cvs_backup/e107_0.8/install_.php,v $ * $Source: /cvs_backup/e107_0.8/install_.php,v $
* $Revision: 1.58 $ * $Revision: 1.59 $
* $Date: 2010-01-16 19:54:04 $ * $Date: 2010-01-23 02:07:50 $
* $Author: e107steved $ * $Author: mcfly_e107 $
* *
*/ */
/** /**
* @package e107 * @package e107
* @subpackage install * @subpackage install
* @version $Id: install_.php,v 1.58 2010-01-16 19:54:04 e107steved Exp $; * @version $Id: install_.php,v 1.59 2010-01-23 02:07:50 mcfly_e107 Exp $;
* *
* Installer base routine * Installer base routine
*/ */
@@ -47,6 +47,7 @@ $HELP_DIRECTORY = "e107_docs/help/";
$CACHE_DIRECTORY = "e107_media/cache/"; $CACHE_DIRECTORY = "e107_media/cache/";
$DOWNLOADS_DIRECTORY = "e107_media/files/"; $DOWNLOADS_DIRECTORY = "e107_media/files/";
$UPLOADS_DIRECTORY = "e107_media/public/"; $UPLOADS_DIRECTORY = "e107_media/public/";
$LOGS_DIRECTORY = "e107_files/logs";
/* End configurable variables */ /* End configurable variables */
@@ -86,7 +87,9 @@ e107_ini_set('magic_quotes_sybase', 0);
e107_ini_set('arg_separator.output', '&amp;'); e107_ini_set('arg_separator.output', '&amp;');
e107_ini_set('session.use_only_cookies', 1); e107_ini_set('session.use_only_cookies', 1);
e107_ini_set('session.use_trans_sid', 0); e107_ini_set('session.use_trans_sid', 0);
session_start();
define('MAGIC_QUOTES_GPC', (ini_get('magic_quotes_gpc') ? true : false));
$php_version = phpversion(); $php_version = phpversion();
if(version_compare($php_version, MIN_PHP_VERSION, "<")) if(version_compare($php_version, MIN_PHP_VERSION, "<"))
@@ -151,10 +154,11 @@ 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', 'LOGS_DIRECTORY');
$e107 = e107::getInstance(); $e107 = e107::getInstance();
$e107->initInstall($e107_paths, realpath(dirname(__FILE__))); $e107->initInstall($e107_paths, realpath(dirname(__FILE__)));
unset($e107_paths); unset($e107_paths);
session_start();
function include_lan($path, $force = false) function include_lan($path, $force = false)
{ {
@@ -201,7 +205,10 @@ class e_install
$this->logFile = ''; $this->logFile = '';
if (MAKE_INSTALL_LOG) if (MAKE_INSTALL_LOG)
{ {
$this->logFile = dirname(__FILE__).'/e107InstallLog.log'; if(is_writable(dirname(__FILE__)))
{
$this->logFile = dirname(__FILE__).'/e107InstallLog.log';
}
} }
// $this->logLine('Query string: '); // $this->logLine('Query string: ');
$this->template = new SimpleTemplate(); $this->template = new SimpleTemplate();
@@ -241,7 +248,7 @@ class e_install
{ {
if (!MAKE_INSTALL_LOG || ($this->logFile == '')) return; if (!MAKE_INSTALL_LOG || ($this->logFile == '')) return;
$logfp = fopen($this->logFile, 'a+'); $logfp = fopen($this->logFile, 'a+');
fwrite($logfp, ($now = time()).', '.gmstrftime('%y-%m-%d %H:%M:%S',$now).' '.$logLine."\n"); fwrite($logfp, ($now = time()).', '.gmstrftime('%y-%m-%d %H:%M:%S',$now).' '.$logLine."\n");
fclose($logfp); fclose($logfp);
} }
@@ -1123,6 +1130,7 @@ class e_install
// Create the admin user - replacing any that may be been included in the XML. // Create the admin user - replacing any that may be been included in the XML.
$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().", ''";
$qry = "REPLACE INTO {$this->previous_steps['mysql']['prefix']}user VALUES ({$userp})";
$this->dbqry("REPLACE INTO {$this->previous_steps['mysql']['prefix']}user VALUES ({$userp})" ); $this->dbqry("REPLACE INTO {$this->previous_steps['mysql']['prefix']}user VALUES ({$userp})" );
$this->logLine('Admin user created'); $this->logLine('Admin user created');
mysql_close($this->dbLink); mysql_close($this->dbLink);
@@ -1507,7 +1515,10 @@ class e_install
if(mysql_errno()) if(mysql_errno())
{ {
$this->debug_db_info['db_error_log'][] = 'Query Error [#'.mysql_errno().']: '.mysql_error()."\nQuery: {$qry}"; $errorInfo = 'Query Error [#'.mysql_errno().']: '.mysql_error()."\nQuery: {$qry}";
echo $errorInfo."<br />";
exit;
$this->debug_db_info['db_error_log'][] = $errorInfo;
//$this->debug_db_info['db_log'][] = $qry; //$this->debug_db_info['db_log'][] = $qry;
return false; return false;
} }