Skip to content

Instantly share code, notes, and snippets.

@andypotanin
Created February 20, 2015 21:39
Show Gist options
  • Select an option

  • Save andypotanin/edad00eb3ff1c2a31f70 to your computer and use it in GitHub Desktop.

Select an option

Save andypotanin/edad00eb3ff1c2a31f70 to your computer and use it in GitHub Desktop.
<?php
/**
*
*
* @source https://gist.github.com/andypotanin/edad00eb3ff1c2a31f70
*/
header( 'cache-control:no-cache,no-store,private' );
die(json_encode(array(
"ok" => true,
"time" => date('H:i:s'),
"date" => date('d/m/Y'),
"timezone" => date_default_timezone_get(),
"https" => isset( $_SERVER[ 'HTTPS' ] ) && $_SERVER[ 'HTTPS' ] === 'on' ? true : false,
"uid" => isset( $_SERVER[ 'UNIQUE_ID' ] ) ? $_SERVER[ 'UNIQUE_ID' ] : null,
"phpSelf" => isset( $_SERVER[ 'PHP_SELF' ] ) ? $_SERVER[ 'PHP_SELF' ] : null,
"visitorAddress" => isset( $_SERVER[ 'REMOTE_ADDR' ] ) ? $_SERVER[ 'REMOTE_ADDR' ] : null,
"haveNewRelic" => extension_loaded('newrelic') && function_exists('newrelic_set_appname') ? true :false,
"haveMemcached" => class_exists('Memcached') ? true :false,
), JSON_PRETTY_PRINT));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment