com web/php: Swap uses of _SERVER[DOCUMENT_ROOT] for __DIR__: ChangeLog-4.php ChangeLog-5.p hp ChangeLog-7.php build-setup.php cal.php cont act.php
copyright.php credits.php docs.php down load-docs.php download-logos.php downloads.php elep hpant.php eol.php error.php get-involved.php gi t-php.php
git.php gpg-keys.php include/branches.i nc include/index.php include/ip-to-country.inc includ e/manual-lookup.inc include/prepend.inc include/shared-
manual.inc

From: Date: Fri, 31 May 2019 15:19:09 +0000
Subject: com web/php: Swap uses of _SERVER[DOCUMENT_ROOT] for __DIR__: ChangeLog-4.php ChangeLog-5.p hp ChangeLog-7.php build-setup.php cal.php cont act.php
copyright.php credits.php docs.php down load-docs.php download-logos.php downloads.php elep hpant.php eol.php error.php get-involved.php gi t-php.php
git.php gpg-keys.php include/branches.i nc include/index.php include/ip-to-country.inc includ e/manual-lookup.inc include/prepend.inc include/shared-
manual.inc
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-28125@lists.php.net to get a copy of this message
Commit: 2735e5f03fd7d7443eea5cf95e2094a2f539e3d0 Author: Sara Golemon <pollita@php.net> Fri, 31 May 2019 10:54:12 -0400 Parents: 99d7ea13494ba02ac139ed3f8d63435fa8015de0 Branches: master Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=2735e5f03fd7d7443eea5cf95e2094a2f539e3d0 Log: Swap uses of _SERVER[DOCUMENT_ROOT] for __DIR__ 1/n - Update / and /include/ only. Changed paths: M ChangeLog-4.php M ChangeLog-5.php M ChangeLog-7.php M build-setup.php M cal.php M contact.php M copyright.php M credits.php M docs.php M download-docs.php M download-logos.php M downloads.php M elephpant.php M eol.php M error.php M get-involved.php M git-php.php M git.php M gpg-keys.php M include/branches.inc M include/index.php M include/ip-to-country.inc M include/manual-lookup.inc M include/prepend.inc M include/shared-manual.inc M include/shared-stat.inc M include/site.inc M mailing-lists.php M manual-lookup.php M mirror-info.php M mirror-stats.conf M mirror.php M mirroring-stats.php M mirroring-troubles.php M mirroring.php M mirrors.php M mod.php M my.php M privacy.php M quickref.php M results.php M search.php M security-note.php M sitemap.php M sites.php M software.php M submit-event.php M support.php M supported-versions.php M thanks.php M ug.php M unsub.php M urlhowto.php

