-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
30 lines (23 loc) · 1.02 KB
/
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
28
29
<?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');
// define('BOLT_CACHE_DIR', __DIR__ . '/cache');
// 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;
}
}
require_once __DIR__ . '/app/bootstrap.php';
if (preg_match("^thumbs/[0-9]+x[0-9]+[a-z]*/.*^i", $_SERVER['REQUEST_URI'])) {
// If it's not a prebuilt file, but it is a thumb that needs processing
require __DIR__ . '/app/classes/timthumb.php';
} else {
// Here we go!
$app->run();
}