Skip to content

Instantly share code, notes, and snippets.

@danharper
Created January 22, 2015 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danharper/cbaa28ea95be6b49983d to your computer and use it in GitHub Desktop.
Save danharper/cbaa28ea95be6b49983d to your computer and use it in GitHub Desktop.
downtime
<?php
http_response_code(503);
$message = 'Temporary application maintenance in progress. Please try again shortly.';
if (isset($_SERVER['Content-Type']) && strpos($_SERVER['Content-Type'], 'json') !== false)
{
header('Content-Type', 'application/json');
echo json_encode(['error' => $message]);
}
else
{
echo $message;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment