*/ define('VERSION', '0.3.0'); define('ROOT', __DIR__); /** * Include */ require 'vendor/autoload.php'; $include = new Grandel\IncludeDirectory(__DIR__ . '/src/classes'); $include = new Grandel\IncludeDirectory(__DIR__ . '/src/functions'); /** * Config */ $configPath = __DIR__ . '/' . 'src/config/config.php'; if (file_exists($configPath)) { require $configPath; } /** * Database */ $database = false; $options = false; if ( defined('DATABASE_HOST') && defined('DATABASE_NAME') && defined('DATABASE_USER') && defined('DATABASE_PASSWORD') ) { $database = new wishthis\Database( DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD ); /** * Options */ $options = new wishthis\Options($database); } /** * Session */ ini_set('session.gc_maxlifetime', 0); session_start(); /** * API */ if (isset($api)) { return; } /** * Install */ if (!$options) { $page = 'install'; } /** * User */ if ($options) { $user = new wishthis\User(); } /** * Update * * Check for update every 24 hours. */ use Github\Client; if ($options && !isset($_POST['step'])) { $updateLastChecked = $options->getOption('updateLastChecked'); if (!$updateLastChecked || time() - $updateLastChecked >= 86400) { try { $client = new Client(); $release = $client->api('repo')->releases()->latest('grandeljay', 'wishthis'); $tag = $release['tag_name']; $version = str_replace('v', '', $tag); if (-1 === version_compare($options->version, $version)) { $options->updateAvailable = true; } } catch (\Github\Exception\RuntimeException $th) { echo wishthis\Page::warning($th->getMessage()); } $options->setOption('updateLastChecked', time()); } } /** * Wishlist */ if (!isset($_GET['page']) && isset($_GET['wishlist'])) { $page = 'wishlist'; } /** * Page */ if (!isset($page)) { $page = isset($_GET['page']) ? $_GET['page'] : 'home'; } $pagePath = 'src/pages/' . $page . '.php'; if (file_exists($pagePath)) { require $pagePath; } else { http_response_code(404); ?>

Not found

The requested URL was not found on this server.