*/ use wishthis\{Page, Database}; if ($options && $options->getOption('isInstalled')) { header('Location: /?page=login'); die(); } $page = new page(__FILE__, 'Install'); $page->header(); $step = isset($_POST['step']) ? $_POST['step'] : 1; switch ($step) { case 1: ?>

Install

Step

Welcome to the wishthis installer.

wishthis needs a database to function properly. Please enter your credentials.

$value) { if ('DATABASE' === substr($key, 0, 8)) { $configContents = preg_replace('/(' . $key . '.+?\').*?(\')/', '$1' . $value . '$2', $configContents); } } file_put_contents($configPath, $configContents); ?>

Install

Step

Click Continue to test the database connection.

query('CREATE TABLE `users` ( `id` int AUTO_INCREMENT, `email` varchar(64) NOT NULL UNIQUE, `password` varchar(128) NOT NULL, PRIMARY KEY (id) );'); /** * Wishlists */ $database->query('CREATE TABLE `wishlists` ( `id` int AUTO_INCREMENT, `user` int NOT NULL, `name` varchar(128) NOT NULL, PRIMARY KEY (id) );'); /** * Products */ $database->query('CREATE TABLE `products` ( `id` int NOT NULL AUTO_INCREMENT, `wishlist` int NOT NULL, `url` VARCHAR(255) NOT NULL, PRIMARY KEY (id) );'); /** * Options */ $database->query('CREATE TABLE `options` ( `id` int AUTO_INCREMENT, `key` varchar(64) NOT NULL UNIQUE, `value` varchar(128) NOT NULL, PRIMARY KEY (id) );'); $database->query('INSERT INTO `options` (`key`, `value`) VALUES ("isInstalled", true) ;'); ?>

Success

Login
footer();