diff --git a/ChangeLog-4.php b/ChangeLog-4.php index 8b46cd7..f422cd1 100644 --- a/ChangeLog-4.php +++ b/ChangeLog-4.php @@ -1,7 +1,7 @@ <?php $_SERVER['BASE_PAGE'] = 'ChangeLog-4.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/changelogs.inc'; +include_once __DIR__ . '/include/prepend.inc'; +include_once __DIR__ . '/include/changelogs.inc'; site_header("PHP 4 ChangeLog", array("current" => "docs", "css" => array("changelog.css"), "layout_span" => 12)); ?> diff --git a/ChangeLog-5.php b/ChangeLog-5.php index 64273ed..86e2963 100644 --- a/ChangeLog-5.php +++ b/ChangeLog-5.php @@ -1,7 +1,7 @@ <?php $_SERVER['BASE_PAGE'] = 'ChangeLog-5.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/changelogs.inc'; +include_once __DIR__ . '/include/prepend.inc'; +include_once __DIR__ . '/include/changelogs.inc'; site_header("PHP 5 ChangeLog", array("current" => "docs", "css" => array("changelog.css"), "layout_span" => 12)); ?> diff --git a/ChangeLog-7.php b/ChangeLog-7.php index 753af31..b0f4b6d 100644 --- a/ChangeLog-7.php +++ b/ChangeLog-7.php @@ -1,7 +1,7 @@ <?php $_SERVER['BASE_PAGE'] = 'ChangeLog-7.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/changelogs.inc'; +include_once __DIR__ . '/include/prepend.inc'; +include_once __DIR__ . '/include/changelogs.inc'; site_header("PHP 7 ChangeLog", array("current" => "docs", "css" => array("changelog.css"), "layout_span" => 12)); ?> <h1>PHP 7 ChangeLog</h1> diff --git a/build-setup.php b/build-setup.php index 43d01f6..0ee8567 100644 --- a/build-setup.php +++ b/build-setup.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'get-involved.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; $SIDEBAR_DATA =' <div class="panel"> diff --git a/cal.php b/cal.php index 74ed304..8d27de4 100644 --- a/cal.php +++ b/cal.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'cal.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; $site_header_config = array( "current" => "community", diff --git a/contact.php b/contact.php index fd160a6..e1d3907 100644 --- a/contact.php +++ b/contact.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'contact.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; site_header("Contact", array("current" => "community")); ?> diff --git a/copyright.php b/copyright.php index 92b0e4a..c7b5b03 100644 --- a/copyright.php +++ b/copyright.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'copyright.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; $SIDEBAR_DATA = ' <a name="license"></a> <h3>PHP License</h3> diff --git a/credits.php b/credits.php index 0be3eeb..540919c 100644 --- a/credits.php +++ b/credits.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'credits.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; // Put credits information to $credits ob_start(); diff --git a/docs.php b/docs.php index 9f4b173..4e744aa 100644 --- a/docs.php +++ b/docs.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'docs.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; site_header("Documentation", array("current" => "docs")); diff --git a/download-docs.php b/download-docs.php index 1dfec33..69eb66a 100644 --- a/download-docs.php +++ b/download-docs.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'download-docs.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; if (!empty($_GET['active_langs'])) { echo serialize($ACTIVE_ONLINE_LANGUAGES); diff --git a/download-logos.php b/download-logos.php index 71ba3e7..0215890 100644 --- a/download-logos.php +++ b/download-logos.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'download-logos.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; $SIDEBAR_DATA = ' <h3>More PHP artwork</h3> <p> diff --git a/downloads.php b/downloads.php index 51ce178..01de834 100644 --- a/downloads.php +++ b/downloads.php @@ -1,8 +1,8 @@ <?php // vim: et $_SERVER['BASE_PAGE'] = 'downloads.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/gpg-keys.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/version.inc'; +include_once __DIR__ . '/include/prepend.inc'; +include_once __DIR__ . '/include/gpg-keys.inc'; +include_once __DIR__ . '/include/version.inc'; // Try to make this page non-cached header_nocache(); diff --git a/elephpant.php b/elephpant.php index cb8a46b..8aa3af7 100644 --- a/elephpant.php +++ b/elephpant.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'elephpant.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; $SIDEBAR_DATA = ' <a name="license"></a> <h3>PHP License</h3> diff --git a/eol.php b/eol.php index a470f32..7580082 100644 --- a/eol.php +++ b/eol.php @@ -1,8 +1,8 @@ <?php $_SERVER['BASE_PAGE'] = 'eol.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/branches.inc'; +include_once __DIR__ . '/include/prepend.inc'; +include_once __DIR__ . '/include/branches.inc'; // Notes for specific branches can be added here, and will appear in the table. $BRANCH_NOTES = array( diff --git a/error.php b/error.php index 1da1f27..3cf8b6c 100644 --- a/error.php +++ b/error.php @@ -10,10 +10,10 @@ */ // Ensure that our environment is set up -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/languages.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/loadavg.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/errors.inc'; +include_once __DIR__ . '/include/prepend.inc'; +include_once __DIR__ . '/include/languages.inc'; +include_once __DIR__ . '/include/loadavg.inc'; +include_once __DIR__ . '/include/errors.inc'; // Get URI for this request, strip leading slash // See langchooser.inc for more info on STRIPPED_URI @@ -24,13 +24,13 @@ $URI = substr($_SERVER['STRIPPED_URI'], 1); // dependent, so the search results will show up in the sidebar) if ($URI == 'phpnetsearch.src') { status_header(200); - include_once $_SERVER['DOCUMENT_ROOT'] . '/include/mozsearch.inc'; + include_once __DIR__ . '/include/mozsearch.inc'; exit; } // FIXME: Nuke the old firefox search plugin if ($URI == 'phpnetimprovedsearch.src') { status_header(200); - include_once $_SERVER['DOCUMENT_ROOT'] . '/include/mozopensearch.inc'; + include_once __DIR__ . '/include/mozopensearch.inc'; exit; } @@ -45,7 +45,7 @@ if (preg_match("!^bugs.php\\?(.+)$!", $URI, $array)) { if (preg_match("!^security/advisories/PHPSA-(\\d+)\\.php$!", $URI, $array)) { status_header(200); $_GET["id"] = $array[1]; - include_once $_SERVER['DOCUMENT_ROOT'] . '/security/index.php'; + include_once __DIR__ . '/security/index.php'; exit; } @@ -112,7 +112,7 @@ if (preg_match("!^manual/(\\w+)/(print|printwn|html)((/.+)|$)!", $URI, $array)) // send them to the /releases page since that is likely to be most helpful. if (preg_match("!^distributions/.*!", $URI, $array)) { status_header(404); - include_once $_SERVER['DOCUMENT_ROOT'] . "/releases/index.php"; + include_once __DIR__ . "/releases/index.php"; } // ============================================================================ @@ -136,7 +136,7 @@ if (preg_match("!^get/([^/]+)/from/([^/]+)(/mirror)?$!", $URI, $dlinfo)) { $df = $dlinfo[1]; if(strpos($df, "7-LATEST") !== false) { - include_once $_SERVER['DOCUMENT_ROOT'] . "/include/version.inc"; + include_once __DIR__ . "/include/version.inc"; $df = str_replace("7-LATEST", $PHP_7_VERSION, $df); } @@ -596,17 +596,17 @@ if (isset($external_redirects[$URI])) { // will be capable of being included from anywhere if ($URI=='mirror-info') { status_header(200); - include_once $_SERVER['DOCUMENT_ROOT'] . "/$URI.php"; + include_once __DIR__ . "/$URI.php"; exit; } // ============================================================================ // Try to find the page using the preferred language as a manual page -include_once $_SERVER['DOCUMENT_ROOT'] . "/include/manual-lookup.inc"; +include_once __DIR__ . "/include/manual-lookup.inc"; $try = find_manual_page($LANG, $URI); if ($try) { status_header(200); - include_once $_SERVER['DOCUMENT_ROOT'] . $try; + include_once __DIR__ . $try; exit; } // BC. The class methods are now classname.methodname diff --git a/get-involved.php b/get-involved.php index b0b805c..a1ae9b0 100644 --- a/get-involved.php +++ b/get-involved.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'get-involved.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; site_header("Get Involved", array("current" => "community")); ?> diff --git a/git-php.php b/git-php.php index 06ec5e6..a0e5e5e 100644 --- a/git-php.php +++ b/git-php.php @@ -1,8 +1,8 @@ <?php $_SERVER['BASE_PAGE'] = 'git-php.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/email-validation.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/posttohost.inc'; +include_once __DIR__ . '/include/prepend.inc'; +include_once __DIR__ . '/include/email-validation.inc'; +include_once __DIR__ . '/include/posttohost.inc'; // Force the account requests to php.net if (!is_primary_site()) { diff --git a/git.php b/git.php index e394860..80dbb6f 100644 --- a/git.php +++ b/git.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'git.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; $SIDEBAR_DATA = ' <h3>What is Git?</h3> <p> diff --git a/gpg-keys.php b/gpg-keys.php index ea84673..a0729a4 100644 --- a/gpg-keys.php +++ b/gpg-keys.php @@ -1,8 +1,8 @@ <?php // vim: et $_SERVER['BASE_PAGE'] = 'gpg-keys.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/gpg-keys.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/version.inc'; +include_once __DIR__ . '/include/prepend.inc'; +include_once __DIR__ . '/include/gpg-keys.inc'; +include_once __DIR__ . '/include/version.inc'; site_header('GPG Keys'); ?> diff --git a/include/branches.inc b/include/branches.inc index 4e74370..361cb00 100644 --- a/include/branches.inc +++ b/include/branches.inc @@ -1,6 +1,6 @@ <?php -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/releases.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/version.inc'; +include_once __DIR__ . '/releases.inc'; +include_once __DIR__ . '/version.inc'; /* Branch overrides. For situations where we've changed the exact dates for a * branch's active support and security fix EOLs, these can be reflected here. diff --git a/include/index.php b/include/index.php index e617811..793ccc7 100644 --- a/include/index.php +++ b/include/index.php @@ -1,5 +1,5 @@ <?php // Simulate a /include shortcut call (which will lead to a manual page) $_SERVER['REQUEST_URI'] = '/include'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/error.php'; +include_once __DIR__ . '/prepend.inc'; +include_once __DIR__ . '/../error.php'; diff --git a/include/ip-to-country.inc b/include/ip-to-country.inc index a274ec7..958ddc9 100644 --- a/include/ip-to-country.inc +++ b/include/ip-to-country.inc @@ -88,7 +88,7 @@ function i2c_search_in_index($ip) // Open the index file for reading $dbidx = fopen( - $_SERVER['DOCUMENT_ROOT'] . "/backend/ip-to-country.idx", + __DIR__ . "/../backend/ip-to-country.idx", "r" ); if (!$dbidx) { return FALSE; } diff --git a/include/manual-lookup.inc b/include/manual-lookup.inc index 87ea9cb..1fc2cbf 100644 --- a/include/manual-lookup.inc +++ b/include/manual-lookup.inc @@ -1,7 +1,7 @@ <?php // -*- C++ -*- // We need this for error reporting -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/errors.inc'; +include_once __DIR__ . '/errors.inc'; // Try to find some variations of keyword with $prefix in the $lang manual function tryprefix($lang, $keyword, $prefix) diff --git a/include/prepend.inc b/include/prepend.inc index 674366e..ee86788 100644 --- a/include/prepend.inc +++ b/include/prepend.inc @@ -73,21 +73,21 @@ if (get_magic_quotes_runtime()) { } // Site details (mirror site information) -include $_SERVER['DOCUMENT_ROOT'] . '/include/site.inc'; +include __DIR__ . '/site.inc'; // Choose language used for translated parts -include $_SERVER['DOCUMENT_ROOT'] . '/include/langchooser.inc'; +include __DIR__ . '/langchooser.inc'; // Get country of the user and set it in a cookie -include $_SERVER['DOCUMENT_ROOT'] . '/include/ip-to-country.inc'; +include __DIR__ . '/ip-to-country.inc'; // Common layout functions -include $_SERVER['DOCUMENT_ROOT'] . '/include/layout.inc'; +include __DIR__ . '/layout.inc'; // This file is generated on rsync.php.net and propagated // from there. It just defines $LAST_UPDATED, which is the // mirror's last updated time. -include $_SERVER['DOCUMENT_ROOT'] . '/include/last_updated.inc'; +include __DIR__ . '/last_updated.inc'; // ----------------------------------------------------------------------------- diff --git a/include/shared-manual.inc b/include/shared-manual.inc index 6867b7b..735d8ee 100644 --- a/include/shared-manual.inc +++ b/include/shared-manual.inc @@ -13,7 +13,7 @@ */ // Ensure that our environment is set up -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/prepend.inc'; // Set variable defaults $PGI = array(); $SIDEBAR_DATA = ''; diff --git a/include/shared-stat.inc b/include/shared-stat.inc index af69405..bec7130 100644 --- a/include/shared-stat.inc +++ b/include/shared-stat.inc @@ -1,5 +1,5 @@ <?php // -*- C++ -*- -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/prepend.inc'; function commonStatHeader($title) { site_header($title); diff --git a/include/site.inc b/include/site.inc index e096c16..1ab7265 100644 --- a/include/site.inc +++ b/include/site.inc @@ -21,16 +21,16 @@ $MIRRORS = array( ); // Define $COUNTRIES array -include $_SERVER['DOCUMENT_ROOT'] . '/include/countries.inc'; +include __DIR__ . '/countries.inc'; // Define $COUNTRIES_ALPHA2 array -include $_SERVER['DOCUMENT_ROOT'] . '/include/countries-alpha2.inc'; +include __DIR__ . '/countries-alpha2.inc'; // Define $COUNTRY_ALPHA_2_TO_3 array -include $_SERVER['DOCUMENT_ROOT'] . '/include/countries_alpha_mapping.inc'; +include __DIR__ . '/countries_alpha_mapping.inc'; // Define $LANGUAGES array -include $_SERVER['DOCUMENT_ROOT'] . '/include/languages.inc'; +include __DIR__ . '/languages.inc'; // Returns true if the current (or specified) // site is the primary mirror site diff --git a/mailing-lists.php b/mailing-lists.php index 86f860f..af557b4 100644 --- a/mailing-lists.php +++ b/mailing-lists.php @@ -1,8 +1,8 @@ <?php $_SERVER['BASE_PAGE'] = 'mailing-lists.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/posttohost.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/email-validation.inc'; +include_once __DIR__ . '/include/prepend.inc'; +include_once __DIR__ . '/include/posttohost.inc'; +include_once __DIR__ . '/include/email-validation.inc'; $SIDEBAR_DATA = ' <h3>Would like to unsubscribe yourself?</h3> diff --git a/manual-lookup.php b/manual-lookup.php index 369b6ef..1048a1f 100644 --- a/manual-lookup.php +++ b/manual-lookup.php @@ -1,8 +1,8 @@ <?php $_SERVER['BASE_PAGE'] = 'manual-lookup.php'; -include $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include $_SERVER['DOCUMENT_ROOT'] . '/include/loadavg.inc'; -include $_SERVER['DOCUMENT_ROOT'] . '/include/manual-lookup.inc'; +include __DIR__ . '/include/prepend.inc'; +include __DIR__ . '/include/loadavg.inc'; +include __DIR__ . '/include/manual-lookup.inc'; // BC code, so pattern and function can both be used as // parameters to specify the function name @@ -35,6 +35,6 @@ if ($function) { // Fall back to a quick reference search $notfound = $function; -include $_SERVER['DOCUMENT_ROOT'] . '/quickref.php'; +include __DIR__ . '/quickref.php'; ?> diff --git a/mirror-info.php b/mirror-info.php index 72e7733..d9fb5c4 100644 --- a/mirror-info.php +++ b/mirror-info.php @@ -1,9 +1,9 @@ <?php // Define $MYSITE and $LAST_UPDATED variables -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; // Define $PHP_7_3_VERSION, $PHP_7_3_SHA256 & $RELEASES variables -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/version.inc'; +include_once __DIR__ . '/include/version.inc'; // Text/plain content type for better readability in browsers header("Content-type: text/plain; charset=utf-8"); diff --git a/mirror-stats.conf b/mirror-stats.conf index 74c2b85..f710559 100644 --- a/mirror-stats.conf +++ b/mirror-stats.conf @@ -151,7 +151,7 @@ PageType php #HTMLPre <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> -HTMLPre <?php $_SERVER['BASE_PAGE'] = 'stats/index.php'; include_once $_SERVER['DOCUMENT_ROOT'] . "/include/prepend.inc"; ?> +HTMLPre <?php $_SERVER['BASE_PAGE'] = 'stats/index.php'; include_once __DIR__ . "/include/prepend.inc"; ?> # HTMLHead defines HTML code to insert within the <HEAD></HEAD> # block, immediately after the <TITLE> line. Maximum line length diff --git a/mirror.php b/mirror.php index 64e45e6..29a8ebe 100644 --- a/mirror.php +++ b/mirror.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'mirror.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; $SIDEBAR_DATA = ' <h3>More mirror sites</h3> <p> diff --git a/mirroring-stats.php b/mirroring-stats.php index 573ee02..c16d3a1 100644 --- a/mirroring-stats.php +++ b/mirroring-stats.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'mirroring-stats.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; site_header("Setting Up Local Stats", array("current" => "community")); ?> diff --git a/mirroring-troubles.php b/mirroring-troubles.php index 2555fbe..ea79e18 100644 --- a/mirroring-troubles.php +++ b/mirroring-troubles.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'mirroring-troubles.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; $SIDEBAR_DATA = ' <h3>Other mirror information</h3> diff --git a/mirroring.php b/mirroring.php index 974fd53..475419c 100644 --- a/mirroring.php +++ b/mirroring.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'mirroring.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; $SIDEBAR_DATA = ' <h3>Existing mirror sites</h3> <p> diff --git a/mirrors.php b/mirrors.php index ad3f171..61c8b25 100644 --- a/mirrors.php +++ b/mirrors.php @@ -1,5 +1,5 @@ <?php -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; header("HTTP/1.1 301 Moved Permanently"); header("Location: /"); diff --git a/mod.php b/mod.php index bb12b8f..4cbbff4 100644 --- a/mod.php +++ b/mod.php @@ -6,7 +6,7 @@ */ $_SERVER['BASE_PAGE'] = 'mod.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; site_header("Email confirmation", array("current" => "community")); diff --git a/my.php b/my.php index dfe35f8..428a884 100644 --- a/my.php +++ b/my.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'my.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; // Try to make this page non-cached header_nocache(); diff --git a/privacy.php b/privacy.php index 5751b19..0e2e69f 100644 --- a/privacy.php +++ b/privacy.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'privacy.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; site_header("Privacy Policy", array("current" => "footer")); ?> diff --git a/quickref.php b/quickref.php index 745634a..da786b9 100644 --- a/quickref.php +++ b/quickref.php @@ -14,9 +14,9 @@ // Ensure that our environment is set up $_SERVER['BASE_PAGE'] = 'quickref.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/errors.inc'; -include $_SERVER['DOCUMENT_ROOT'] . '/include/results.inc'; +include_once __DIR__ . '/include/prepend.inc'; +include_once __DIR__ . '/include/errors.inc'; +include __DIR__ . '/include/results.inc'; if (empty($notfound)) { mirror_redirect("/search.php"); diff --git a/results.php b/results.php index 2800021..273e488 100644 --- a/results.php +++ b/results.php @@ -1,7 +1,7 @@ <?php $_SERVER['BASE_PAGE'] = 'results.php'; -include $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include $_SERVER['DOCUMENT_ROOT'] . '/include/results.inc'; +include __DIR__ . '/include/prepend.inc'; +include __DIR__ . '/include/results.inc'; if (!isset($_GET['l']) || !is_string($_GET['l'])) { $_GET['l'] = null; diff --git a/search.php b/search.php index 9f3d3f1..c2dee3b 100644 --- a/search.php +++ b/search.php @@ -1,6 +1,6 @@ <?php // vim: et $_SERVER['BASE_PAGE'] = 'search.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; // --------------------------------------------------------------------------- diff --git a/security-note.php b/security-note.php index c964938..264ebcf 100644 --- a/security-note.php +++ b/security-note.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'security-note.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; site_header("A Note on Security in PHP", array("current" => "docs")); ?> diff --git a/sitemap.php b/sitemap.php index c7e9edc..bbb6542 100644 --- a/sitemap.php +++ b/sitemap.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'sitemap.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; site_header("Sitemap", array("current" => "help")); ?> diff --git a/sites.php b/sites.php index 1393ec4..a27971a 100644 --- a/sites.php +++ b/sites.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'sites.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; site_header("A Tourist's Guide", array("current" => "help")); ?> diff --git a/software.php b/software.php index 0044d80..4b805c8 100644 --- a/software.php +++ b/software.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'software.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; site_header("PHP Software", array("current" => "help")); ?> diff --git a/submit-event.php b/submit-event.php index 26dbd47..5f4cef5 100644 --- a/submit-event.php +++ b/submit-event.php @@ -1,8 +1,8 @@ <?php $_SERVER['BASE_PAGE'] = 'submit-event.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/posttohost.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/email-validation.inc'; +include_once __DIR__ . '/include/prepend.inc'; +include_once __DIR__ . '/include/posttohost.inc'; +include_once __DIR__ . '/include/email-validation.inc'; site_header("Submit an Event", array("current" => "community")); // No errors, processing depends on POST data diff --git a/support.php b/support.php index e28cb7e..89ab7a0 100644 --- a/support.php +++ b/support.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'support.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; $SIDEBAR_DATA =' <div class="panel" style="position:fixed"> diff --git a/supported-versions.php b/supported-versions.php index d081ee7..8608886 100644 --- a/supported-versions.php +++ b/supported-versions.php @@ -1,8 +1,8 @@ <?php $_SERVER['BASE_PAGE'] = 'supported-versions.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/branches.inc'; +include_once __DIR__ . '/include/prepend.inc'; +include_once __DIR__ . '/include/branches.inc'; site_header('Supported Versions', array('css' => array('supported-versions.css'))); @@ -85,7 +85,7 @@ $VERSION_NOTES = array( * ensuring that we have the same text formatting as the rest of the page. */ $non_standalone = true; -include $_SERVER['DOCUMENT_ROOT'] . '/images/supported-versions.php'; +include __DIR__ . '/images/supported-versions.php'; ?> <h4>Key</h4> diff --git a/thanks.php b/thanks.php index 65855e3..f5308e6 100644 --- a/thanks.php +++ b/thanks.php @@ -1,7 +1,7 @@ <?php $_SERVER['BASE_PAGE'] = 'thanks.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/historical_mirrors.inc'; +include_once __DIR__ . '/include/prepend.inc'; +include_once __DIR__ . '/include/historical_mirrors.inc'; site_header("Thanks", array("current" => "community")); ?> diff --git a/ug.php b/ug.php index 53efd11..c55c52a 100644 --- a/ug.php +++ b/ug.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'ug.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; mirror_setcookie("LAST_UG", $_SERVER["REQUEST_TIME"]+60*60*24, 60*60*24); site_header("Hypertext Preprocessor", diff --git a/unsub.php b/unsub.php index a5e0189..e89c1da 100644 --- a/unsub.php +++ b/unsub.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'unsub.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; $SIDEBAR_DATA = ' <h3>Other PHP related mailing lists</h3> diff --git a/urlhowto.php b/urlhowto.php index bdbdcb0..196be2b 100644 --- a/urlhowto.php +++ b/urlhowto.php @@ -1,6 +1,6 @@ <?php $_SERVER['BASE_PAGE'] = 'urlhowto.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once __DIR__ . '/include/prepend.inc'; $SIDEBAR_DATA=' <h3>URL examples</h3>
« previous php.webmaster (#28125) next »