-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.php
executable file
·43 lines (33 loc) · 1.08 KB
/
bootstrap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/*
* Copyright (c) 2014 Alberto González
* Distributed under MIT License
* (see README for details)
*/
namespace Quaver;
define('GLOBAL_PATH', dirname(__FILE__));
chdir(GLOBAL_PATH);
if (defined('LOG_FILENAME') && LOG_FILENAME === 'cli.log') {
ini_set('display_errors', 0);
} else {
ini_set('display_errors', 1);
}
error_reporting(E_ALL | E_STRICT);
$logFile = defined('LOG_FILENAME') ? LOG_FILENAME : 'script_errors.log';
if (!file_exists(GLOBAL_PATH.'/logs/'.$logFile)) {
$logFile = fopen(GLOBAL_PATH.'/logs/'.$logFile, 'w') or die('Unable to open file!');
fwrite($logFile, '');
fclose($logFile);
}
ini_set('error_log', GLOBAL_PATH.'/logs/'.$logFile);
ini_set('log_errors', 'On');
date_default_timezone_set('Europe/Madrid');
// Check config file
if (php_sapi_name() !== 'cli' && !file_exists(GLOBAL_PATH.'/App/Config.yml')) {
$msg = "This instance of app doesn't seem to be configured,
please read the deployment guide, configure and try again.";
error_log($msg);
echo "<h1>{$msg}</h1>";
die;
}
require_once GLOBAL_PATH.'/vendor/autoload.php';