Added an alias to take you home

Browser::goHome();
This commit is contained in:
Josh Sherman 2013-02-16 15:04:38 -05:00
parent 5ccdeb64a7
commit bf15f592e9
2 changed files with 50 additions and 22 deletions

View file

@ -18,8 +18,8 @@
/** /**
* Browser Utility Class * Browser Utility Class
* *
* Just a simple collection of static functions to accomplish some of the more * Just a simple collection of static functions to accomplish some of the
* redundant browser-related tasks. * more redundant browser-related tasks.
*/ */
class Browser extends Object class Browser extends Object
{ {
@ -104,10 +104,11 @@ class Browser extends Object
/** /**
* Redirect * Redirect
* *
* Redirects the browser to another URL. Stops execution as to not run code * Redirects the browser to another URL. Stops execution as to not run
* erroneously due to output buffering. HTTP/1.1 request an absolute URI, * code erroneously due to output buffering. HTTP/1.1 request an
* hence the inclusion of the scheme, hostname and absolute path if :// is * absolute URI, hence the inclusion of the scheme, hostname and
* not found. Don't hate the player, hate the RFC. * absolute path if :// is not found. Don't hate the player, hate the
* RFC.
* *
* @static * @static
* @param string $destination URL to redirect to * @param string $destination URL to redirect to
@ -124,14 +125,27 @@ class Browser extends Object
exit; exit;
} }
/**
* Go Home
*
* Alias for `Browser::redirect('/');`
*
* @static
*/
public static function goHome()
{
Browser::redirect('/');
}
/** /**
* Status * Status
* *
* Pushes a status code to the browser. Some of these codes are site (420) * Pushes a status code to the browser. Some of these codes are site
* and server (444) specific, some just for LOLs (418) and some that are * (420) and server (444) specific, some just for LOLs (418) and some
* still in draft (425) and subject to change. I wanted this to be a * that are still in draft (425) and subject to change. I wanted this
* complete list and in the scenario that a code had multiple meanings, I * to be a complete list and in the scenario that a code had multiple
* favored a more recent RFC (424) even if merely a draft (451). * meanings, I favored a more recent RFC (424) even if merely a draft
* (451).
* *
* @static * @static
* @param integer status response code * @param integer status response code

36
jar.php
View file

@ -323,8 +323,8 @@ class API_Tinychat extends API_Common
/** /**
* Browser Utility Class * Browser Utility Class
* *
* Just a simple collection of static functions to accomplish some of the more * Just a simple collection of static functions to accomplish some of the
* redundant browser-related tasks. * more redundant browser-related tasks.
*/ */
class Browser extends Object class Browser extends Object
{ {
@ -409,10 +409,11 @@ class Browser extends Object
/** /**
* Redirect * Redirect
* *
* Redirects the browser to another URL. Stops execution as to not run code * Redirects the browser to another URL. Stops execution as to not run
* erroneously due to output buffering. HTTP/1.1 request an absolute URI, * code erroneously due to output buffering. HTTP/1.1 request an
* hence the inclusion of the scheme, hostname and absolute path if :// is * absolute URI, hence the inclusion of the scheme, hostname and
* not found. Don't hate the player, hate the RFC. * absolute path if :// is not found. Don't hate the player, hate the
* RFC.
* *
* @static * @static
* @param string $destination URL to redirect to * @param string $destination URL to redirect to
@ -429,14 +430,27 @@ class Browser extends Object
exit; exit;
} }
/**
* Go Home
*
* Alias for `Browser::redirect('/');`
*
* @static
*/
public static function goHome()
{
Browser::redirect('/');
}
/** /**
* Status * Status
* *
* Pushes a status code to the browser. Some of these codes are site (420) * Pushes a status code to the browser. Some of these codes are site
* and server (444) specific, some just for LOLs (418) and some that are * (420) and server (444) specific, some just for LOLs (418) and some
* still in draft (425) and subject to change. I wanted this to be a * that are still in draft (425) and subject to change. I wanted this
* complete list and in the scenario that a code had multiple meanings, I * to be a complete list and in the scenario that a code had multiple
* favored a more recent RFC (424) even if merely a draft (451). * meanings, I favored a more recent RFC (424) even if merely a draft
* (451).
* *
* @static * @static
* @param integer status response code * @param integer status response code