mirror of
https://github.com/e107inc/e107.git
synced 2025-01-18 05:09:05 +01:00
Few changes to aid with automated install
This commit is contained in:
parent
50c9ef2a71
commit
641dba3b2e
63
install_.php
63
install_.php
@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/install_.php,v $
|
||||
| $Revision: 1.14 $
|
||||
| $Date: 2008-12-19 02:55:14 $
|
||||
| $Revision: 1.15 $
|
||||
| $Date: 2008-12-27 21:41:33 $
|
||||
| $Author: mcfly_e107 $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@ -54,6 +54,11 @@ define("e_UC_ADMIN", 254);
|
||||
define("e_UC_NOBODY", 255);
|
||||
|
||||
error_reporting(E_ALL);
|
||||
if(isset($_GET['create_tables']))
|
||||
{
|
||||
create_tables_unattended();
|
||||
exit;
|
||||
}
|
||||
|
||||
function e107_ini_set($var, $value)
|
||||
{
|
||||
@ -752,6 +757,7 @@ This file has been generated by the installation script.
|
||||
}
|
||||
return $bad_files;
|
||||
}
|
||||
|
||||
|
||||
function create_tables() {
|
||||
|
||||
@ -781,9 +787,9 @@ This file has been generated by the installation script.
|
||||
$tablename = $match[1];
|
||||
preg_match_all("/create(.*?)myisam;/si", $sql_data, $result );
|
||||
$sql_table = preg_replace("/create table\s/si", "CREATE TABLE {$this->previous_steps['mysql']['prefix']}", $sql_table);
|
||||
if (!mysql_query($sql_table, $link)) {
|
||||
return nl2br(LANINS_061."\n\n<b>".LANINS_083."\n</b><i>".mysql_error($link)."</i>");
|
||||
}
|
||||
//if (!mysql_query($sql_table, $link)) {
|
||||
// return nl2br(LANINS_061."\n\n<b>".LANINS_083."\n</b><i>".mysql_error($link)."</i>");
|
||||
//}
|
||||
}
|
||||
|
||||
$datestamp = time();
|
||||
@ -959,6 +965,53 @@ class e_forms {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function create_tables_unattended()
|
||||
{
|
||||
//If username or password not specified, exit
|
||||
if(!isset($_GET['username']) || !isset($_GET['password']))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@include('e107_config.php');
|
||||
//If mysql info not set, config file is not created properly
|
||||
if(!isset($mySQLuser) || !isset($mySQLpassword) || !isset($mySQLdefaultdb) || !isset($mySQLprefix))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// If specified username and password does not match the ones in config, exit
|
||||
if($_GET['username'] !== $mySQLuser || $_GET['password'] !== $mySQLpassword)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$einstall = new e_install;
|
||||
$einstall->previous_steps['mysql']['server'] = $mySQLserver;
|
||||
$einstall->previous_steps['mysql']['user'] = $mySQLuser;
|
||||
$einstall->previous_steps['mysql']['password'] = $mySQLpassword;
|
||||
$einstall->previous_steps['mysql']['db'] = $mySQLdefaultdb;
|
||||
$einstall->previous_steps['mysql']['prefix'] = $mySQLprefix;
|
||||
|
||||
$einstall->previous_steps['language'] = (isset($_GET['language']) ? $_GET['language'] : 'English');
|
||||
|
||||
$einstall->previous_steps['admin']['display'] = (isset($_GET['admin_display']) ? $_GET['admin_display'] : 'admin');
|
||||
$einstall->previous_steps['admin']['user'] = (isset($_GET['admin_user']) ? $_GET['admin_user'] : 'admin');
|
||||
$einstall->previous_steps['admin']['password'] = (isset($_GET['admin_password']) ? $_GET['admin_password'] : 'admin_password');
|
||||
$einstall->previous_steps['admin']['email'] = (isset($_GET['admin_email']) ? $_GET['admin_email'] : 'admin_email@xxx.com');
|
||||
|
||||
@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->create_tables();
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
class SimpleTemplate {
|
||||
|
||||
var $Tags = array();
|
||||
|
Loading…
x
Reference in New Issue
Block a user