mirror of
https://github.com/slawkens/myaac.git
synced 2026-01-18 12:16:24 +01:00
* [WIP] Rewrite OTS_Player class * Fix exception on load a non existing player * Fix for servers that don't have the cap & conditions columns * Fix created column on player save * Update OTS_Player.php * Add Monk Sample + fixes * Move FAQ creation to import_base_data + cleanup
75 lines
1.8 KiB
PHP
75 lines
1.8 KiB
PHP
<?php
|
|
define('MYAAC_INSTALL', true);
|
|
|
|
use MyAAC\DataLoader;
|
|
|
|
require_once '../../common.php';
|
|
|
|
require SYSTEM . 'functions.php';
|
|
require BASE . 'install/includes/functions.php';
|
|
require BASE . 'install/includes/locale.php';
|
|
|
|
ini_set('max_execution_time', 300);
|
|
|
|
@ob_end_flush();
|
|
ob_implicit_flush();
|
|
|
|
header('X-Accel-Buffering: no');
|
|
|
|
if(isset($config['installed']) && $config['installed'] && !isset($_SESSION['saved'])) {
|
|
warning($locale['already_installed']);
|
|
return;
|
|
}
|
|
|
|
require SYSTEM . 'init.php';
|
|
|
|
// add player samples
|
|
require_once SYSTEM . 'migrations/49.php';
|
|
$up();
|
|
|
|
DataLoader::setLocale($locale);
|
|
DataLoader::load();
|
|
|
|
// add menus entries
|
|
require_once SYSTEM . 'migrations/17.php';
|
|
$up();
|
|
|
|
// add z_polls tables
|
|
require_once SYSTEM . 'migrations/22.php';
|
|
$up();
|
|
|
|
// add myaac_pages pages
|
|
require_once SYSTEM . 'migrations/27.php';
|
|
$up();
|
|
require_once SYSTEM . 'migrations/30.php';
|
|
$up();
|
|
|
|
// new monster columns
|
|
require_once SYSTEM . 'migrations/31.php';
|
|
$up();
|
|
|
|
// rules page
|
|
require_once SYSTEM . 'migrations/45.php';
|
|
$up();
|
|
|
|
$hooks->trigger(HOOK_INSTALL_FINISH);
|
|
|
|
$db->setClearCacheAfter(true);
|
|
|
|
// cleanup
|
|
foreach($_SESSION as $key => $value) {
|
|
if(str_contains($key, 'var_')) {
|
|
unset($_SESSION[$key]);
|
|
}
|
|
}
|
|
unset($_SESSION['saved']);
|
|
if(file_exists(CACHE . 'install.txt')) {
|
|
unlink(CACHE . 'install.txt');
|
|
}
|
|
|
|
$locale['step_finish_desc'] = str_replace('$ADMIN_PANEL$', generateLink(str_replace('tools/', '',ADMIN_URL), $locale['step_finish_admin_panel'], true), $locale['step_finish_desc']);
|
|
$locale['step_finish_desc'] = str_replace('$HOMEPAGE$', generateLink(str_replace('tools/', '', BASE_URL), $locale['step_finish_homepage'], true), $locale['step_finish_desc']);
|
|
$locale['step_finish_desc'] = str_replace('$LINK$', generateLink('https://my-aac.org', 'https://my-aac.org', true), $locale['step_finish_desc']);
|
|
|
|
success($locale['step_finish_desc']);
|