forked from esvit/bazalt-old
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.php
More file actions
33 lines (26 loc) · 1.07 KB
/
bootstrap.php
File metadata and controls
33 lines (26 loc) · 1.07 KB
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
<?php
// respond to preflights
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
// return only the headers and not the content
// only allow CORS if we're doing a GET - i.e. no saving for now.
if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD']) && $_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'] == 'GET') {
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: X-Requested-With');
}
exit;
}
define('SITE_DIR', __DIR__);
define('ERROR_LOG_FILE', SITE_DIR . '/fixme.log');
define('GENERATOR_EXPOSE', false);
define('ENABLE_MULTISITING', false);
define('TEMP_DIR', SITE_DIR . '/tmp');
require_once 'Framework/Vendors/autoload.php';
// Include BAZALT framework
require_once 'Framework/Core/include.inc';
if (!is_file('config.php') || !filesize('config.php')) {
header('Location: /install.php');
exit;
}
require_once 'config.php';
Bazalt\Thumbs\Image::initStorage(__DIR__ . '/static', '/thumb.php?file=/static', SITE_DIR);
Framework\System\Session\Session::setTimeout(30 * 24 * 60 * 60);