示例#1
0
</script>

<h1><?php 
echo gt('Configure Database');
?>
</h1>
<form method="post" action="index.php">
    <input type="hidden" name="page" value="install-3" />
	<div class="control">
        <span class="label"><?php 
echo gt('Backend');
?>
: </span>
        <select name="sc[db_engine]" onchange="showOptions(this.value);">
		<?php 
foreach (expDatabase::backends(1) as $name => $display) {
    echo '<option value="' . $name . '"';
    if ($config['db_engine'] == $name) {
        echo ' selected="selected"';
    }
    echo '>' . $display . '</option>';
}
?>
		</select>
		<div class="control_help">
			<?php 
echo gt('Select which database server software package your web server is running.  If the software is not listed, it is not supported by Exponent.');
?>
			<br /><br />
			<?php 
echo gt('If in doubt, contact your system administrator or hosting provider.');
示例#2
0
 * @copyright 2004-2011 OIC Group, Inc.
 * @author Adam Kessler <*****@*****.**>
 * @version 2.0.0
 */
// Initialize the exponent environment
require_once 'exponent_bootstrap.php';
// Initialize the MVC framework - for objects we need loaded now
require_once BASE . 'framework/core/expFramework.php';
// Initialize the Sessions subsystem
expSession::initialize();
// Initialize the Theme subsystem
expTheme::initialize();
// Initialize the language subsystem
expLang::loadLang();
// Initialize the Database subsystem
$db = expDatabase::connect(DB_USER, DB_PASS, DB_HOST . ':' . DB_PORT, DB_NAME);
// Initialize the Modules subsystem & Create the list of available/active controllers
$available_controllers = expModules::initializeControllers();
//original position
//$available_controllers = array();
//$available_controllers = initializeControllers();
//foreach ($db->selectObjects('modstate',1) as $mod) {
//	if (!empty($mod->path)) $available_controllers[$mod->module] = $mod->path;  //FIXME test location
//}
// Initialize the History (Flow) subsystem.
$history = new expHistory();
//<--This is the new flow subsystem
// Initialize the javascript subsystem
if (expJavascript::inAjaxAction()) {
    set_error_handler('handleErrors');
}
 /**
  * connect to old site's database
  *
  * @return mysqli_database
  */
 private function connect()
 {
     // check for required info...then make the DB connection.
     if (empty($this->config['username']) || empty($this->config['password']) || empty($this->config['database']) || empty($this->config['server']) || empty($this->config['prefix']) || empty($this->config['port'])) {
         flash('error', gt('You are missing some required database connection information.  Please enter DB information.'));
         redirect_to(array('controller' => 'migration', 'action' => 'configure'));
     }
     $database = expDatabase::connect($this->config['username'], $this->config['password'], $this->config['server'] . ':' . $this->config['port'], $this->config['database']);
     if (empty($database->havedb)) {
         flash('error', gt('An error was encountered trying to connect to the database you specified. Please check your DB config.'));
         redirect_to(array('controller' => 'migration', 'action' => 'configure'));
     }
     $database->prefix = $this->config['prefix'] . '_';
     return $database;
 }
示例#4
0
//expSession::set("installer_config",$_POST['sc']);
$config = $_POST['sc'];
//$config['sef_urls'] = empty($_POST['c']['sef_urls']) ? 0 : 1;
$passed = true;
if (preg_match('/[^A-Za-z0-9]/', $config['db_table_prefix'])) {
    echoFailure(gt('Invalid table prefix.  The table prefix can only contain alphanumeric characters.'));
    $passed = false;
}
if ($passed) {
    //set connection encoding, works only on mySQL > 4.1
    if ($config["db_engine"] == "mysqli") {
        if (!defined('DB_ENCODING')) {
            define('DB_ENCODING', $config["DB_ENCODING"]);
        }
    }
    $db = expDatabase::connect($config['db_user'], $config['db_pass'], $config['db_host'] . ':' . $config['db_port'], $config['db_name'], $config['db_engine'], 1);
    $db->prefix = $config['db_table_prefix'] . '_';
    $status = array();
    echoStart(gt('Connecting') . ':');
    if ($db->connection == null) {
        echoFailure(gt("Trying to Connect to Database") . " (" . $db->error() . ")");
        // FIXME:BETTER ERROR CHECKING
        $passed = false;
    }
}
if ($passed) {
    $tables = $db->getTables();
    if ($db->inError()) {
        echoFailure(gt("Trying to Get Tables") . " (" . $db->error() . ")");
        $passed = false;
    } else {
示例#5
0
function _sanity_checkDB()
{
    //	$have_good = false;
    if (count(expDatabase::backends(1)) > 0) {
        return array(SANITY_FINE, gt('Supported'));
    } else {
        return array(SANITY_ERROR, gt('No Databases Supported'));
    }
}