com web/php: re-enable prototype. to always show beta mode (sorry about that), and make docs. default to beta mode but respect the my.php cookie.:
include/prepend.inc
| From: | Paul Dragoonis | Date: | Sat, 02 Jul 2011 01:02:49 +0000 |
| Subject: | com web/php: re-enable prototype. to always show beta mode (sorry about that), and make docs. default to beta mode but respect the my.php cookie.: include/prepend.inc |
||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-23517@lists.php.net to get a copy of this message | ||
Commit: 0850e28f0737a5a83b91f7992046a6a3d1865b4e
Author: Philip Olson <philip@php.net> Sat, 2 Jul 2011 01:02:49 +0000
Parents: 7ac919c0af7f9039961d801aa83aa1a03e595a8b
Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=0850e28f0737a5a83b91f7992046a6a3d1865b4e
Log:
re-enable prototype. to always show beta mode (sorry about that), and make docs. default to beta
mode but respect the my.php cookie.
Changed paths:
M include/prepend.inc
Diff:
diff --git a/include/prepend.inc b/include/prepend.inc
index 386b35a...95bce64 100644
--- a/include/prepend.inc
+++ b/include/prepend.inc
@@ -66,11 +66,15 @@ include $_SERVER['DOCUMENT_ROOT'] .
'/include/last_updated.inc';
// Load in the user preferences
function myphpnet_load()
{
- global $MYPHPNET;
+ global $MYPHPNET, $MYSITE;
// Empty the preferences array
$MYPHPNET = array(FALSE, FALSE, "NONE", 0, FALSE);
+ if ($MYSITE === 'http://docs.php.net/') {
+ $MYPHPNET[4] = TRUE;
+ }
+
// If we have a cookie, set the values in the array
if (!empty($_COOKIE['MYPHPNET'])) {
$MYPHPNET = explode(",", $_COOKIE['MYPHPNET']);
@@ -177,12 +181,12 @@ function myphpnet_beta() {
return (bool)$_GET["beta"];
}
- if (isset($MYPHPNET[4])) {
- return (bool)$MYPHPNET[4];
+ if ($MYSITE === 'http://prototype.php.net/') {
+ return true;
}
- if ($MYSITE == "http://prototype.php.net/" || $MYSITE == "http://docs.php.net/") {
- return true;
+ if (isset($MYPHPNET[4])) {
+ return (bool)$MYPHPNET[4];
}
return false;