Skip to content

Instantly share code, notes, and snippets.

@hissy hissy/app.php
Last active Nov 3, 2016

Embed
What would you like to do?
concrete5 behind load balancer tester
<?php
// application/bootstrap/app.php
Route::register('/ccm/request_test', function() {
header("Pragma: no-cache");
echo '<dl>';
$app = \Concrete\Core\Support\Facade\Application::getFacadeApplication();
?><dt>Application environment:</dt><dd><?php echo ($app->environment()) ? $app->environment() : 'default'; ?></dd><?php
$request = \Concrete\Core\Http\Request::getInstance();
?><dt>Client IP:</dt><dd><?php echo $request->getClientIp(); ?></dd><?php
?><dt>Host:</dt><dd><?php echo $request->getHost(); ?></dd><?php
?><dt>Port:</dt><dd><?php echo $request->getPort(); ?></dd><?php
?><dt>Scheme:</dt><dd><?php echo $request->getScheme(); ?></dd><?php
?><dt>Secure:</dt><dd><?php echo ($request->isSecure()) ? 'true' : 'false'; ?></dd><?php
?><dt>Canonical URL:</dt><dd><?php echo \Core::make('url/canonical'); ?></dd><?php
?><dt>Get all headers:</dt><dd><pre><?php var_dump(getallheaders()); ?></pre></dd><?php
echo '</dl>';
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.