static function createSitemap() { self::$step = 3; if (!isset($_SESSION['sitemap'])) { self::addLog('error', 'Не заполнена карта сайта, необходимо сгенерировать'); } else { self::addLog('success', 'Карта сайта сгенерирована!'); } Sitemap::$basedir = self::$basedir; Sitemap::generateDiv($_SESSION['sitemap']); self::addLog('success', 'SiteMap созданы удачно!'); return true; }
session_start(); require __DIR__ . '/vendor/autoload.php'; if (isset($_POST['db-login'], $_POST['db-pass'], $_POST['db-local'], $_POST['db-name'], $_POST['domain'], $_POST['site-name'], $_POST['email'], $_POST['htaccess'])) { $_SESSION['created'] = date('Y'); $_SESSION['db-login'] = $_POST['db-login']; $_SESSION['db-pass'] = $_POST['db-pass']; $_SESSION['db-local'] = $_POST['db-local']; $_SESSION['db-name'] = $_POST['db-name']; $_SESSION['domain'] = $_POST['domain']; $_SESSION['site-name'] = $_POST['site-name']; $_SESSION['email'] = $_POST['email']; $_SESSION['login'] = $_POST['login']; $_SESSION['password'] = $_POST['password']; $_SESSION['htaccess'] = $_POST['htaccess']; if (isset($_POST['sitemap'])) { $_SESSION['sitemap'] = \FW\Installer\Sitemap::generateMap($_POST['sitemap']); } else { $_SESSION['sitemap'] = []; } } ob_start(); try { \FW\Installer\Installer::$basedir = __DIR__; \FW\Installer\Installer::init(); \FW\Installer\Installer::createDir(); \FW\Installer\Installer::createDB(); \FW\Installer\Installer::createSitemap(); \FW\Installer\Installer::delDir(); } catch (Exception $e) { $error = $e->getMessage(); }