Skip to content

Instantly share code, notes, and snippets.

@joshtronic
Created September 25, 2010 21:07
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 joshtronic/597305 to your computer and use it in GitHub Desktop.
Save joshtronic/597305 to your computer and use it in GitHub Desktop.
/**
* Is Local
*
* Checks if the current site is hosted locally or not.
*
* @static
* @return boolean whether or not the site is hosted locally
*/
public static function isLocal()
{
return ((isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] == '127.0.0.1') || (isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == 'local'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment