-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
27 lines (21 loc) · 994 Bytes
/
index.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
<?php
// If you wish to put the folder with the Bolt configuration files in another location than /app/config/,
// define it here as a constant. If you do not define it here, the default location is used.
// One level above the 'webroot'
// define('BOLT_CONFIG_DIR', __DIR__ . '/config');
// PHP -S (built-in webserver) doesn't handle static assets without a `return false`
// For more information, see: http://silex.sensiolabs.org/doc/web_servers.html#php-5-4
if ('cli-server' === php_sapi_name()) {
$filename = __DIR__ . preg_replace('#(\?.*)$#', '', $_SERVER['REQUEST_URI']);
// If it is a file, just return false.
if (is_file($filename)) {
return false;
} elseif (preg_match("~^/thumbs/(.*)$~", $_SERVER['REQUEST_URI'])) {
// If it's not a prebuilt file, but it is a thumb that needs processing
require __DIR__ . '/app/classes/timthumb.php';
return true;
}
}
require_once __DIR__ . '/app/bootstrap.php';
// Here we go!
$app->run();