Exemplo n.º 1
0
                    $smarty->assign("T_FAILED_TABLES", true);
                    throw new Exception('A database with this name already exists. If you continue, all of its tables will be deleted');
                }
                if ($values['db_type'] == 'mysql') {
                    $db->Execute("SET NAMES 'UTF8'");
                }
                $GLOBALS['db']->Execute("set foreign_key_checks=0");
                foreach (explode(";\n", str_replace("\r\n", "\n", file_get_contents(G_VERSIONTYPE . '.sql'))) as $command) {
                    if (trim($command)) {
                        $GLOBALS['db']->execute(trim($command));
                    }
                }
                $GLOBALS['db']->Execute("truncate cache");
                $GLOBALS['db']->Execute("set foreign_key_checks=1");
                //Create the file libraries/configuration.php
                Installation::createConfigurationFile($values);
                /**Include the file configuration.php*/
                require_once $path . "configuration.php";
                if (stripos(php_uname(), 'windows') !== false) {
                    EfrontConfiguration::setValue('file_encoding', 'UTF7-IMAP');
                }
                EfrontConfiguration::setValue('version_type', G_VERSIONTYPE);
                EfrontConfiguration::setValue('version_users', '');
                EfrontConfiguration::setValue('version_activated', '');
                EfrontConfiguration::setValue('version_upgrades', '');
                EfrontConfiguration::setValue('version_key', '');
                EfrontConfiguration::setValue('time_zone', date_default_timezone_get());
                $defaultConfig = EfrontConfiguration::getValues();
                $phplivedocxConfig = '<?php
define("PATH_ZF","' . G_ROOTPATH . 'Zend/library/' . '");
define("USERNAME","' . $defaultConfig['phplivedocx_username'] . '");