forked from artefactual/atom
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqubit_dev.php
More file actions
30 lines (21 loc) · 978 Bytes
/
qubit_dev.php
File metadata and controls
30 lines (21 loc) · 978 Bytes
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
<?php
// This check prevents access to debug front controllers that are deployed by
// accident to production servers. Feel free to remove this, extend it or make
// something more sophisticated.
$allowedIps = ['127.0.0.1', '::1'];
if (false !== $envIp = getenv('ATOM_DEBUG_IP')) {
$allowedIps = array_merge($allowedIps, array_filter(explode(',', $envIp)));
}
if (!in_array(@$_SERVER['REMOTE_ADDR'], $allowedIps)) {
exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
}
// Handle challenge URL requests immediately.
if (0 === strpos($_SERVER['REQUEST_URI'], '/challenge')) {
chdir(__DIR__.'/web/challenge');
require 'index.php';
exit;
}
require __DIR__.'/lib/challenge/filter.php';
require_once dirname(__FILE__).'/config/ProjectConfiguration.class.php';
$configuration = ProjectConfiguration::getApplicationConfiguration('qubit', 'dev', true);
sfContext::createInstance($configuration)->dispatch();