3 * Check if everything is fine
5 header('HTTP/1.0 500 Internal Server Error');
9 header('HTTP/1.0 500 Internal Server Error');
10 header('Content-Type: text/plain');
11 echo 'Error: ' . $msg . "\n";
15 $configFile = __DIR__ . '/../config.php';
16 if (!file_exists($configFile)) {
17 error('config.php missing. Copy config.php.dist to config.php');
20 require_once $configFile;
21 require_once __DIR__ . '/../src/ProfileDb.php';
23 $dbFile = ProfileDb::getDbFilePath();
24 if (!file_exists($dbFile)) {
25 $dbFileDir = dirname($dbFile);
26 if (!is_writable($dbFileDir)) {
27 error('Database file directory is not writable: ' . $dbFileDir);
31 if (isset($GLOBALS['popuplarTxtFile'])
32 && strlen($GLOBALS['popuplarTxtFile'])
33 && !file_exists($GLOBALS['popuplarTxtFile'])
35 error('Popular games file does not exist: ' . $GLOBALS['popuplarTxtFile']);
38 if (isset($GLOBALS['featuredFile'])
39 && strlen($GLOBALS['featuredFile'])
40 && !file_exists($GLOBALS['featuredFile'])
42 error('Featured games file does not exist: ' . $GLOBALS['featuredFile']);
45 $cacheDir = __DIR__ . '/../cache/';
46 $appsCacheFile = $cacheDir . 'connect-apps.min.json';
47 $featuredAgesCacheFile = $cacheDir . 'connect-featured-ages.min.json';
49 if (!file_exists($appsCacheFile)) {
50 error('Apps cache file does not exist. Run bin/generate-apps-cache.php');
52 if (!file_exists($featuredAgesCacheFile)) {
53 error('Featured ages cache file does not exist. Run bin/generate-apps-cache.php');
59 header('HTTP/1.0 200 OK');
60 header('Content-Type: text/plain');
61 echo "Everything looks fine\n";