{$mod_strings['LBL_HELP']} | |||||
{$mod_strings['LBL_PERFORM_TITLE']} |
|||||
---|---|---|---|---|---|
EOQ;
echo $out;
installLog("calling handleSugarConfig()");
$bottle = handleSugarConfig();
installLog("calling handleLog4Php()");
handleLog4Php();
$server_software = $_SERVER["SERVER_SOFTWARE"];
if(strpos($server_software,'Microsoft-IIS') !== false)
{
installLog("calling handleWebConfig()");
handleWebConfig();
} else {
installLog("calling handleHtaccess()");
handleHtaccess();
}
///////////////////////////////////////////////////////////////////////////////
//// START TABLE STUFF
echo " "; echo "{$mod_strings['LBL_PERFORM_TABLES']}"; echo " "; // create the SugarCRM database if($setup_db_create_database) { installLog("calling handleDbCreateDatabase()"); handleDbCreateDatabase(); } else { // ensure the charset and collation are utf8 installLog("calling handleDbCharsetCollation()"); handleDbCharsetCollation(); } // create the SugarCRM database user if($setup_db_create_sugarsales_user) handleDbCreateSugarUser(); foreach( $beanFiles as $bean => $file ){ require_once( $file ); } // load up the config_override.php file. // This is used to provide default user settings if( is_file("config_override.php") ){ require_once("config_override.php"); } $db = DBManagerFactory::getInstance(); $startTime = microtime(true); $focus = 0; $processed_tables = array(); // for keeping track of the tables we have worked on $empty = ''; $new_tables = 1; // is there ever a scenario where we DON'T create the admin user? $new_config = 1; $new_report = 1; // add non-module Beans to this array to keep the installer from erroring. $nonStandardModules = array ( //'Tracker', ); /** * loop through all the Beans and create their tables */ installLog("looping through all the Beans and create their tables"); //start by clearing out the vardefs VardefManager::clearVardef(); foreach( $beanFiles as $bean => $file ) { $doNotInit = array('Scheduler', 'SchedulersJob', 'ProjectTask'); if(in_array($bean, $doNotInit)) { $focus = new $bean(false); } else { $focus = new $bean(); } if ( $bean == 'Configurator' ) continue; $table_name = $focus->table_name; installLog("processing table ".$focus->table_name); // check to see if we have already setup this table if(!in_array($table_name, $processed_tables)) { if(!file_exists("modules/".$focus->module_dir."/vardefs.php")){ continue; } if(!in_array($bean, $nonStandardModules)) { require_once("modules/".$focus->module_dir."/vardefs.php"); // load up $dictionary if($dictionary[$focus->object_name]['table'] == 'does_not_exist') { continue; // support new vardef definitions } } else { continue; //no further processing needed for ignored beans. } // table has not been setup...we will do it now and remember that $processed_tables[] = $table_name; $focus->db->database = $db->database; // set db connection so we do not need to reconnect if($setup_db_drop_tables) { drop_table_install($focus); installLog("dropping table ".$focus->table_name); } if(create_table_if_not_exist($focus)) { installLog("creating table ".$focus->table_name); if( $bean == "User" ){ $new_tables = 1; } if($bean == "Administration") $new_config = 1; } installLog("creating Relationship Meta for ".$focus->getObjectName()); SugarBean::createRelationshipMeta($focus->getObjectName(), $db, $table_name, $empty, $focus->module_dir); echo "."; } // end if() } echo " "; //// END TABLE STUFF /////////////////////////////////////////////////////////////////////////////// //// START RELATIONSHIP CREATION ksort($rel_dictionary); foreach( $rel_dictionary as $rel_name => $rel_data ){ $table = $rel_data['table']; if( $setup_db_drop_tables ){ if( $db->tableExists($table) ){ $db->dropTableName($table); } } if( !$db->tableExists($table) ){ $db->createTableParams($table, $rel_data['fields'], $rel_data['indices']); } SugarBean::createRelationshipMeta($rel_name,$db,$table,$rel_dictionary,''); } /////////////////////////////////////////////////////////////////////////////// //// START CREATE DEFAULTS echo " "; echo "{$mod_strings['LBL_PERFORM_CREATE_DEFAULT']} "; echo " "; installLog("Begin creating Defaults"); if ($new_config) { installLog("insert defaults into config table"); insert_default_settings(); } if ($new_tables) { echo $line_entry_format.$mod_strings['LBL_PERFORM_DEFAULT_USERS'].$line_exit_format; installLog($mod_strings['LBL_PERFORM_DEFAULT_USERS']); create_default_users(); echo $mod_strings['LBL_PERFORM_DONE']; } else { echo $line_entry_format.$mod_strings['LBL_PERFORM_ADMIN_PASSWORD'].$line_exit_format; installLog($mod_strings['LBL_PERFORM_ADMIN_PASSWORD']); $db->setUserName($setup_db_sugarsales_user); $db->setUserPassword($setup_db_sugarsales_password); set_admin_password($setup_site_admin_password); echo $mod_strings['LBL_PERFORM_DONE']; } // default OOB schedulers echo $line_entry_format.$mod_strings['LBL_PERFORM_DEFAULT_SCHEDULER'].$line_exit_format; installLog($mod_strings['LBL_PERFORM_DEFAULT_SCHEDULER']); $scheduler = new Scheduler(); $scheduler->rebuildDefaultSchedulers(); echo $mod_strings['LBL_PERFORM_DONE']; // Enable Sugar Feeds and add all feeds by default installLog("Enable SugarFeeds"); enableSugarFeeds(); // Enable the InsideView connector and add all modules installLog("Enable InsideView Connector"); enableInsideViewConnector(); /////////////////////////////////////////////////////////////////////////////// //// START DEMO DATA // populating the db with seed data installLog("populating the db with seed data"); if( $_SESSION['demoData'] != 'no' ){ set_time_limit( 301 ); echo " "; echo "{$mod_strings['LBL_PERFORM_DEMO_DATA']}"; echo " "; print( $render_table_close ); print( $render_table_open ); global $current_user; $current_user = new User(); $current_user->retrieve(1); include("install/populateSeedData.php"); } $endTime = microtime(true); $deltaTime = $endTime - $startTime; /////////////////////////////////////////////////////////////////////////// //// FINALIZE LANG PACK INSTALL if(isset($_SESSION['INSTALLED_LANG_PACKS']) && is_array($_SESSION['INSTALLED_LANG_PACKS']) && !empty($_SESSION['INSTALLED_LANG_PACKS'])) { updateUpgradeHistory(); } /////////////////////////////////////////////////////////////////////////// //// HANDLE SUGAR VERSIONS require_once('modules/Versions/InstallDefaultVersions.php'); require_once('modules/Connectors/InstallDefaultConnectors.php'); /////////////////////////////////////////////////////////////////////////////// //// INSTALL PASSWORD TEMPLATES include('install/seed_data/Advanced_Password_SeedData.php'); /////////////////////////////////////////////////////////////////////////////// //// SETUP DONE installLog("Installation has completed *********"); $memoryUsed = ''; if(function_exists('memory_get_usage')) { $memoryUsed = $mod_strings['LBL_PERFORM_OUTRO_5'].memory_get_usage().$mod_strings['LBL_PERFORM_OUTRO_6']; } $errTcpip = ''; $fp = @fsockopen("www.sugarcrm.com", 80, $errno, $errstr, 3); if (!$fp) { $errTcpip = " {$mod_strings['ERR_PERFORM_NO_TCPIP']} "; } if ($fp && (!isset( $_SESSION['oc_install']) || $_SESSION['oc_install'] == false)) { @fclose($fp); if ( $next_step == 9999 ) $next_step = 8; $fpResult =<< |
|
|
{$mod_strings['LBL_PERFORM_OUTRO_1']} {$setup_sugar_version} {$mod_strings['LBL_PERFORM_OUTRO_2']}
{$mod_strings['LBL_PERFORM_OUTRO_3']} {$deltaTime} {$mod_strings['LBL_PERFORM_OUTRO_4']}{$fpResult} |