Location: PHPKode > projects > EXtensible Production Suite (XPS) > xpsdev/install/index.php
<?php

/* ******************************************************
*      X   X PPPP   SSSS
*       X X  P   P S       EXTENSIBLE
*        X   PPPP   SSS    PRODUCTION
*       X X  P         S   SUITE v1.0
*      X   X P     SSSS
*
******************************************************* */
/*********************************************************************
*                      Installation Wizard	                         *
*
* Step 1: Site introduction, select language; default is English.
* Step 2: Verify writable permissions on directories /cache and /templates_c and /configs/settings.xml file.
* Step 3: Edit required settings for database connection and setup (stored in settings.xml).
* Step 3a: Test database server (host) connection.
* Step 4: Verify successful data write to settings file.
* Step 5: User sees page that tests the database connection. If the database connection test was successful, then check to see if database already exists. If it doesn't exist then try to create it. All attempts to create database objects will be output with a status indicating success or fail.
* Step 5a: If the connection test failed then prompt user to try again or edit settings back in step 3.
* Step 5b: If the database already exists then prompt the user for the option to drop the current database and then try to create the new database, or keep existing database.
* Step 6: Prompt user to create an admin account where the user specifies: Admin Name, Admin Email and Password.
* Step 7: After the Admin account is successfully created, run site script inserts.
* Step 8: At the end of the wizard present the user with a link to the website's homepage.
******************************************************************** */

require('./controls/api.php');

/*****************************
*  Pathing for installation. *
******************************/
define('CONFIGS'  , realpath('./configs')   );
define('CONTROLS' , realpath('./controls')  );
define('MODELS'   , realpath('./models')    );
define('LANGUAGES', realpath('./languages') );
define('TEMPLATES', realpath('./templates') );
/**************************
*  Pathing for main site. *
***************************/
define('TEMPLATES_C', realpath('../templates_c') );
define('MODULES', realpath('../modules') );
define('THEMES', realpath('../themes') );
define('SETTINGS', realpath('../core/configs/settings.xml') );

session_start();

/*******************************************************
* <p>TODO: Name of function</p>
*
* @access   public
* @author 	rennemannt <hide@address.com>
* @param	array [$params] array of parameters.
* @return	boolean true/false.
********************************************************/
$function = '';
$func_return = '';
$template_displayed = '';
$params = array();

/*******************************************************
* <p>TODO: Name of function</p>
*
* @access   public
* @author 	rennemannt <hide@address.com>
* @param	array [$params] array of parameters.
* @return	boolean true/false.
********************************************************/
if( (isset($_GET)) and ($_GET != array()) )
{
    $params = $_GET;
}
elseif( isset($_POST) )
{
    $params = $_POST;
}

/*******************************************************
* <p>TODO: Name of function</p>
*
* @access   public
* @author 	rennemannt <hide@address.com>
* @param	array [$params] array of parameters.
* @return	boolean true/false.
********************************************************/
if(isset($params['f']))
{
    $function = $params['f'];
}

if(isset($params['template_displayed']))
{
    $template_displayed = $params['template_displayed'];
}
else
{
    $template_displayed = 'choose_language.tpl';
}

/*******************************************************
* <p>TODO: Name of function</p>
*
* @access   public
* @author 	rennemannt <hide@address.com>
* @param	array [$params] array of parameters.
* @return	boolean true/false.
********************************************************/
$API = new API($template_displayed);

if($function != '')
{
    $func_return = $API->$function($params);
}

/*******************************************************
* <p>TODO: Name of function</p>
*
* @access   public
* @author 	rennemannt <hide@address.com>
* @param	array [$params] array of parameters.
* @return	boolean true/false.
********************************************************/
if(isset($params['ajax']) and $params['ajax'] == 1)
{
    echo $func_return;
    die();
}

/*******************************************************
* <p>TODO: Name of function</p>
*
* @access   public
* @author 	rennemannt <hide@address.com>
* @param	array [$params] array of parameters.
* @return	boolean true/false.
********************************************************/
$API->Smarty->assign('template_file', $API->template2display);
$API->Smarty->display('install.tpl');
?>
Return current item: EXtensible Production Suite (XPS)