Commit: 605317c0738c6067fc20fd6f39cf70aa88152b8f
Author: Daniel P. Brown <danbr...@php.net> Wed, 5 Dec 2012 11:09:23
-0500
Parents: 6228117006d9b02c40cbf7ce3f7a022e74ec083a
Branches: master
Link:
http://git.php.net/?p=web/php.git;a=commitdiff;h=605317c0738c6067fc20fd6f39cf70aa88152b8f
Log:
Change multiple checks and references from 'www.php.net' to plainly 'php.net'
to reduce 301's, fix a few broken items, and ease a bit of the load off the
server (multiple connections per page when statically referenced as
'www.php.net.'
Changed paths:
M bin/createNewsEntry
M copyright.php
M download-logos.php
M get-involved.php
M git-php.php
M include/header.inc
M include/layout.inc
M include/loadavg.inc
M include/site.inc
M mod.php
M my.php
M privacy.php
M quickref.php
M results.php
M sites.php
M software.php
M tips.php
M ws.php
diff --git a/bin/createNewsEntry b/bin/createNewsEntry
index 979e673..f639dac 100755
--- a/bin/createNewsEntry
+++ b/bin/createNewsEntry
@@ -1,7 +1,7 @@
#!/usr/bin/env php
<?php
PHP_SAPI == 'cli' or die("Please run this script using the cli sapi");
-$BASE = "http://www.php.net";
+$BASE = "http://php.net";
function ce(DOMDocument $d, $name, $value, array $attrs = array(), DOMNode $to
= null) {
if ($value) {
diff --git a/copyright.php b/copyright.php
index 1138d60..918e456 100644
--- a/copyright.php
+++ b/copyright.php
@@ -48,7 +48,7 @@ site_header("Copyright", array("current" => "footer"));
<p>
For more information on the PHP Group and the PHP project, please see
- <a href="http://www.php.net/">the PHP homepage</a>.
+ <a href="http://php.net/">the PHP homepage</a>.
</p>
<?php site_footer();
diff --git a/download-logos.php b/download-logos.php
index 5c282f5..fd3f552 100644
--- a/download-logos.php
+++ b/download-logos.php
@@ -33,7 +33,7 @@ function random_bgcolor($min, $max)
<p>
Right click on one of the images and select "Save Image As" to save the
logo (except where otherwise indicated). Then, link it to the main PHP
- site at <code>www.php.net</code>.
+ site at <code>php.net</code>.
</p>
<p>
diff --git a/get-involved.php b/get-involved.php
index ddca2d0..f85862d 100644
--- a/get-involved.php
+++ b/get-involved.php
@@ -424,7 +424,7 @@ directory if you want to learn more about the testing
mechanism.
<li>PHP (the language)</li>
<li>PECL (various additional PHP functionality in the form of
extensions)</li>
<li>PEAR (reusable PHP component library)</li>
- <li>Websites (www.php.net, qa.php.net, doc.php.net, edit.php.net,
etc.)</li>
+ <li>Websites (php.net, qa.php.net, doc.php.net, edit.php.net, etc.)</li>
<li>Documentation (PHP, PECL, PEAR, etc.)</li>
<li>System administration (mail servers, web servers, build-boxes,
monitoring, etc.)</li>
<li>Etc., etc., (etc.)</li>
diff --git a/git-php.php b/git-php.php
index f9cd070..7a4ac9a 100644
--- a/git-php.php
+++ b/git-php.php
@@ -214,7 +214,7 @@ EOT;
</tr>
<tr>
<td class="sub">Creating experimental PHP extensions</td>
- <td>Maintaining www.php.net</td>
+ <td>Maintaining php.net</td>
</tr>
<tr>
<td class="sub">Submitting a patch to PHP</td>
diff --git a/include/header.inc b/include/header.inc
index 1226ae4..4656a69 100644
--- a/include/header.inc
+++ b/include/header.inc
@@ -23,7 +23,7 @@ if (isset($shortname) && $shortname) {
<meta charset="utf-8"/>
<link rel="shortcut icon" href="<?php echo $STATIC_ROOT ?>favicon.ico" />
- <link rel="search" type="application/opensearchdescription+xml"
href="http://www.php.net/phpnetimprovedsearch.src" title="Add PHP.net search" />
+ <link rel="search" type="application/opensearchdescription+xml"
href="http://php.net/phpnetimprovedsearch.src" title="Add PHP.net search" />
<link rel="alternate" type="application/atom+xml" href="<?php echo $MYSITE
?>releases.atom" title="PHP Release feed" />
<link rel="alternate" type="application/atom+xml" href="<?php echo $MYSITE
?>feed.atom" title="PHP: Hypertext Preprocessor" />
diff --git a/include/layout.inc b/include/layout.inc
index a54d22e..be381e5 100644
--- a/include/layout.inc
+++ b/include/layout.inc
@@ -2,9 +2,9 @@
/* $Id$ */
// Set the static content root differently on php.net
-if ($MYSITE == "http://www.php.net/") {
+if ($MYSITE == "http://www.php.net/" || $MYSITE == 'http://php.net/') {
$_SERVER['STATIC_ROOT'] = 'http://static.php.net/www.php.net';
-} elseif ($MYSITE == 'https://www.php.net/') {
+} elseif ($MYSITE == 'https://www.php.net/' || $MYSITE == 'https://php.net/') {
$_SERVER['STATIC_ROOT'] = 'https://static.php.net/www.php.net';
} elseif (!isset($_SERVER['STATIC_ROOT'])) {
$_SERVER['STATIC_ROOT'] = "";
@@ -836,7 +836,7 @@ function site_header_beta($title = '', $config = array())
// For static content
// FIXME: How does static.php.net work? Will it get the /js/ folders?
- if (false && $MYSITE == "http://www.php.net/") {
+ if (false && ($MYSITE == "http://www.php.net/" || $MYSITE ==
'http://php.net/')) {
$STATIC_ROOT = "http://static.php.net/www.php.net/";
} elseif (false && !empty($_SERVER["STATIC_ROOT"])) {
$STATIC_ROOT = $_SERVER["STATIC_ROOT"];
diff --git a/include/loadavg.inc b/include/loadavg.inc
index 4baa93e..0627833 100644
--- a/include/loadavg.inc
+++ b/include/loadavg.inc
@@ -28,7 +28,7 @@ function load_check()
// Adhere to user preferences if valid
$user_mirror = myphpnet_mirror();
if (isset($MIRRORS[$user_mirror]) && $MIRRORS[$user_mirror][7] == MIRROR_OK
- && $user_mirror != "http://www.php.net/") {
+ && $user_mirror != "http://php.net/") {
header("Location: $user_mirror" . substr($_SERVER['REQUEST_URI'], 1));
exit;
}
@@ -38,7 +38,7 @@ function load_check()
// Find potential close mirrors
foreach ($MIRRORS as $murl => $mirror) {
- if ($murl != 'http://www.php.net/' && $mirror[7] == MIRROR_OK &&
$mirror[4] != MIRROR_SPECIAL) {
+ if ($murl != 'http://php.net/' && $mirror[7] == MIRROR_OK &&
$mirror[4] != MIRROR_SPECIAL) {
if ($mirror[0] == $COUNTRY) {
$close_mirrors[] = $murl;
} else {
diff --git a/include/site.inc b/include/site.inc
index 2f44d4e..7edbbac 100644
--- a/include/site.inc
+++ b/include/site.inc
@@ -17,7 +17,7 @@ function is_primary_site($site = FALSE)
{
global $MYSITE;
if (!$site) { $site = $MYSITE; }
- return $site == "http://www.php.net/";
+ return $site == "http://php.net/";
}
// Returns true if the current (or specified)
diff --git a/mod.php b/mod.php
index 24f02a9..32fab15 100644
--- a/mod.php
+++ b/mod.php
@@ -4,7 +4,7 @@
/*
This page supports the PHP.net automoderation system
with enabling users to confirm their emails via the web.
- This script only need to run on www.php.net.
+ This script only need to run on the primary php.net box.
*/
$_SERVER['BASE_PAGE'] = 'mod.php';
@@ -12,8 +12,8 @@ include_once $_SERVER['DOCUMENT_ROOT'] .
'/include/prepend.inc';
site_header("Email confirmation", array("current" => "community"));
-// Only run on www.php.net
-if ($MYSITE != "http://www.php.net/") {
+// Only run on main php.net box.
+if ($MYSITE != "http://www.php.net/" && $MYSITE != 'http://php.net/') {
echo <<<ERROR
<h1>Email confirmation failed</h1>
diff --git a/my.php b/my.php
index b4a66a3..bab76bb 100644
--- a/my.php
+++ b/my.php
@@ -227,7 +227,7 @@ echo (myphpnet_hidesuggest() ? ' checked="checked"' : '');
<h2>Mirror site redirection</h2>
<p>
- The www.php.net site redirects users to mirror sites in several cases
+ The php.net site redirects users to mirror sites in several cases
automatically. It tries to find a close mirror first (a mirror in the
user's country), and if no such mirror is found, it selects one mirror
randomly. Here you can set one preferred mirror site for yourself in
@@ -249,7 +249,7 @@ foreach ($mirror_sites as $murl => $mdata) {
// Skip inactive mirrors
if (mirror_status($murl) != MIRROR_OK ||
- $murl == "http://www.php.net/") { continue; }
+ $murl == "http://www.php.net/" || $murl == 'http://php.net/') {
continue; }
// Compute user friendly mirror name
if ($murl == "NONE") {
diff --git a/privacy.php b/privacy.php
index 4480f71..806044c 100644
--- a/privacy.php
+++ b/privacy.php
@@ -8,7 +8,7 @@ site_header("Privacy Policy", array("current" => "footer"));
<h1>Privacy Policy</h1>
<p>
- This privacy policy covers www.php.net and its associated mirrors.
+ This privacy policy covers php.net and its associated mirrors.
</p>
<h2>Email</h2>
diff --git a/quickref.php b/quickref.php
index d1e04a2..af29f6c 100644
--- a/quickref.php
+++ b/quickref.php
@@ -156,7 +156,7 @@ if ($snippet = is_known_snippet($notfound)) {
// admin/ since these tend to be script-kiddie hack attempts
if(strlen($notfound) > 2 && !strstr($notfound,'tp://') &&
!strstr($notfound,'admin/')):
$srch_rqst =
"/ws.php?profile=$scope&q=".urlencode($notfound)."&lang=$LANG&results=10&start=0&mirror=".trim(substr($MYSITE,7),'/');
-$url = "http://www.php.net".$srch_rqst;
+$url = "http://php.net".$srch_rqst;
$data = fetch_contents($url);
if(!is_array($data)) {
$res = unserialize($data);
diff --git a/results.php b/results.php
index 1bbc89c..677ab5c 100644
--- a/results.php
+++ b/results.php
@@ -42,7 +42,7 @@ $per_page = 10;
$valid_profiles = array('all', 'local', 'manual', 'news', 'bugs', 'pear',
'pecl', 'talks');
$scope = in_array($profile, $valid_profiles) ? $profile : 'all';
-$srch_host = "www.php.net";
+$srch_host = "php.net";
$srch_rqst =
"/ws.php?profile=$scope&q=$uq&lang=$ul&results=$per_page&start=$s&mirror=".trim(substr($MYSITE,7),'/');
$url = "http://".$srch_host.$srch_rqst;
diff --git a/sites.php b/sites.php
index 5fb3972..d72c5f4 100644
--- a/sites.php
+++ b/sites.php
@@ -17,13 +17,13 @@ site_header("A Tourist's Guide", array("current" =>
"help"));
<h1>PHP.net: A Tourist's Guide</h1>
<p>
- Everyone knows the <code>www.php.net</code> site. All of us went there sooner
or later,
+ Everyone knows the <code>php.net</code> site. All of us went there sooner or
later,
and will keep going back there. This is the central reference point for PHP
users, and there is a wealth of information there. Not all of it is obvious.
Come with me, I'll show you.
</p>
-<h2><a href="http://www.php.net/">www.php.net</a>: Main Website</h2>
+<h2><a href="http://php.net/">php.net</a>: Main Website</h2>
<p>
This is the primary web site. The front page is where major news is published:
diff --git a/software.php b/software.php
index 6dd424b..06e8c5b 100644
--- a/software.php
+++ b/software.php
@@ -13,8 +13,8 @@ site_header("PHP Software", array("current" => "help"));
</p>
<p>
- <?php echo make_image("logos/php-icon-white.gif", $alt = "www.php.net",
"left") ?>
- <a href="http://www.php.net/">www.php.net</a><br />
+ <?php echo make_image("logos/php-icon-white.gif", $alt = "php.net", "left")
?>
+ <a href="http://php.net/">php.net</a><br />
Main site for the PHP project.<br clear="left" />
</p>
<p>
diff --git a/tips.php b/tips.php
index ce134a7..2685a8e 100644
--- a/tips.php
+++ b/tips.php
@@ -85,7 +85,7 @@ For more info, see
<ul>
<li>Name: PHP</li>
<li>Keyword: p</li>
- <li>Address: http://www.php.net/search.php</li>
+ <li>Address: http://php.net/search.php</li>
<li>Query string: pattern=%s&show=quickref</li>
</ul>
<p class="note">
diff --git a/ws.php b/ws.php
index 93437a1..2a1b958 100644
--- a/ws.php
+++ b/ws.php
@@ -11,11 +11,11 @@ $s = isset($_REQUEST['start']) ? (int)$_REQUEST['start'] :
1;
$l = isset($_REQUEST['lang']) ? htmlspecialchars($_REQUEST['lang'],
ENT_QUOTES) : 'en';
$m = isset($_REQUEST['mirror']) ? htmlspecialchars($_REQUEST['mirror'],
ENT_QUOTES) : '';
$sites = array( 'all'=>'php.net',
- 'local'=>'www.php.net',
- 'quickref'=>'www.php.net',
- '404quickref'=>'www.php.net',
- 'manual'=>"www.php.net/manual/$l",
- '404manual'=>"www.php.net/manual/$l",
+ 'local'=>'php.net',
+ 'quickref'=>'php.net',
+ '404quickref'=>'php.net',
+ 'manual'=>"php.net/manual/$l",
+ '404manual'=>"php.net/manual/$l",
'news'=>'news.php.net',
'bugs'=>'bugs.php.net',
'pear'=>'pear.php.net',
@@ -30,7 +30,7 @@ if(isset($sites[$_REQUEST['profile']])) {
$scope = htmlspecialchars($_REQUEST['profile'], ENT_QUOTES);
// If they are doing a manual search in a language we don't have a
translation for, default to English
if($scope == 'manual' && empty($ACTIVE_ONLINE_LANGUAGES[$l])) {
- $sites['manual'] = "www.php.net/manual/en";
+ $sites['manual'] = "php.net/manual/en";
}
} else {
$scope = 'all';
--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php