1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

Enhancement: Enable array_syntax fixer

Co-authored-by: MathiasReker <mathias@reker.dk>

Closes GH-659.
This commit is contained in:
Andreas Möller
2022-08-22 18:59:14 +02:00
committed by GitHub
parent c304829d21
commit d9bcfed482
108 changed files with 3279 additions and 3278 deletions

View File

@@ -20,6 +20,7 @@ $config
->setRiskyAllowed(true)
->setRules([
'array_indentation' => true,
'array_syntax' => true,
'class_attributes_separation' => true,
'constant_case' => true,
'indentation_type' => true,

View File

@@ -2,7 +2,7 @@
$_SERVER['BASE_PAGE'] = 'archive/1998.php';
include_once __DIR__ . '/../include/prepend.inc';
news_archive_sidebar();
site_header("News Archive - 1998", array("cache" => true));
site_header("News Archive - 1998", ["cache" => true]);
?>
<h1>News Archive - 1998</h1>
@@ -91,4 +91,4 @@ site_header("News Archive - 1998", array("cache" => true));
Report or check on bugs in the PHP 3 Bug Database.
</p>
<?php site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
<?php site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -2,7 +2,7 @@
$_SERVER['BASE_PAGE'] = 'archive/1999.php';
include_once __DIR__ . '/../include/prepend.inc';
news_archive_sidebar();
site_header("News Archive - 1999", array("cache" => true));
site_header("News Archive - 1999", ["cache" => true]);
?>
<h1>News Archive - 1999</h1>
@@ -117,4 +117,4 @@ site_header("News Archive - 1999", array("cache" => true));
information!
</p>
<?php site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
<?php site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -2,7 +2,7 @@
$_SERVER['BASE_PAGE'] = 'archive/2000.php';
include_once __DIR__ . '/../include/prepend.inc';
news_archive_sidebar();
site_header("News Archive - 2000", array("cache" => true));
site_header("News Archive - 2000", ["cache" => true]);
?>
<h1>News Archive - 2000</h1>
@@ -165,4 +165,4 @@ site_header("News Archive - 2000", array("cache" => true));
ChangeLog provides a complete list of changes.
</p>
<?php site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
<?php site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -2,7 +2,7 @@
$_SERVER['BASE_PAGE'] = 'archive/2001.php';
include_once __DIR__ . '/../include/prepend.inc';
news_archive_sidebar();
site_header("News Archive - 2001", array("cache" => true));
site_header("News Archive - 2001", ["cache" => true]);
?>
<h1>News Archive - 2001</h1>
@@ -314,4 +314,4 @@ site_header("News Archive - 2001", array("cache" => true));
were discovered in PHP 4.0.4.
</p>
<?php site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
<?php site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -2,7 +2,7 @@
$_SERVER['BASE_PAGE'] = 'archive/2002.php';
include_once __DIR__ . '/../include/prepend.inc';
news_archive_sidebar();
site_header("News Archive - 2002", array("cache" => true));
site_header("News Archive - 2002", ["cache" => true]);
?>
<h1>News Archive - 2002</h1>
@@ -601,4 +601,4 @@ site_header("News Archive - 2002", array("cache" => true));
<li><a href="http://www.phpconference.de/2001/images/PHP_Konferenz/">Conference photos</a></li>
</ul>
<?php site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
<?php site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -2,7 +2,7 @@
$_SERVER['BASE_PAGE'] = 'archive/2003.php';
include_once __DIR__ . '/../include/prepend.inc';
news_archive_sidebar();
site_header("News Archive - 2003", array("cache" => true));
site_header("News Archive - 2003", ["cache" => true]);
?>
<h1>News Archive - 2003</h1>
@@ -795,4 +795,4 @@ site_header("News Archive - 2003", array("cache" => true));
of beta-quality.
</p>
<?php site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
<?php site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -2,7 +2,7 @@
$_SERVER['BASE_PAGE'] = 'archive/2004.php';
include_once __DIR__ . '/../include/prepend.inc';
news_archive_sidebar();
site_header("News Archive - 2004", array("cache" => true));
site_header("News Archive - 2004", ["cache" => true]);
?>
<h1>News Archive - 2004</h1>
@@ -654,4 +654,4 @@ site_header("News Archive - 2004", array("cache" => true));
one of a kind conference!
</p>
<?php site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
<?php site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -2,7 +2,7 @@
$_SERVER['BASE_PAGE'] = 'archive/2005.php';
include_once __DIR__ . '/../include/prepend.inc';
news_archive_sidebar();
site_header("News Archive - 2005", array("cache" => true));
site_header("News Archive - 2005", ["cache" => true]);
?>
<h1>News Archive - 2005</h1>
@@ -536,4 +536,4 @@ For changes in PHP 4.4.0 since PHP 4.3.11, please consult the
Congratulations to us all!
</p>
<?php site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
<?php site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -2,7 +2,7 @@
$_SERVER['BASE_PAGE'] = 'archive/2006.php';
include_once __DIR__ . '/../include/prepend.inc';
news_archive_sidebar();
site_header("News Archive - 2006", array("cache" => true));
site_header("News Archive - 2006", ["cache" => true]);
?>
<h1>News Archive - 2006</h1>
@@ -466,4 +466,4 @@ Further details about this release can be found in the <a href="/release_5_1_2.p
and the full list of changes is available in the <a href="/ChangeLog-5.php#5.1.2">PHP 5 ChangeLog</a>.
</p>
<?php site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
<?php site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -2,7 +2,7 @@
$_SERVER['BASE_PAGE'] = 'archive/2007.php';
include_once __DIR__ . '/../include/prepend.inc';
news_archive_sidebar();
site_header("News Archive - 2007", array("cache" => true));
site_header("News Archive - 2007", ["cache" => true]);
?>
<h1>News Archive - 2007</h1>
@@ -674,4 +674,4 @@ This year, the conference once again promises to be an excellent event for PHP d
</div>
</div>
<?php site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
<?php site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -2,7 +2,7 @@
$_SERVER['BASE_PAGE'] = 'archive/2008.php';
include_once __DIR__ . '/../include/prepend.inc';
news_archive_sidebar();
site_header("News Archive - 2008", array("cache" => true));
site_header("News Archive - 2008", ["cache" => true]);
?>
<h1>News Archive - 2008</h1>
@@ -950,4 +950,4 @@ releases to address security issues could be made until 2008-08-08.
</div>
</div>
<?php site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
<?php site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -2,7 +2,7 @@
$_SERVER['BASE_PAGE'] = 'archive/2009.php';
include_once __DIR__ . '/../include/prepend.inc';
news_archive_sidebar();
site_header("News Archive - 2009", array("cache" => true));
site_header("News Archive - 2009", ["cache" => true]);
?>
<h1>News Archive - 2009</h1>
@@ -965,4 +965,4 @@ site_header("News Archive - 2009", array("cache" => true));
</div>
<?php site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
<?php site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -2,7 +2,7 @@
$_SERVER['BASE_PAGE'] = 'archive/2010.php';
include_once __DIR__ . '/../include/prepend.inc';
news_archive_sidebar();
site_header("News Archive - 2010", array("cache" => true));
site_header("News Archive - 2010", ["cache" => true]);
?>
<h1>News Archive - 2010</h1>
@@ -765,4 +765,4 @@ class Bar {<br>
</div>
</div>
<?php site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
<?php site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -2,7 +2,7 @@
$_SERVER['BASE_PAGE'] = 'archive/2011.php';
include_once __DIR__ . '/../include/prepend.inc';
news_archive_sidebar();
site_header("News Archive - 2011", array("cache" => true));
site_header("News Archive - 2011", ["cache" => true]);
?>
<h1>News Archive - 2011</h1>
@@ -1013,4 +1013,4 @@ site_header("News Archive - 2011", array("cache" => true));
</div>
</div>
<?php site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
<?php site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -2,7 +2,7 @@
$_SERVER['BASE_PAGE'] = 'archive/2012.php';
include_once __DIR__ . '/../include/prepend.inc';
news_archive_sidebar();
site_header("News Archive - 2012", array("cache" => true));
site_header("News Archive - 2012", ["cache" => true]);
?>
<h1>News Archive - 2012</h1>
@@ -1064,4 +1064,4 @@ site_header("News Archive - 2012", array("cache" => true));
</div>
</div>
<?php site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
<?php site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -4,7 +4,7 @@ $_SERVER['BASE_PAGE'] = 'archive/2013.php';
include_once __DIR__ . '/../include/prepend.inc';
include_once __DIR__ . '/../include/pregen-news.inc';
news_archive_sidebar();
site_header("News Archive - 2013", array("cache" => true));
site_header("News Archive - 2013", ["cache" => true]);
?>
<h1>News Archive - 2013</h1>
@@ -1485,4 +1485,4 @@ site_header("News Archive - 2013", array("cache" => true));
<?php
site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -4,7 +4,7 @@ $_SERVER['BASE_PAGE'] = 'archive/2014.php';
include_once __DIR__ . '/../include/prepend.inc';
include_once __DIR__ . '/../include/pregen-news.inc';
news_archive_sidebar();
site_header("News Archive - 2014", array("cache" => true));
site_header("News Archive - 2014", ["cache" => true]);
?>
<h1>News Archive - 2014</h1>
@@ -2094,4 +2094,4 @@ The list of changes is recorded in the <a href="http://www.php.net/ChangeLog-5.p
<?php
/* %s/<a href="\(.*\)"><img src="\/images\/news\/\(.*\)" alt="\(.*\)" width.*><\/a>/<?php news_image("\1", "\2", "\3"); ?>/g */
site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -18,7 +18,7 @@ site_header("News Archive - 2015");
<?php
print_news($NEWS_ENTRIES, array("conferences", "cfp", "frontpage", "nofrontpage"), 500, 2015);
print_news($NEWS_ENTRIES, ["conferences", "cfp", "frontpage", "nofrontpage"], 500, 2015);
/* %s/<a href="\(.*\)"><img src="\/images\/news\/\(.*\)" alt="\(.*\)" width.*><\/a>/<?php news_image("\1", "\2", "\3"); ?>/g */
site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -18,7 +18,7 @@ site_header("News Archive - 2016");
<?php
print_news($NEWS_ENTRIES, array("conferences", "cfp", "frontpage", "nofrontpage"), 500, 2016);
print_news($NEWS_ENTRIES, ["conferences", "cfp", "frontpage", "nofrontpage"], 500, 2016);
/* %s/<a href="\(.*\)"><img src="\/images\/news\/\(.*\)" alt="\(.*\)" width.*><\/a>/<?php news_image("\1", "\2", "\3"); ?>/g */
site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -21,4 +21,4 @@ site_header("News Archive - 2017");
print_news($NEWS_ENTRIES, null, 500, 2017);
/* %s/<a href="\(.*\)"><img src="\/images\/news\/\(.*\)" alt="\(.*\)" width.*><\/a>/<?php news_image("\1", "\2", "\3"); ?>/g */
site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -21,4 +21,4 @@ site_header("News Archive - 2018");
print_news($NEWS_ENTRIES, null, 500, 2018);
/* %s/<a href="\(.*\)"><img src="\/images\/news\/\(.*\)" alt="\(.*\)" width.*><\/a>/<?php news_image("\1", "\2", "\3"); ?>/g */
site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -21,4 +21,4 @@ site_header("News Archive - 2019");
print_news($NEWS_ENTRIES, null, 500, 2019);
/* %s/<a href="\(.*\)"><img src="\/images\/news\/\(.*\)" alt="\(.*\)" width.*><\/a>/<?php news_image("\1", "\2", "\3"); ?>/g */
site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -21,4 +21,4 @@ site_header("News Archive - 2020");
print_news($NEWS_ENTRIES, null, 500, 2020);
/* %s/<a href="\(.*\)"><img src="\/images\/news\/\(.*\)" alt="\(.*\)" width.*><\/a>/<?php news_image("\1", "\2", "\3"); ?>/g */
site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -21,4 +21,4 @@ site_header("News Archive - 2021");
print_news($NEWS_ENTRIES, null, 500, 2021);
/* %s/<a href="\(.*\)"><img src="\/images\/news\/\(.*\)" alt="\(.*\)" width.*><\/a>/<?php news_image("\1", "\2", "\3"); ?>/g */
site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -18,4 +18,4 @@ site_header("News Archive - 2022");
<?php
print_news($NEWS_ENTRIES, null, 500, 2022);
site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA));
site_footer(['elephpants' => true, 'sidebar' => $SIDEBAR_DATA]);

View File

@@ -13,7 +13,7 @@ $SIDEBAR_DATA ='
</div>
';
site_header("Operating System Preparation", array("current" => "community"));
site_header("Operating System Preparation", ["current" => "community"]);
?>
<h2 id="os-prep" class="content-header">Operating System Preparation</h2>
@@ -172,6 +172,6 @@ site_header("Operating System Preparation", array("current" => "community"));
</p>
</div>
<?php
site_footer(array('sidebar'=>$SIDEBAR_DATA));
site_footer(['sidebar'=>$SIDEBAR_DATA]);
/* vim: set et ts=4 sw=4 ft=php: : */

View File

@@ -22,7 +22,7 @@ $abs = $pwd. "/" .(string)$_GET["f"];
$abs = realpath($abs);
if (strncmp($abs, $pwd, strlen($pwd)) != 0) {
header("Location: https://www.php.net/" . strtr($_GET["f"],array("\r"=>"", "\n"=>"")));
header("Location: https://www.php.net/" . strtr($_GET["f"],["\r"=>"", "\n"=>""]));
exit;
}

16
cal.php
View File

@@ -2,11 +2,11 @@
$_SERVER['BASE_PAGE'] = 'cal.php';
include_once __DIR__ . '/include/prepend.inc';
$site_header_config = array(
$site_header_config = [
"current" => "community",
"css" => array('calendar.css'),
"css" => ['calendar.css'],
"layout_span" => 12,
);
];
/*
This script serves three different forms of the calendar data:
@@ -18,7 +18,7 @@ $site_header_config = array(
a fallback to display the actual month/year.
*/
$begun = false; $errors = array();
$begun = false; $errors = [];
$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
$cy = isset($_GET['cy']) ? (int) $_GET['cy'] : 0;
$cm = isset($_GET['cm']) ? (int) $_GET['cm'] : 0;
@@ -56,7 +56,7 @@ elseif ($cy && $cm && $cd) {
// Try to load events for that day, and display them all
if ($events = load_events($date)) {
$site_header_config = array('classes' => 'calendar calendar-day') + $site_header_config;
$site_header_config = ['classes' => 'calendar calendar-day'] + $site_header_config;
site_header("Events: ".date("F j, Y", $date), $site_header_config);
echo "<h2>", date("F j, Y", $date), "</h2>\n";
foreach ($events as $event) {
@@ -288,7 +288,7 @@ function load_events($from, $whole_month = false)
$to_date = date("Y-m-d", $whole_month ? $eom : $from);
// Set arrays to their default
$events = $seen = array();
$events = $seen = [];
// Try to open the events file for reading, return if unable to
$fp = @fopen("backend/events.csv",'r');
@@ -362,7 +362,7 @@ function read_event($fp)
@list($recur, $recur_day) = explode(":", $recur, 2);
// Return with SQL-resultset like array
return array(
return [
'id' => $id,
'type' => $tipo,
'start' => $sdato,
@@ -374,7 +374,7 @@ function read_event($fp)
'ldesc' => base64_decode($ldesc, false),
'country' => $country,
'category' => $category,
);
];
}
// We would not like to allow any year to be viewed, because

View File

@@ -4,14 +4,14 @@ include_once __DIR__ . '/../include/prepend.inc';
include_once __DIR__ . '/../include/pregen-news.inc';
mirror_setcookie("LAST_NEWS", $_SERVER["REQUEST_TIME"], 60*60*24*365);
site_header("PHP Conferences around the world", array(
site_header("PHP Conferences around the world", [
'headtags' => '<link rel="alternate" type="application/atom+xml" title="PHP: Conference announcements" href="' . $MYSITE . 'feed.atom">',
'current' => 'community',
'css' => array('home.css'),
));
'css' => ['home.css'],
]);
$content = "<div class='home-content'>";
$frontpage = array();
$frontpage = [];
foreach ($NEWS_ENTRIES as $entry) {
foreach ($entry["category"] as $category) {
if ($category["term"] == "cfp") {
@@ -51,9 +51,9 @@ $content .= "</div>";
echo $content;
site_footer(
array(
[
"atom" => "/feed.atom",
"elephpants" => true,
"sidebar" => $panels,
)
]
);

View File

@@ -1,7 +1,7 @@
<?php
$_SERVER['BASE_PAGE'] = 'contact.php';
include_once __DIR__ . '/include/prepend.inc';
site_header("Contact", array("current" => "community"));
site_header("Contact", ["current" => "community"]);
?>
<a id="ads"></a>

View File

@@ -9,7 +9,7 @@ $SIDEBAR_DATA = '
<a href="/license/">see our licensing information page</a>.
</p>
';
site_header("Copyright", array("current" => "footer"));
site_header("Copyright", ["current" => "footer"]);
?>
<a id="copyright"></a>

View File

@@ -14,14 +14,14 @@ $credits = preg_replace('!<style.*?>.*</style>!ims', '', $m[1]);
// Fix for PHP bug #24839,
// which affects the page layout
$credits = str_replace(
array("</center>", "& "),
array("</div>", "&amp; "),
["</center>", "& "],
["</div>", "&amp; "],
$credits
);
// If there is something left, print it out
if ($credits) {
site_header("Credits", array("current" => "community", 'css' => array('credits.css')));
site_header("Credits", ["current" => "community", 'css' => ['credits.css']]);
echo $credits;
site_footer();
}

View File

@@ -2,7 +2,7 @@
$_SERVER['BASE_PAGE'] = 'docs.php';
include_once __DIR__ . '/include/prepend.inc';
site_header("Documentation", array("current" => "docs"));
site_header("Documentation", ["current" => "docs"]);
?>

View File

@@ -37,15 +37,15 @@ $SIDEBAR_DATA='
</div>
';
site_header("Download documentation", array("current" => "docs"));
site_header("Download documentation", ["current" => "docs"]);
// Format to look for
$formats = array(
$formats = [
"Single HTML file" => "html.gz",
"Many HTML files" => "tar.gz",
"HTML Help file" => "chm",
"HTML Help file (with user notes)" => "chm",
);
];
?>
<h1>Download documentation</h1>
@@ -86,7 +86,7 @@ $formats = array(
</p>
<?php
$files = array(); $found_formats = array();
$files = []; $found_formats = [];
$filepath = $filename = '';
// Go through all possible manual languages
@@ -119,12 +119,12 @@ foreach ($LANGUAGES as $langcode => $language) {
// Size available, collect information
if ($size !== false) {
$files[$langcode][$formatname] = array(
$files[$langcode][$formatname] = [
$link_to,
(int) ($size/1024),
date("j M Y", $changed),
$extension
);
];
$found_formats[$formatname] = 1;
}
}
@@ -221,4 +221,4 @@ if (count($found_formats) == 0) {
}
?>
<?php site_footer(array('sidebar' => $SIDEBAR_DATA));
<?php site_footer(['sidebar' => $SIDEBAR_DATA]);

View File

@@ -10,7 +10,7 @@ $SIDEBAR_DATA = '
under a GPL license.
</p>
';
site_header("Download Logos", array("current" => "downloads"));
site_header("Download Logos", ["current" => "downloads"]);
// Print recommended star cell
function print_star(): void

View File

@@ -26,17 +26,17 @@ $SIDEBAR_DATA = '
';
site_header("Downloads",
array(
'link' => array(
array(
[
'link' => [
[
"rel" => "alternate",
"type" => "application/atom+xml",
"href" => $MYSITE . "releases/feed.php",
"title" => "PHP Release feed"
),
),
],
],
"current" => "downloads",
)
]
);
?>
<?php $i = 0; foreach ($RELEASES as $MAJOR => $major_releases): /* major releases loop start */
@@ -101,4 +101,4 @@ to verify the tags:
</p>
<?php
site_footer(array('sidebar' => $SIDEBAR_DATA));
site_footer(['sidebar' => $SIDEBAR_DATA]);

View File

@@ -9,7 +9,7 @@ $SIDEBAR_DATA = '
<a href="/license/">see our licensing information page</a>.
</p>
';
site_header("ElePHPant", array("current" => "footer"));
site_header("ElePHPant", ["current" => "footer"]);
?>
<a id="copyright"></a>
@@ -36,7 +36,7 @@ site_header("ElePHPant", array("current" => "footer"));
<?php
// Print the common footer.
site_footer(
array(
[
'elephpants' => true
)
]
);

View File

@@ -5,7 +5,7 @@ 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(
$BRANCH_NOTES = [
'7.3' => '<a href="/migration74">A guide is available for migrating from PHP 7.3 to 7.4.</a>',
'7.2' => '<a href="/migration73">A guide is available for migrating from PHP 7.2 to 7.3.</a>',
'7.1' => '<a href="/migration72">A guide is available for migrating from PHP 7.1 to 7.2.</a>',
@@ -18,7 +18,7 @@ $BRANCH_NOTES = array(
'5.1' => '<a href="/migration52">A guide is available for migrating from PHP 5.1 to 5.2.</a>',
'5.0' => '<a href="/migration51">A guide is available for migrating from PHP 5.0 to 5.1.</a>',
'4.4' => '<a href="/migration5">A guide is available for migrating from PHP 4 to PHP 5.0.</a>',
);
];
site_header('Unsupported Branches');
?>

View File

@@ -179,7 +179,7 @@ if (preg_match('/^GH-(\d+)$/', $URI, $matches)) {
// Redirect if the entered URI was a PHP page name (except some pages,
// which we display in the mirror's language or the explicitly specified
// language [see below])
if (!in_array($URI, array('mirror-info', 'error', 'mod'), false) &&
if (!in_array($URI, ['mirror-info', 'error', 'mod'], true) &&
file_exists($_SERVER['DOCUMENT_ROOT'] . "/$URI.php")) {
mirror_redirect("/$URI.php");
}
@@ -211,7 +211,7 @@ if ($path = is_known_term($term)) {
// Major manual page modifications (need to handle shortcuts and pages in all languages)
// Used permanent HTTP redirects, so search engines will be able to pick up the correct
// new URLs for these pages.
$manual_page_moves = array(
$manual_page_moves = [
// entry point changed
'installation' => 'install',
@@ -248,7 +248,7 @@ $manual_page_moves = array(
// Refactored
'regexp.reference' => 'regexp.introduction',
);
];
if (isset($manual_page_moves[$URI])) {
status_header(301);
@@ -259,7 +259,7 @@ if (isset($manual_page_moves[$URI])) {
mirror_redirect("/manual/$match[1]/" . $manual_page_moves[$match[2]] . ".php");
}
$manual_redirections = array(
$manual_redirections = [
'class.oci-lob' => 'class.ocilob',
'oci-lob.append' => 'ocilob.append',
'oci-lob.close' => 'ocilob.close',
@@ -290,7 +290,7 @@ $manual_redirections = array(
'oci-collection.max' => 'ocicollection.max',
'oci-collection.size' => 'ocicollection.size',
'oci-collection.trim' => 'ocicollection.trim',
);
];
if (preg_match("!^manual/([^/]+)/([^/]+)$!", $URI, $match) && isset($manual_redirections[$match[2]])) {
status_header(301);
@@ -299,7 +299,7 @@ if (preg_match("!^manual/([^/]+)/([^/]+)$!", $URI, $match) && isset($manual_redi
// ============================================================================
// Define shortcuts for PHP files, manual pages and external redirects
$uri_aliases = array (
$uri_aliases = [
# PHP page shortcuts
"download" => "downloads",
@@ -496,9 +496,9 @@ $uri_aliases = array (
# Removed pages
"tips.php" => "urlhowto",
"tips" => "urlhowto",
);
];
$external_redirects = array(
$external_redirects = [
"php4news" => "https://github.com/php/php-src/raw/PHP-4.4/NEWS",
"php5news" => "https://github.com/php/php-src/raw/PHP-5.6/NEWS",
"php53news" => "https://github.com/php/php-src/raw/PHP-5.3/NEWS",
@@ -522,10 +522,10 @@ $external_redirects = array(
"releases.atom" => "/releases/feed.php", // BC, No need to pre-generate it
"spec" => "https://github.com/php/php-langspec",
"sunglasses" => "https://www.youtube.com/watch?v=dQw4w9WgXcQ", // Temporary easter egg for bug#66144
);
];
// Temporary hack to fix bug #49956 for mysqli -- Please don't hate me for this. Data taken from mysqli/summary.xml
$mysqli_redirects = array(
$mysqli_redirects = [
"mysqli_affected_rows" => "mysqli.affected-rows",
"mysqli_get_client_version" => "mysqli.client-version",
"mysqli_connect_errno" => "mysqli.connect-errno",
@@ -623,7 +623,7 @@ $mysqli_redirects = array(
"mysqli_free_result" => "mysqli-result.free",
"mysqli_embedded_server_end" => "mysqli-driver.embedded-server-end",
"mysqli_embedded_server_start" => "mysqli-driver.embedded-server-start",
);
];
// Merge this temporary hack with $uri_aliases so it'll be treated as such
$uri_aliases = array_merge($uri_aliases, $mysqli_redirects);

View File

@@ -2,7 +2,7 @@
$_SERVER['BASE_PAGE'] = 'get-involved.php';
include_once __DIR__ . '/include/prepend.inc';
site_header("Get Involved", array("current" => "community"));
site_header("Get Involved", ["current" => "community"]);
?>
<h2 class="content-title" id="contributing-to-php">Contributing to PHP</h2>
@@ -80,6 +80,6 @@ $SIDEBAR_DATA ='
</div>
';
site_footer(array('sidebar'=>$SIDEBAR_DATA));
site_footer(['sidebar'=>$SIDEBAR_DATA]);
/* vim: set et ts=4 sw=4 ft=php: : */

View File

@@ -24,15 +24,15 @@ $SIDEBAR_DATA = '
<a href="/git.php">Git</a>. No Git account is required.
</p>
';
site_header("Using Git for PHP Development", array("current" => "community"));
site_header("Using Git for PHP Development", ["current" => "community"]);
$groups = array(
$groups = [
"none" => "Choose One",
"php" => "PHP Group",
"pear" => "PEAR Group",
"pecl" => "PECL Group",
"doc" => "Doc Group",
);
];
?>
@@ -78,7 +78,7 @@ if (count($_POST) && (!isset($_POST['purpose']) || !is_array($_POST['purpose'])
if (!$error) {
$error = posttohost(
"https://main.php.net/entry/svn-account.php",
array(
[
"username" => $_POST['id'],
"name" => $_POST['fullname'],
"email" => $_POST['email'],
@@ -86,7 +86,7 @@ if (count($_POST) && (!isset($_POST['purpose']) || !is_array($_POST['purpose'])
"note" => $_POST['realpurpose'],
"yesno" => $_POST['yesno'],
"group" => $_POST['group'],
)
]
);
// Error while posting
if ($error) {
@@ -360,10 +360,10 @@ EOT;
(check all that apply)</th>
<td>
<?php
$purposes = array("Learning PHP", "Coding in PHP", "Reading the PHP source",
$purposes = ["Learning PHP", "Coding in PHP", "Reading the PHP source",
"Using PHP extensions", "Creating experimental PHP extensions",
"Submitting a patch to PHP", "Adding notes to the documentation",
"Writing web pages with PHP");
"Writing web pages with PHP"];
foreach ($purposes as $i => $p) { ?>
<input type="checkbox" name="purpose[<?php echo $i?>]" value="1"

View File

@@ -21,7 +21,7 @@ $SIDEBAR_DATA = '
to contribute.
</p>
';
site_header("Git Access", array("current" => "community"));
site_header("Git Access", ["current" => "community"]);
?>
<h1>Git Access</h1>

View File

@@ -38,9 +38,9 @@ if (isset($_REQUEST['count'])) {
$count = min((int) $_REQUEST['count'], 50);
} else {
header('HTTP/1.1 400', true, 400);
print json_encode(array(
print json_encode([
'error' => "Specify how many elephpants to serve via 'count'."
));
]);
exit;
}
@@ -52,15 +52,15 @@ $photos = json_decode($json, true);
// if no photo data, respond with an error.
if (!$photos || !is_array($photos)) {
header('HTTP/1.1 500', true, 500);
print json_encode(array(
print json_encode([
'error' => "No elephpant metadata available."
));
]);
exit;
}
// prepare requested number of elephpants at random.
shuffle($photos);
$elephpants = array();
$elephpants = [];
$got = 0;
foreach ($photos as $photo) {
@@ -76,11 +76,11 @@ foreach ($photos as $photo) {
$got++;
// add photo to response array.
$elephpants[] = array(
$elephpants[] = [
'title' => $photo['title'],
'url' => "http://flickr.com/photos/" . $photo['owner'] . "/" . $photo['id'],
'data' => base64_encode(file_get_contents($path . '/' . $photo['filename']))
);
];
}
print json_encode($elephpants);

View File

@@ -48,7 +48,7 @@ function get_accepted_encodings() {
return trim($x);
}, $encodings);
}
return array();
return [];
}
function serve_compressed_if_available($logo): void {

View File

@@ -12,7 +12,7 @@ $footer_height = 24;
function branches_to_show() {
// Basically: show all 5.3+ branches with EOL dates > min_date().
$branches = array();
$branches = [];
// Flatten out the majors.
foreach (get_all_branches() as $major_branches) {

View File

@@ -9,34 +9,34 @@ include_once __DIR__ . '/version.inc';
* - stable: the end of active support (usually two years after release).
* - security: the end of security support (usually release + 3 years).
*/
$BRANCHES = array(
$BRANCHES = [
/* 3.0 is here because version_compare() can't handle the only version in
* $OLDRELEASES, and it saves another special case in
* get_branch_security_eol_date(). */
'3.0' => array(
'3.0' => [
'security' => '2000-10-20',
),
'5.3' => array(
],
'5.3' => [
'stable' => '2013-07-11',
'security' => '2014-08-14',
),
'5.4' => array(
],
'5.4' => [
'stable' => '2014-09-14',
'security' => '2015-09-03',
),
'5.5' => array(
],
'5.5' => [
'stable' => '2015-07-10',
'security' => '2016-07-21',
),
'5.6' => array(
],
'5.6' => [
'stable' => '2017-01-19',
'security' => '2018-12-31',
),
'7.0' => array(
],
'7.0' => [
'stable' => '2018-01-04',
'security' => '2019-01-10',
),
);
],
];
/* Time to keep EOLed branches in the array returned by get_active_branches(),
* which is used on the front page download links and the supported versions
@@ -49,16 +49,16 @@ function format_interval($from, $to) {
$to_obj = $to instanceof DateTime ? $to : new DateTime($to);
$diff = $to_obj->diff($from_obj);
$times = array();
$times = [];
if ($diff->y) {
$times[] = array($diff->y, 'year');
$times[] = [$diff->y, 'year'];
if ($diff->m) {
$times[] = array($diff->m, 'month');
$times[] = [$diff->m, 'month'];
}
} elseif ($diff->m) {
$times[] = array($diff->m, 'month');
$times[] = [$diff->m, 'month'];
} elseif ($diff->d) {
$times[] = array($diff->d, 'day');
$times[] = [$diff->d, 'day'];
} else {
$eolPeriod = 'midnight';
}
@@ -96,7 +96,7 @@ function version_number_to_branch(string $version): ?string {
}
function get_all_branches() {
$branches = array();
$branches = [];
foreach ($GLOBALS['OLDRELEASES'] as $major => $releases) {
foreach ($releases as $version => $release) {
@@ -129,7 +129,7 @@ function get_all_branches() {
}
function get_active_branches($include_recent_eols = true) {
$branches = array();
$branches = [];
$now = new DateTime;
foreach ($GLOBALS['RELEASES'] as $major => $releases) {
@@ -162,8 +162,8 @@ function get_active_branches($include_recent_eols = true) {
* must be in $RELEASES _and_ must be the full version number, not the branch:
* ie provide array('5.3.29'), not array('5.3'). */
function get_eol_branches($always_include = null) {
$always_include = $always_include ?: array();
$branches = array();
$always_include = $always_include ?: [];
$branches = [];
$now = new DateTime;
// Gather the last release on each branch into a convenient array.
@@ -171,11 +171,11 @@ function get_eol_branches($always_include = null) {
foreach ($releases as $version => $release) {
if ($branch = version_number_to_branch($version)) {
if (!isset($branches[$major][$branch]) || version_compare($version, $branches[$major][$branch]['version'], 'gt')) {
$branches[$major][$branch] = array(
$branches[$major][$branch] = [
'date' => strtotime($release['date']),
'link' => "/releases#$version",
'version' => $version,
);
];
}
}
}
@@ -209,11 +209,11 @@ function get_eol_branches($always_include = null) {
if (isset($GLOBALS['RELEASES'][$major][$version])) {
$release = $GLOBALS['RELEASES'][$major][$version];
if ($branch = version_number_to_branch($version)) {
$branches[$major][$branch] = array(
$branches[$major][$branch] = [
'date' => strtotime($release['source'][0]['date']),
'link' => "/downloads#v$version",
'version' => $version,
);
];
}
}
}

View File

@@ -1,5 +1,5 @@
<?php
return array(
return [
'AFG' => 'Afghanistan',
'ALB' => 'Albania',
'DZA' => 'Algeria',
@@ -232,4 +232,4 @@ return array(
'YEM' => 'Yemen',
'ZMB' => 'Zambia',
'ZWE' => 'Zimbabwe',
);
];

View File

@@ -9,7 +9,7 @@
function get_actual_download_file($file)
{
// Could be a normal download or a manual download file
$possible_files = array($file => true, "manual/$file" => false);
$possible_files = [$file => true, "manual/$file" => false];
// Find out what is the exact file requested
$found = false;

View File

@@ -42,7 +42,7 @@ function is_emailable_address($email)
* real_person@thisispamsendoftheweb.example.com
*/
function blacklisted($email) {
$mosquitoes = array(
$mosquitoes = [
'saradhaaa@gmail.com',
'mg-tuzi@yahoo.com.cn',
'bitlifesciences',
@@ -101,7 +101,7 @@ function blacklisted($email) {
'a@a.com',
'@insightconferences.com',
'@conferenceseries.com',
);
];
foreach ($mosquitoes as $m) {
if (preg_match('/'.preg_quote($m, '/').'/i',$email)) return true;
}

View File

@@ -10,7 +10,7 @@ function error_404()
{
global $MYSITE;
status_header(404);
site_header('404 Not Found', array("noindex"));
site_header('404 Not Found', ["noindex"]);
echo "<h1>Not Found</h1>\n<p><strong>" .
htmlspecialchars(substr($MYSITE, 0, -1) . $_SERVER['REQUEST_URI']) .
"</strong> not found on this server.</p>\n";
@@ -23,7 +23,7 @@ function error_404_manual()
{
global $MYSITE;
status_header(404);
site_header('404 Not Found', array("noindex"));
site_header('404 Not Found', ["noindex"]);
echo "<h1>Not Found</h1>\n" .
"<p>The manual page you are looking for (<strong>" .
htmlspecialchars(substr($MYSITE, 0, -1) . $_SERVER['REQUEST_URI']) .
@@ -39,7 +39,7 @@ function error_inactive_manual_page($lang_name, $en_page)
{
global $MYSITE, $ACTIVE_ONLINE_LANGUAGES;
status_header(404);
site_header('Page gone', array("noindex"));
site_header('Page gone', ["noindex"]);
echo "<h1>Page gone</h1>\n" .
"<p>The " . htmlspecialchars($lang_name) . " manual page you are looking for (<strong>" .
htmlspecialchars(substr($MYSITE, 0, -1) . $_SERVER['REQUEST_URI']) .
@@ -64,7 +64,7 @@ function error_inactive_manual_page($lang_name, $en_page)
function error_noservice()
{
global $MYSITE;
site_header('Service not working', array("noindex"));
site_header('Service not working', ["noindex"]);
echo "<h1>Service not working</h1>\n" .
"<p>The service you tried to access with <strong>" .
htmlspecialchars(substr($MYSITE, 0, -1) . $_SERVER['REQUEST_URI']) .
@@ -77,7 +77,7 @@ function error_noservice()
// There is no such mirror
function error_nomirror($mirror) {
site_header("No such mirror", array("noindex"));
site_header("No such mirror", ["noindex"]);
echo "<h1>No such mirror</h1>\n<p>The mirror you tried to access (" .
htmlspecialchars($mirror) .
") is not registered php.net mirror. Please check back later," .
@@ -535,7 +535,7 @@ function fallback_to_legacy_manuals(array $legacy_urls): void
{
global $MYSITE;
status_header(404);
site_header('404 Not Found', array("noindex"));
site_header('404 Not Found', ["noindex"]);
$original_url = htmlspecialchars(substr($MYSITE, 0, -1) . $_SERVER['REQUEST_URI']);
$legacy_links = '';

View File

@@ -87,7 +87,7 @@
<!-- External and third party libraries. -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<?php
$jsfiles = array("ext/hogan-3.0.2.min.js", "ext/typeahead.min.js", "ext/mousetrap.min.js", "ext/jquery.scrollTo.min.js", "search.js", "common.js");
$jsfiles = ["ext/hogan-3.0.2.min.js", "ext/typeahead.min.js", "ext/mousetrap.min.js", "ext/jquery.scrollTo.min.js", "search.js", "common.js"];
foreach ($jsfiles as $filename) {
$path = dirname(__DIR__).'/js/'.$filename;
echo '<script src="/cached.php?t=' . @filemtime($path) . '&amp;f=/js/' . $filename . '"></script>'."\n";

View File

@@ -8,12 +8,12 @@ if (!isset($df)) {
}
// Could be a normal download or a manual download file
$possible_files = array($df, "manual/$df");
$possible_files = [$df, "manual/$df"];
$site_config = array(
$site_config = [
'current' => 'downloads',
'css' => array('mirror.css')
);
'css' => ['mirror.css']
];
// Find out what is the exact file requested
$file = false;

View File

@@ -1,10 +1,10 @@
<?php
$css_files = array(
$css_files = [
'/fonts/Fira/fira.css',
'/fonts/Font-Awesome/css/fontello.css',
'/styles/theme-base.css',
'/styles/theme-medium.css',
);
];
if (isset($config['css'])) {
$css_files = array_merge($css_files, (array) $config['css']);
@@ -42,7 +42,7 @@ if ($config["cache"]) {
header("Last-Modified: " . $tsstring);
}
if (!isset($config["languages"])) {
$config["languages"] = array();
$config["languages"] = [];
}
?>

View File

@@ -1,89 +1,89 @@
<?php
$historical_mirrors = array(
array("ARG", "ar2.php.net", "XMundo Hosting Solutions", "http://www.xmundo.net"),
array("ARM", "am1.php.net", "ARMINCO Global Telecommunications", "http://www.arminco.com/"),
array("AUS", "au1.php.net", "Melbourne IT Pty Ltd", "https://www.melbourneit.com.au/"),
array("AUS", "au2.php.net", "Servers Australia Pty. Ltd.", "http://www.serversaustralia.com.au/"),
array("AUT", "at1.php.net", "Goodie Domain Service", "http://www.gdsw.at/"),
array("AUT", "at2.php.net", "Yalwa Local Directory Services Austria", "http://www.yalwa.at/"),
array("BGD", "bd1.php.net", "IS Pros Limited", "http://www.ispros.com.bd"),
array("BEL", "be2.php.net", "Cu.be Solutions", "http://www.cu.be/"),
array("BIH", "ba1.php.net", "BHTelecom", "https://www.bhtelecom.ba/"),
array("BRA", "br1.php.net", "HostNet Internet", "http://www.hostnet.com.br"),
array("BRA", "br2.php.net", "Umbler", "http://umbler.com"),
array("BGR", "bg2.php.net", "Data.BG", "http://www.data.bg"),
array("CAN", "ca1.php.net", "easyDNS", "http://www.easydns.com/"),
array("CAN", "ca2.php.net", "Parasane, LLC", "http://www.parasane.net/"),
array("CAN", "ca3.php.net", "egateDOMAINS", "http://www.egatedomains.ca/?RP=DJFEIWHFEWQ"),
array("CHL", "cl1.php.net", "Caos Consultores", "http://www.caos.cl"),
array("CHN", "cn2.php.net", "Sina App Engine (SAE)", "http://sae.sina.com.cn/"),
array("CZE", "cz1.php.net", "Czech Technical University in Prague", "http://www.cvut.cz/"),
array("CZE", "cz2.php.net", "Softaculous Ltd.", "http://www.softaculous.com/"),
array("DNK", "dk1.php.net", "Siminn Denmark", "http://www.siminn.dk"),
array("DNK", "dk2.php.net", "Kobalt", "http://kobalt.dk/"),
array("EST", "ee1.php.net", "Zone Media LLC", "https://www.zone.ee/"),
array("FIN", "fi1.php.net", "Avenla Oy", "http://www.avenla.fi/"),
array("FIN", "fi2.php.net", "Planeetta Internet OY", "http://www.planeetta.net/"),
array("FRA", "fr2.php.net", "Crihan", "http://www.crihan.fr/"),
array("DEU", "de1.php.net", "@GLOBE GmbH", "http://www.globe.de/"),
array("DEU", "de2.php.net", "Locanto Kleinanzeigen", "http://www.locanto.de/"),
array("HKG", "hk1.php.net", "Nethub Online Limited", "http://www.nethub.com.hk/"),
array("HKG", "hk2.php.net", "Website Solution Web Hosting", "http://www.website-solution.net/"),
array("ISL", "is1.php.net", "Hýsingarfélagið ehf", "http://www.hysingar.is/"),
array("ISL", "is2.php.net", "Dotgeek", "http://dotgeek.org/"),
array("IND", "in1.php.net", "Directi Web Hosting", "http://www.directi.com"),
array("IND", "in3.php.net", "IndiaLinks Web Hosting Pvt Ltd", "http://www.indialinks.com"),
array("IDN", "id1.php.net", "PT Pasifik Satelit Nusantara", "http://www.pesat.net.id"),
array("IRN", "ir1.php.net", "Golha.IR", "http://www.golha.ir/"),
array("IRN", "ir2.php.net", "ParsPack.com", "http://parspack.com/"),
array("IRL", "ie1.php.net", "Yalwa - Local Directory Services Ireland", "http://www.yalwa.ie/"),
array("IRL", "ie2.php.net", "Hosting Ireland", "http://www.hostingireland.ie/"),
array("ISR", "il1.php.net", "SPD HOSTING LTD", "http://www.spd.co.il/"),
array("ITA", "it1.php.net", "Register.it", "http://www.register.it/"),
array("ITA", "it2.php.net", "Interalta", "https://www.interalta.com/"),
array("JAM", "jm2.php.net", "Teamopolis Sports Websites Inc.", "http://www.teamopolis.com/"),
array("JPN", "jp1.php.net", "PacketBusiness, Inc.", "http://www.packetbusiness.com/"),
array("JPN", "jp2.php.net", "snotch", "http://bloggers.ja.bz/sunouchi/"),
array("KOR", "kr1.php.net", "ask.sarang.net", "http://ask.sarang.net"),
array("LIE", "li1.php.net", "Telecom Liechtenstein AG", "http://www.telecom.li/"),
array("LTU", "lt1.php.net", "UAB \"Interneto vizija\"", "http://serveriai.lt/"),
array("LUX", "lu1.php.net", "root eSolutions ISP", "http://www.root.lu"),
array("LVA", "lv1.php.net", "Māris Ozoliņš", "http://netparks.lv/"),
array("LVA", "lv1.php.net", "Kaspars Foigts", "https://laacz.lv/"),
array("MYS", "my1.php.net", "MaxDedicated", "http://www.maxdedicated.com/"),
array("MEX", "mx1.php.net", "uServers Mexico", "http://www.uservers.net/?in=php"),
array("MEX", "mx2.php.net", "Universidad Autónoma Metropolitana Azcapotzalco", "http://www.azc.uam.mx"),
array("MDA", "md1.php.net", "dev.md", "http://www.dev.md/"),
array("NCL", "nc1.php.net", "Nautile", "http://www.nautile.nc/"),
array("NLD", "nl1.php.net", "Stream Service", "http://www.streamservice.nl/"),
array("NLD", "nl3.php.net", "Computel Standby BV", "http://www.computel.nl/"),
array("NZL", "nz2.php.net", "Catalyst IT Ltd", "http://catalyst.net.nz/"),
array("NOR", "no1.php.net", "Pål Sollie", "https://sparkz.no/"),
array("NOR", "no2.php.net", "Verdens Gang AS", "http://www.vg.no"),
array("PAN", "pa1.php.net", "Unidominios", "http://www.unidominios.com/"),
array("POL", "pl1.php.net", "WEBdev", "http://webdev.pl/"),
array("ROU", "ro1.php.net", "SpiderVPS", "http://www.spidervps.com/"),
array("RUS", "ru2.php.net", "Cronyx Plus LLC", "http://isp.rinet.ru/"),
array("SGP", "sg2.php.net", "Xssist Group (Singapore) Pte Ltd", "http://www.xssist.com/"),
array("ESP", "es1.php.net", "GRN Serveis Telematics", "http://www.grn.es/classic"),
array("SVN", "si1.php.net", "DOMENAR.net", "http://www.domenar.net/"),
array("SVN", "si2.php.net", "Domene in gostovanje NEOSERV", "http:///www.neoserv.si"),
array("SWE", "se1.php.net", "Portlane AB", "http://www.portlane.com/"),
array("SWE", "se2.php.net", "SpaceDump IT AB", "http://www.spacedump.se/"),
array("ZAF", "za1.php.net", "AfriCC", "https://www.afri.cc/"),
array("CHE", "ch1.php.net", "ComunidadHosting", "http://www.comunidadhosting.com/"),
array("TWN", "tw1.php.net", "twemail.com", "http://twemail.com/"),
array("TWN", "tw2.php.net", "www.mirror.tw", "http://www.mirror.tw/"),
array("THA", "th1.php.net", "THAIWEB.network", "http://www.thaiweb.net"),
array("TUR", "tr1.php.net", "İstanbul Teknik Üniversitesi Bilgi İşlem Daire Başkanlığı", "http://www.itu.edu.tr/"),
array("TUR", "tr2.php.net", "DGN Teknoloji", "http://www.dgn.net.tr/"),
array("TZA", "tz1.php.net", "Aptus Solutions", "http://aptus.co.tz"),
array("UKR", "ua1.php.net", "ELRO Corporation", "http://elro.com"),
array("UKR", "ua2.php.net", "Max Khaikin", "http://www.masterlogic.net/"),
array("GBR", "uk1.php.net", "Camel Network", "http://camelnetwork.com/"),
array("GBR", "uk3.php.net", "CatN PHP Hosting", "http://www.catn.com/"),
array("USA", "us1.php.net", "NEXCESS.NET", "http://www.nexcess.net/"),
array("USA", "us2.php.net", "Hurricane Electric", "http://he.net/"),
array("USA", "us3.php.net", "C7 Data Centers", "https://www.c7.com/"),
array("VNM", "vn1.php.net", "DigiStar Co., Ltd", "http://www.digistar.vn/"),
);
$historical_mirrors = [
["ARG", "ar2.php.net", "XMundo Hosting Solutions", "http://www.xmundo.net"],
["ARM", "am1.php.net", "ARMINCO Global Telecommunications", "http://www.arminco.com/"],
["AUS", "au1.php.net", "Melbourne IT Pty Ltd", "https://www.melbourneit.com.au/"],
["AUS", "au2.php.net", "Servers Australia Pty. Ltd.", "http://www.serversaustralia.com.au/"],
["AUT", "at1.php.net", "Goodie Domain Service", "http://www.gdsw.at/"],
["AUT", "at2.php.net", "Yalwa Local Directory Services Austria", "http://www.yalwa.at/"],
["BGD", "bd1.php.net", "IS Pros Limited", "http://www.ispros.com.bd"],
["BEL", "be2.php.net", "Cu.be Solutions", "http://www.cu.be/"],
["BIH", "ba1.php.net", "BHTelecom", "https://www.bhtelecom.ba/"],
["BRA", "br1.php.net", "HostNet Internet", "http://www.hostnet.com.br"],
["BRA", "br2.php.net", "Umbler", "http://umbler.com"],
["BGR", "bg2.php.net", "Data.BG", "http://www.data.bg"],
["CAN", "ca1.php.net", "easyDNS", "http://www.easydns.com/"],
["CAN", "ca2.php.net", "Parasane, LLC", "http://www.parasane.net/"],
["CAN", "ca3.php.net", "egateDOMAINS", "http://www.egatedomains.ca/?RP=DJFEIWHFEWQ"],
["CHL", "cl1.php.net", "Caos Consultores", "http://www.caos.cl"],
["CHN", "cn2.php.net", "Sina App Engine (SAE)", "http://sae.sina.com.cn/"],
["CZE", "cz1.php.net", "Czech Technical University in Prague", "http://www.cvut.cz/"],
["CZE", "cz2.php.net", "Softaculous Ltd.", "http://www.softaculous.com/"],
["DNK", "dk1.php.net", "Siminn Denmark", "http://www.siminn.dk"],
["DNK", "dk2.php.net", "Kobalt", "http://kobalt.dk/"],
["EST", "ee1.php.net", "Zone Media LLC", "https://www.zone.ee/"],
["FIN", "fi1.php.net", "Avenla Oy", "http://www.avenla.fi/"],
["FIN", "fi2.php.net", "Planeetta Internet OY", "http://www.planeetta.net/"],
["FRA", "fr2.php.net", "Crihan", "http://www.crihan.fr/"],
["DEU", "de1.php.net", "@GLOBE GmbH", "http://www.globe.de/"],
["DEU", "de2.php.net", "Locanto Kleinanzeigen", "http://www.locanto.de/"],
["HKG", "hk1.php.net", "Nethub Online Limited", "http://www.nethub.com.hk/"],
["HKG", "hk2.php.net", "Website Solution Web Hosting", "http://www.website-solution.net/"],
["ISL", "is1.php.net", "Hýsingarfélagið ehf", "http://www.hysingar.is/"],
["ISL", "is2.php.net", "Dotgeek", "http://dotgeek.org/"],
["IND", "in1.php.net", "Directi Web Hosting", "http://www.directi.com"],
["IND", "in3.php.net", "IndiaLinks Web Hosting Pvt Ltd", "http://www.indialinks.com"],
["IDN", "id1.php.net", "PT Pasifik Satelit Nusantara", "http://www.pesat.net.id"],
["IRN", "ir1.php.net", "Golha.IR", "http://www.golha.ir/"],
["IRN", "ir2.php.net", "ParsPack.com", "http://parspack.com/"],
["IRL", "ie1.php.net", "Yalwa - Local Directory Services Ireland", "http://www.yalwa.ie/"],
["IRL", "ie2.php.net", "Hosting Ireland", "http://www.hostingireland.ie/"],
["ISR", "il1.php.net", "SPD HOSTING LTD", "http://www.spd.co.il/"],
["ITA", "it1.php.net", "Register.it", "http://www.register.it/"],
["ITA", "it2.php.net", "Interalta", "https://www.interalta.com/"],
["JAM", "jm2.php.net", "Teamopolis Sports Websites Inc.", "http://www.teamopolis.com/"],
["JPN", "jp1.php.net", "PacketBusiness, Inc.", "http://www.packetbusiness.com/"],
["JPN", "jp2.php.net", "snotch", "http://bloggers.ja.bz/sunouchi/"],
["KOR", "kr1.php.net", "ask.sarang.net", "http://ask.sarang.net"],
["LIE", "li1.php.net", "Telecom Liechtenstein AG", "http://www.telecom.li/"],
["LTU", "lt1.php.net", "UAB \"Interneto vizija\"", "http://serveriai.lt/"],
["LUX", "lu1.php.net", "root eSolutions ISP", "http://www.root.lu"],
["LVA", "lv1.php.net", "Māris Ozoliņš", "http://netparks.lv/"],
["LVA", "lv1.php.net", "Kaspars Foigts", "https://laacz.lv/"],
["MYS", "my1.php.net", "MaxDedicated", "http://www.maxdedicated.com/"],
["MEX", "mx1.php.net", "uServers Mexico", "http://www.uservers.net/?in=php"],
["MEX", "mx2.php.net", "Universidad Autónoma Metropolitana Azcapotzalco", "http://www.azc.uam.mx"],
["MDA", "md1.php.net", "dev.md", "http://www.dev.md/"],
["NCL", "nc1.php.net", "Nautile", "http://www.nautile.nc/"],
["NLD", "nl1.php.net", "Stream Service", "http://www.streamservice.nl/"],
["NLD", "nl3.php.net", "Computel Standby BV", "http://www.computel.nl/"],
["NZL", "nz2.php.net", "Catalyst IT Ltd", "http://catalyst.net.nz/"],
["NOR", "no1.php.net", "Pål Sollie", "https://sparkz.no/"],
["NOR", "no2.php.net", "Verdens Gang AS", "http://www.vg.no"],
["PAN", "pa1.php.net", "Unidominios", "http://www.unidominios.com/"],
["POL", "pl1.php.net", "WEBdev", "http://webdev.pl/"],
["ROU", "ro1.php.net", "SpiderVPS", "http://www.spidervps.com/"],
["RUS", "ru2.php.net", "Cronyx Plus LLC", "http://isp.rinet.ru/"],
["SGP", "sg2.php.net", "Xssist Group (Singapore) Pte Ltd", "http://www.xssist.com/"],
["ESP", "es1.php.net", "GRN Serveis Telematics", "http://www.grn.es/classic"],
["SVN", "si1.php.net", "DOMENAR.net", "http://www.domenar.net/"],
["SVN", "si2.php.net", "Domene in gostovanje NEOSERV", "http:///www.neoserv.si"],
["SWE", "se1.php.net", "Portlane AB", "http://www.portlane.com/"],
["SWE", "se2.php.net", "SpaceDump IT AB", "http://www.spacedump.se/"],
["ZAF", "za1.php.net", "AfriCC", "https://www.afri.cc/"],
["CHE", "ch1.php.net", "ComunidadHosting", "http://www.comunidadhosting.com/"],
["TWN", "tw1.php.net", "twemail.com", "http://twemail.com/"],
["TWN", "tw2.php.net", "www.mirror.tw", "http://www.mirror.tw/"],
["THA", "th1.php.net", "THAIWEB.network", "http://www.thaiweb.net"],
["TUR", "tr1.php.net", "İstanbul Teknik Üniversitesi Bilgi İşlem Daire Başkanlığı", "http://www.itu.edu.tr/"],
["TUR", "tr2.php.net", "DGN Teknoloji", "http://www.dgn.net.tr/"],
["TZA", "tz1.php.net", "Aptus Solutions", "http://aptus.co.tz"],
["UKR", "ua1.php.net", "ELRO Corporation", "http://elro.com"],
["UKR", "ua2.php.net", "Max Khaikin", "http://www.masterlogic.net/"],
["GBR", "uk1.php.net", "Camel Network", "http://camelnetwork.com/"],
["GBR", "uk3.php.net", "CatN PHP Hosting", "http://www.catn.com/"],
["USA", "us1.php.net", "NEXCESS.NET", "http://www.nexcess.net/"],
["USA", "us2.php.net", "Hurricane Electric", "http://he.net/"],
["USA", "us3.php.net", "C7 Data Centers", "https://www.c7.com/"],
["VNM", "vn1.php.net", "DigiStar Co., Ltd", "http://www.digistar.vn/"],
];

View File

@@ -110,7 +110,7 @@ function i2c_search_in_index($ip)
// Compare current index part with our IP
if ($ip_chunk >= $idxpart && $ip_chunk < (int) $data[0]) {
return array($recnum, (int) $data[1]);
return [$recnum, (int) $data[1]];
}
// Store for next compare
@@ -119,7 +119,7 @@ function i2c_search_in_index($ip)
}
// Return record number found
return array($recnum, -1);
return [$recnum, -1];
}
// Find the country searching from record $idx

View File

@@ -42,7 +42,7 @@ function language_choose_code()
{
// Contains all the languages picked up by the
// process in priority order (without repeating codes)
$languages = array();
$languages = [];
// Default values for languages
$explicitly_specified = ''; $selected = '';
@@ -94,7 +94,7 @@ function language_choose_code()
// Specified by the user via the browser's Accept Language setting
// Samples: "hu, en-us;q=0.66, en;q=0.33", "hu,en-us;q=0.5"
$browser_langs = array(); $parsed_langs = array();
$browser_langs = []; $parsed_langs = [];
// Check if we have $_SERVER['HTTP_ACCEPT_LANGUAGE'] set and
// it no longer breaks if you only have one language set :)
@@ -108,7 +108,7 @@ function language_choose_code()
// If the quality is missing, it is assumed to be 1 according to the RFC
if (preg_match("!([a-z-]+)(;q=([0-9\\.]+))?!", trim($value), $found)) {
$quality = (isset($found[3]) ? (float) $found[3] : 1.0);
$browser_langs[] = array($found[1], $quality);
$browser_langs[] = [$found[1], $quality];
}
unset($found);
}
@@ -168,7 +168,7 @@ function language_choose_code()
$selected = $languages[0];
// Return with all found data
return array($selected, $explicitly_specified, $parsed_langs);
return [$selected, $explicitly_specified, $parsed_langs];
}
// Add a language to the possible languages' list

View File

@@ -9,7 +9,7 @@
http://www.unicode.org/unicode/onlinedat/languages.html
*/
$LANGUAGES = array(
$LANGUAGES = [
'en' => 'English',
'ar' => 'Arabic',
'bg' => 'Bulgarian',
@@ -45,7 +45,7 @@ $LANGUAGES = array(
'sv' => 'Swedish',
'tr' => 'Turkish',
'uk' => 'Ukrainian',
);
];
/*
The following languages are inactive, which means they will not:
@@ -56,7 +56,7 @@ $LANGUAGES = array(
However, these languages are available on the doc dev server:
- http://docs.php.net/
*/
$INACTIVE_ONLINE_LANGUAGES = array(
$INACTIVE_ONLINE_LANGUAGES = [
'ar' => 'Arabic',
'bg' => 'Bulgarian',
'hk' => 'Chinese (Hong Kong Cantonese)',
@@ -83,7 +83,7 @@ $INACTIVE_ONLINE_LANGUAGES = array(
'sl' => 'Slovenian',
'sv' => 'Swedish',
'uk' => 'Ukrainian',
);
];
$ACTIVE_ONLINE_LANGUAGES = array_diff($LANGUAGES, $INACTIVE_ONLINE_LANGUAGES);

View File

@@ -21,7 +21,7 @@ function highlight_php($code, $return = false)
// Fix output to use CSS classes and wrap well
$highlighted = '<div class="phpcode">' . str_replace(
array(
[
'&nbsp;',
'<br>',
'<span style="color: ',
@@ -29,8 +29,8 @@ function highlight_php($code, $return = false)
"\n ",
' ',
' '
),
array(
],
[
' ',
"<br>\n",
'<span class="',
@@ -38,7 +38,7 @@ function highlight_php($code, $return = false)
"\n&nbsp;",
'&nbsp; ',
'&nbsp; '
),
],
$highlighted
) . '</div>';
@@ -96,7 +96,7 @@ function make_image($file, $alt = false, $align = false, $extras = false,
// Convert right or left alignment to CSS float,
// but leave other alignments intact (for now)
if (in_array($align, array("right", "left"), false)) {
if (in_array($align, ["right", "left"], true)) {
$align = ' style="float: ' . $align . ';"';
} elseif ($align) {
$align = ' align="' . $align . '"';
@@ -291,7 +291,7 @@ function display_event($event, $include_date = 1)
}
// Recurring possibilities
$re = array(
$re = [
1 => 'First',
2 => 'Second',
3 => 'Third',
@@ -299,7 +299,7 @@ function display_event($event, $include_date = 1)
-1 => 'Last',
-2 => '2nd Last',
-3 => '3rd Last'
);
];
if (!isset($event['start']) && isset($event['sday'])) {
$sday = mktime(12,0,0,$event['smonth'],$event['sday'],$event['syear']);
@@ -351,7 +351,7 @@ function display_event($event, $include_date = 1)
// Event category
if (isset($event['category']) && $event['category']) {
$cat = array("unknown", "User Group Event", "Conference", "Training");
$cat = ["unknown", "User Group Event", "Conference", "Training"];
echo ' [' . $cat[$event['category']] . '] ';
}
@@ -393,16 +393,16 @@ function news_archive_sidebar()
// Print news
function print_news($news, $dog, $max = 5, $onlyyear = null, $return = false) {
$retval = array();
$retval = [];
$count = 0;
$news = $news ?: array(); // default to empty array (if no news)
$news = $news ?: []; // default to empty array (if no news)
foreach ($news as $item) {
$ok = false;
// Only print entries in the provided s/dog/cat/ egory
// If $dog is null, everything matches
foreach ($item["category"] as $category) {
if (is_null($dog) || in_array($category["term"], (array)$dog, false)) {
if (is_null($dog) || in_array($category["term"], (array)$dog, true)) {
$ok = true;
++$count;
break;
@@ -443,12 +443,12 @@ function print_news($news, $dog, $max = 5, $onlyyear = null, $return = false) {
}
if ($return) {
$retval[] = array(
$retval[] = [
"title" => $item["title"],
"id" => $id,
"permlink" => $permlink,
"date" => $newsdate,
);
];
continue;
}
@@ -470,19 +470,19 @@ EOT;
return $retval;
}
function site_header($title = '', $config = array())
function site_header($title = '', $config = [])
{
global $MYSITE;
$defaults = array(
$defaults = [
"lang" => myphpnet_language(),
"current" => "",
"meta-navigation" => array(),
"meta-navigation" => [],
'classes' => '',
'layout_span' => 9,
"cache" => false,
"headsup" => "",
);
];
$config = array_merge($defaults, $config);
@@ -494,7 +494,7 @@ function site_header($title = '', $config = array())
if (isset($_COOKIE["MD"]) || isset($_GET["MD"])) {
$classes .= "markdown-content";
$config["css_overwrite"] = array("/styles/i-love-markdown.css");
$config["css_overwrite"] = ["/styles/i-love-markdown.css"];
}
if (empty($title)) {
@@ -508,7 +508,7 @@ function site_header($title = '', $config = array())
require __DIR__ ."/header.inc";
}
function site_footer($config = array())
function site_footer($config = [])
{
require __DIR__ . "/footer.inc";
}
@@ -540,28 +540,28 @@ function get_news_changes()
function news_toc($sections = null) {
include __DIR__ . "/pregen-news.inc";
$items = array(
"news" => array(
$items = [
"news" => [
"title" => "News",
"link" => "/archive/",
"children" => print_news($NEWS_ENTRIES, "frontpage", 3, null, true),
),
"conferences" => array(
],
"conferences" => [
"title" => "Conferences",
"link" => "/conferences/",
"children" => print_news($NEWS_ENTRIES, "conferences", 3, null, true),
),
"papers" => array(
],
"papers" => [
"title" => "Call for Papers",
"link" => "/conferences/",
"children" => print_news($NEWS_ENTRIES, "cfp", 3, null, true),
),
);
],
];
foreach ($items as $section => $menu) {
// only print requested sections.
if (is_array($sections) && !in_array($section, $sections, false)) {
if (is_array($sections) && !in_array($section, $sections, true)) {
continue;
}

View File

@@ -110,7 +110,7 @@ function find_manual_page($lang, $keyword)
if (in_array('sqlite', PDO::getAvailableDrivers(), true)) {
if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/backend/manual-lookup.sqlite')) {
try {
$dbh = new PDO( 'sqlite:' . $_SERVER['DOCUMENT_ROOT'] . '/backend/manual-lookup.sqlite', '', '', array(PDO::ATTR_PERSISTENT => true, PDO::ATTR_EMULATE_PREPARES => true) );
$dbh = new PDO( 'sqlite:' . $_SERVER['DOCUMENT_ROOT'] . '/backend/manual-lookup.sqlite', '', '', [PDO::ATTR_PERSISTENT => true, PDO::ATTR_EMULATE_PREPARES => true] );
} catch (PDOException $e) {
return find_manual_page_slow($lang, $keyword);
}
@@ -124,7 +124,7 @@ function find_manual_page($lang, $keyword)
// Try the preferred language first, then the
// English one in case no page is found
$langs = ($lang != 'en') ? array($lang, 'en') : array('en');
$langs = ($lang != 'en') ? [$lang, 'en'] : ['en'];
// Reformat keyword, drop anything in parenthesis --- except a search for the underscore only. (Bug #63490)
if ($keyword != '_') {
@@ -172,7 +172,7 @@ function find_manual_page($lang, $keyword)
if (!$stm) {
return find_manual_page_slow($lang, $keyword);
}
$stm->execute(array($lang, "/manual/{$lang}/{$_keyword}", $keyword));
$stm->execute([$lang, "/manual/{$lang}/{$_keyword}", $keyword]);
// Some partially specified URL is used
} else {
@@ -187,7 +187,7 @@ function find_manual_page($lang, $keyword)
$stm = $dbh->prepare($SQL);
if ($stm) {
$stm->execute(array($lang, $keyword, str_replace('\\', '-', $keyword), str_replace(' ', '', $keyword), str_replace(' ', '-', $keyword), str_replace('-', '', $keyword), $keyword));
$stm->execute([$lang, $keyword, str_replace('\\', '-', $keyword), str_replace(' ', '', $keyword), str_replace(' ', '-', $keyword), str_replace('-', '', $keyword), $keyword]);
}
}

View File

@@ -10,13 +10,13 @@ function posttohost($url, $data)
{
$data = http_build_query($data);
$opts = array(
$opts = [
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $data,
);
];
$ctx = stream_context_create(array('http' => $opts));
$ctx = stream_context_create(['http' => $opts]);
return file_get_contents($url, false, $ctx);
}

View File

@@ -35,7 +35,7 @@ header("Permissions-Policy: interest-cohort=()");
header("Access-Control-Allow-Origin: http://$hostname");
if (isset($_SERVER["HTTP_ACCESS_CONTROL_REQUEST_HEADERS"])) {
$headers = $_SERVER["HTTP_ACCESS_CONTROL_REQUEST_HEADERS"];
$headers = str_replace(array("\r", "\n", "\0"), "", $headers);
$headers = str_replace(["\r", "\n", "\0"], "", $headers);
header("Access-Control-Allow-Headers: $headers");
}
})();
@@ -99,7 +99,7 @@ function myphpnet_load()
global $MYPHPNET, $MYSITE;
// Empty the preferences array
$MYPHPNET = array(false, false, "NONE", 0, false);
$MYPHPNET = [false, false, "NONE", 0, false];
if ($MYSITE === 'http://docs.php.net/') {
$MYPHPNET[4] = true;
@@ -140,7 +140,7 @@ function myphpnet_urlsearch($type = false)
global $MYPHPNET;
// Set type if specified and if correct
if ($type && in_array($type, array(MYPHPNET_URL_FUNC, MYPHPNET_URL_MANUAL), false)) {
if ($type && in_array($type, [MYPHPNET_URL_FUNC, MYPHPNET_URL_MANUAL], true)) {
$MYPHPNET[1] = $type;
}

File diff suppressed because it is too large Load Diff

View File

@@ -12,7 +12,7 @@ function search_results($res, $q, $profile='all', $per_page=10, $s=0, $l='en', $
$pos = $res['ResultSet']['firstResultPosition'];
$php_img_dir = 'http://www.php.net/images';
$types = array(
$types = [
'pear' => '<img src="'. $php_img_dir .'/pear_item.gif" height="19" width="17" style="float:left; margin-left:-30px;"/>',
'pecl' => '<img src="'. $php_img_dir .'/pecl_item.gif" height="19" width="17" style="float:left; margin-left:-30px;"/>',
'pecl4win' => '<img src="'. $php_img_dir .'/pecl_item_win.gif" height="22" width="21" style="float:left; margin-left:-31px;"/>',
@@ -27,7 +27,7 @@ function search_results($res, $q, $profile='all', $per_page=10, $s=0, $l='en', $
'doc' => '<img src="'. $php_img_dir .'/logos/php-icon-white.gif" height="32" width="32" style="float:left; margin-left:-40px;"/>',
'bugs' => '<img src="'. $php_img_dir .'/php_bug.gif" height="32" width="32" style="float:left; margin-left:-40px;"/>',
'gtk' => '<img src="'. $php_img_dir .'/logos/php-gtk-white.gif" height="26" width="32" style="float:left; margin-left:-40px;"/>'
);
];
foreach($res['ResultSet']['Result'] as $i => $hit) {
$cnt = $pos + $i;
@@ -45,7 +45,7 @@ function search_results($res, $q, $profile='all', $per_page=10, $s=0, $l='en', $
if($type=='pecl' && strstr($displayurl,"/bugs/")) $type = "peclbugs";
if($type=='pear' && strstr($displayurl,"/bugs/")) $type = "pearbugs";
if($type=='smarty') continue;
$display_title = str_replace(array('PHP:', '&amp;'), array('', '&'), $hit['Title']);
$display_title = str_replace(['PHP:', '&amp;'], ['', '&'], $hit['Title']);
// Fall back to the PHP logo for unknown hits
if (!isset($types[$type])) {

View File

@@ -16,7 +16,7 @@
include_once __DIR__ . '/prepend.inc';
// Set variable defaults
$PGI = array(); $SIDEBAR_DATA = '';
$PGI = []; $SIDEBAR_DATA = '';
// =============================================================================
// User note display functions
@@ -81,7 +81,7 @@ END_USERNOTE_HEADER;
function manual_notes_load($id)
{
// Initialize values
$notes = array();
$notes = [];
$hash = substr(md5($id), 0, 16);
$notes_file = $_SERVER['DOCUMENT_ROOT'] . "/backend/notes/" .
substr($hash, 0, 2) . "/$hash";
@@ -96,15 +96,15 @@ function manual_notes_load($id)
$line = chop(fgets($fp, 12288));
if ($line == "") { continue; }
@list($id, $sect, $rate, $ts, $user, $note, $up, $down) = explode("|", $line);
$notes[$id] = array(
$notes[$id] = [
"id" => $id,
"sect" => $sect,
"rate" => $rate,
"xwhen" => $ts,
"user" => $user,
"note" => base64_decode($note, false),
"votes" => array("up"=> (int)$up, "down"=> (int)$down)
);
"note" => base64_decode($note, true),
"votes" => ["up"=> (int)$up, "down"=> (int)$down]
];
}
fclose($fp);
}
@@ -112,7 +112,7 @@ function manual_notes_load($id)
}
// Print out one user note entry
function manual_note_display($date, $name, $text, $id, $votes = array('up'=>0, 'down'=>0), $voteOption = true)
function manual_note_display($date, $name, $text, $id, $votes = ['up'=>0, 'down'=>0], $voteOption = true)
{
if ($name) {
$name = "\n <strong class=\"user\"><em>" . htmlspecialchars($name) . "</em></strong>";
@@ -197,54 +197,54 @@ USER_NOTE_TEXT;
}
function manual_navigation_breadcrumbs(array $setup) {
$menu = array();
$menu = [];
foreach (array_reverse($setup["parents"]) as $parent) {
$menu[] = array(
$menu[] = [
"title" => $parent[1],
"link" => $parent[0],
);
];
}
// The index manual page has no parent..
if ($setup["up"][0]) {
$last_item = array(
$last_item = [
"title" => $setup["up"][1],
"link" => $setup["up"][0],
);
];
$menu[] = $last_item;
}
return $menu;
}
function manual_navigation_related(array $setup) {
$siblings = array();
$siblings = [];
foreach ($setup['toc'] as $entry) {
$siblings[] = array(
$siblings[] = [
"title" => manual_navigation_methodname($entry[1]),
"link" => $entry[0],
"current" => $setup["this"][0] == $entry[0],
);
];
}
// The index manual page has no parent..
if ($setup["up"][0]) {
$last_item = array(
$last_item = [
"title" => $setup["up"][1],
"link" => $setup["up"][0],
);
$siblings = array(array_merge($last_item, array("children" => $siblings)));
];
$siblings = [array_merge($last_item, ["children" => $siblings])];
}
return $siblings;
}
function manual_navigation_deprecated(array $setup) {
$methods = array();
$methods = [];
foreach ((array)$setup['toc_deprecated'] as $entry) {
$methods[] = array(
$methods[] = [
"title" => manual_navigation_methodname($entry[1]),
"link" => $entry[0],
"current" => $setup["this"][0] == $entry[0],
);
];
}
return $methods;
@@ -258,7 +258,7 @@ function manual_navigation_methodname($methodname) {
}
// Add zero-width spaces to allow line-breaks at various characters
return str_replace(array('-', '_'), array('-&#8203;', '_&#8203;'), $methodname);
return str_replace(['-', '_'], ['-&#8203;', '_&#8203;'], $methodname);
}
// Set up variables important for this page
@@ -271,7 +271,7 @@ function manual_setup($setup) {
global $__RELATED;
if (!isset($setup["toc_deprecated"])) {
$setup["toc_deprecated"] = array();
$setup["toc_deprecated"] = [];
}
$PGI = $setup;
// Set base href for this manual page
@@ -279,11 +279,11 @@ function manual_setup($setup) {
$_SERVER['BASE_PAGE'] = $base . $setup['this'][0];
$_SERVER['BASE_HREF'] = $MYSITE . $_SERVER['BASE_PAGE'];
$timestamps = array(
$timestamps = [
filemtime($_SERVER["DOCUMENT_ROOT"] . "/" . $_SERVER["BASE_PAGE"]),
filemtime($_SERVER["DOCUMENT_ROOT"] . "/include/prepend.inc"),
filemtime($_SERVER["DOCUMENT_ROOT"] . "/styles/theme-base.css"),
);
];
// Load user note for this page
list($filename, $title) = $PGI['this'];
@@ -304,22 +304,22 @@ function manual_setup($setup) {
$__RELATED['toc'] = manual_navigation_related($setup);
$__RELATED['toc_deprecated'] = manual_navigation_deprecated($setup);
$config = array(
$config = [
"current" => "docs",
"breadcrumbs" => $breadcrumbs,
"languages" => array_keys($ACTIVE_ONLINE_LANGUAGES),
"meta-navigation" => array(
"meta-navigation" => [
"contents" => $base . $setup["home"][0],
"index" => $base . $setup["up"][0],
"prev" => $base . $setup["prev"][0],
"next" => $base . $setup["next"][0],
),
],
"lang" => $setup["head"][1],
"thispage" => $setup["this"][0],
"prev" => $setup["prev"],
"next" => $setup["next"],
"cache" => $lastmod,
);
];
site_header($setup["this"][1] . " - Manual ", $config);
$id = substr($setup['this'][0], 0, -4);
@@ -353,10 +353,10 @@ PAGE_TOOLS;
function manual_language_chooser($currentlang, $currentpage) {
global $ACTIVE_ONLINE_LANGUAGES;
$links = array();
$links = [];
foreach ($ACTIVE_ONLINE_LANGUAGES as $lang => $name) {
$links[] = array("$lang/$currentpage", $name, $lang);
$links[] = ["$lang/$currentpage", $name, $lang];
}
// Print out the form with all the options
@@ -393,10 +393,10 @@ function manual_footer() {
global $USERNOTES, $__RELATED;
manual_notes($USERNOTES);
$config = array(
$config = [
'related_menu' => $__RELATED['toc'],
'related_menu_deprecated' => $__RELATED['toc_deprecated']
);
];
site_footer($config);
}
@@ -404,13 +404,13 @@ function manual_footer() {
function relTime(DateTime $date) {
$current = new DateTime;
$diff = $current->diff($date);
$units = array("year" => $diff->format("%y"),
$units = ["year" => $diff->format("%y"),
"month" => $diff->format("%m"),
"day" => $diff->format("%d"),
"hour" => $diff->format("%h"),
"minute" => $diff->format("%i"),
"second" => $diff->format("%s"),
);
];
$out = "just now...";
foreach ($units as $unit => $amount) {
if (empty($amount)) {

View File

@@ -13,12 +13,12 @@ const MIRROR_NOTACTIVE = 1;
const MIRROR_OUTDATED = 2;
const MIRROR_DOESNOTWORK = 3;
$MIRRORS = array(
"https://www.php.net/" => array(
$MIRRORS = [
"https://www.php.net/" => [
"DEU", "MyraCloud", false,
"https://myracloud.com/en/", MIRROR_SPECIAL, true,
"en", MIRROR_OK),
);
"en", MIRROR_OK],
];
/**
* @var array<string, string> $COUNTRIES
@@ -166,7 +166,7 @@ function header_nocache()
function get_available_sqlites() {
$allsqlites = array(1 => 'sqlite', 2 => 'sqlite3', 4 => 'pdo_sqlite', 8 => 'pdo_sqlite2');
$allsqlites = [1 => 'sqlite', 2 => 'sqlite3', 4 => 'pdo_sqlite', 8 => 'pdo_sqlite2'];
$avail = 0;
if (function_exists('sqlite_open')) {
@@ -192,11 +192,11 @@ function get_available_sqlites() {
// Get all manual prefix search sections
function get_manual_search_sections() {
return array(
return [
"", "book.", "ref.", "function.", "class.",
"features.", "control-structures.", "language.",
"about.", "faq.",
);
];
}
function get_shortname($page) {
@@ -259,7 +259,7 @@ if ($_SERVER["SERVER_PORT"] != '80' && $_SERVER["SERVER_PORT"] != 443) {
// If the mirror is not registered with this name, provide defaults
// (no country code, no search, no stats, English default language ...)
if (!isset($MIRRORS[$MYSITE])) {
$MIRRORS[$MYSITE] = array("xx", $MYSITE, false, $MYSITE, MIRROR_VIRTUAL, false, "en", MIRROR_OK);
$MIRRORS[$MYSITE] = ["xx", $MYSITE, false, $MYSITE, MIRROR_VIRTUAL, false, "en", MIRROR_OK];
}
// Override mirror language with local preference

View File

@@ -13,7 +13,7 @@
})($_SERVER['REQUEST_URI'] ?? '');
// Get the modification date of this PHP file
$timestamps = array(@getlastmod());
$timestamps = [@getlastmod()];
/*
The date of prepend.inc represents the age of ALL
@@ -56,7 +56,7 @@ include_once 'include/version.inc';
mirror_setcookie("LAST_NEWS", $_SERVER["REQUEST_TIME"], 60*60*24*365);
$content = "<div class='home-content'>";
$frontpage = array();
$frontpage = [];
foreach ($NEWS_ENTRIES as $entry) {
foreach ($entry["category"] as $category) {
if ($category["term"] == "frontpage") {
@@ -122,31 +122,31 @@ $meta_image_path = $MYSITE . 'images/meta-image.png';
$meta_description = "PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.";
site_header("Hypertext Preprocessor",
array(
[
'current' => 'home',
'headtags' => array(
'headtags' => [
'<link rel="alternate" type="application/atom+xml" title="PHP: Hypertext Preprocessor" href="' . $MYSITE . 'feed.atom">',
'<script>',
"function okc(f){var c=[38,38,40,40,37,39,37,39,66,65,13],x=function(){x.c=x.c||Array.apply({},c);x.r=function(){x.c=null};return x.c},h=function(e){if(x()[0]==(e||window.event).keyCode){x().shift();if(!x().length){x.r();f()}}else{x.r()}};window.addEventListener?window.addEventListener('keydown',h,false):document.attachEvent('onkeydown',h)}",
"okc(function(){if(document.getElementById){i=document.getElementById('phplogo');i.src='".$MYSITE."images/php_konami.gif'}});",
'</script>'
),
'link' => array(
array(
],
'link' => [
[
"rel" => "search",
"type" => "application/opensearchdescription+xml",
"href" => $MYSITE . "phpnetimprovedsearch.src",
"title" => "Add PHP.net search"
),
array(
],
[
"rel" => "alternate",
"type" => "application/atom+xml",
"href" => $MYSITE . "releases/feed.php",
"title" => "PHP Release feed"
),
],
),
'css' => array('home.css'),
],
'css' => ['home.css'],
'intro' => $intro,
'meta_tags' => <<<META
<meta name="Description" content="{$meta_description}" />
@@ -165,7 +165,7 @@ site_header("Hypertext Preprocessor",
<meta property="og:image" content="{$meta_image_path}" />
<meta property="og:description" content="$meta_description" />
META
)
]
);
// Print body of home page.
@@ -173,10 +173,10 @@ echo $content;
// Prepare announcements.
if (is_array($CONF_TEASER)) {
$conftype = array(
$conftype = [
'conference' => 'Upcoming conferences',
'cfp' => 'Conferences calling for papers',
);
];
$announcements = "";
foreach ($CONF_TEASER as $category => $entries) {
if ($entries) {
@@ -218,9 +218,9 @@ SIDEBAR_DATA;
// Print the common footer.
site_footer(
array(
[
"atom" => "/feed.atom", // Add a link to the feed at the bottom
'elephpants' => true,
'sidebar' => $SIDEBAR
)
]
);

View File

@@ -48,11 +48,11 @@ header("Content-Type: application/javascript");
$s = file_get_contents($indexfile);
$js = json_decode($s, true);
$index = array();
$index = [];
foreach ($js as $item) {
if ($item[0]) {
/* key: ID/filename, 0=>*/
$index[$item[1]] = array($item[0], "", $item[2]);
$index[$item[1]] = [$item[0], "", $item[2]];
}
}

View File

@@ -1,7 +1,7 @@
<?php
$_SERVER['BASE_PAGE'] = 'license/contrib-guidelines-code.php';
include_once __DIR__ . '/../include/prepend.inc';
site_header("License Information", array("current" => "help"));
site_header("License Information", ["current" => "help"]);
?>
<h2>PHP Contributor Guidelines for Code Developers</h2>

View File

@@ -1,7 +1,7 @@
<?php
$_SERVER['BASE_PAGE'] = 'license/distrib-guidelines-code.php';
include_once __DIR__ . '/../include/prepend.inc';
site_header("License Information", array("current" => "help"));
site_header("License Information", ["current" => "help"]);
?>
<h2>PHP Distribution Guidelines</h2>

View File

@@ -17,7 +17,7 @@ $SIDEBAR_DATA = <<<EOF
</aside>
EOF;
site_header("License Information", array("current" => "help"));
site_header("License Information", ["current" => "help"]);
?>
<h1>PHP Licensing</h1>
@@ -153,4 +153,4 @@ For related projects, please refer to licensing information on the Project websi
<li><a href="http://gtk.php.net/copyright.php">GTK</a></li>
</ul>
<?php site_footer(array('sidebar' => $SIDEBAR_DATA));
<?php site_footer(['sidebar' => $SIDEBAR_DATA]);

View File

@@ -39,7 +39,7 @@ $SIDEBAR_DATA = '
</ul>
';
site_header("Mailing Lists", array("current" => "help"));
site_header("Mailing Lists", ["current" => "help"]);
// Some mailing list is selected for [un]subscription
if (isset($_POST['action'])) {
@@ -73,13 +73,13 @@ if (isset($_POST['action'])) {
// Get in contact with main server to [un]subscribe the user
$result = posttohost(
"https://main.php.net/entry/subscribe.php",
array(
[
"request" => $request,
"email" => $_POST['email'],
"maillist" => $_POST['maillist'],
"remoteip" => $remote_addr,
"referer" => $MYSITE . "mailing-lists.php"
)
]
);
// Provide error if unable to [un]subscribe
@@ -183,125 +183,125 @@ if (isset($_POST['action'])) {
<?php
// array of lists (list, name, short desc., moderated, archive, digest, newsgroup)
$general_mailing_lists = array(
$general_mailing_lists = [
'General mailing lists for PHP users',
array (
[
'php-announce', 'Announcements',
'Announcements of new PHP releases are sent to this very low-volume list',
true, false, false, "php.announce"
),
array (
],
[
'php-general', 'General user list',
'This is a high volume list for general PHP support; ask PHP questions here',
false, true, true, "php.general"
),
array (
],
[
'php-windows', 'Windows PHP users list',
'Using PHP on Microsoft Windows',
false, true, true, "php.windows"
),
],
'Subject specific lists for PHP users',
array (
[
'php-install', 'Installation issues and problems',
'How to install PHP with particular configurations and servers',
false, true, true, "php.install"
),
array (
],
[
'php-db', 'Databases and PHP',
'This list is for the discussion of PHP database topics',
false, true, true, "php.db"
),
array (
],
[
'php-i18n', 'Unicode and Internationalization',
'Unicode support, Internationalization (i18n) and localization (l10n) issues and features',
false, true, true, "php.i18n"
),
array (
],
[
'php-evangelism', 'PHP evangelism mailing list',
'A list for people interested in promoting PHP and learning good reasons to support PHP in the enterprise',
true, true, true, "php.evangelism"
),
array (
],
[
'soap', 'PHP SOAP list',
'List for the SOAP developers',
false, false, false, 'php.soap'
),
],
'Non-English language mailing lists',
array (
[
'php-es', 'Spanish PHP Mailing list',
'List for Spanish speaking people interested in PHP',
false, false, false, 'php.general.es'
),
],
);
];
// array of lists (list, name, short desc., moderated, archive, digest, newsgroup)
$internals_mailing_lists = array(
$internals_mailing_lists = [
'PHP and Zend Engine internals lists',
array (
[
'internals', 'Internals list',
'A medium volume list for those who want to help out with the development of PHP',
false, 'php-internals', true, "php.internals"
),
array (
],
[
'internals-win', 'Windows Internals list',
'A low volume list for those who want to help out with the development of PHP on Windows',
false, false, true, "php.internals.win"
),
array (
],
[
'php-cvs', 'Git commit list',
'All commits to internals (php-src) and the Zend Engine are posted to this list automatically',
true, true, false, "php.cvs"
),
array (
],
[
'git-pulls', 'Git pull requests',
'Pull requests from Github',
false, false, false, "php.git-pulls"
),
array (
],
[
'php-qa', 'Quality Assurance list',
'List for the members of the PHP-QA Team',
false, true, false, "php.qa"
),
array (
],
[
'php-bugs', 'General bugs',
'General bug activity are posted here',
false, false, false, "php.bugs"
),
array (
],
[
'standards', 'PHP Standardization and interoperability list',
'Development of language standards',
false, false, false, "php.standards"
),
],
'PHP internal website mailing lists',
array (
[
'php-webmaster', 'PHP php.net internal infrastructure discussion',
'List for discussing and maintaining the php.net web infrastructure.<br>
For general PHP support questions, see "General Mailing Lists" or the <a href="/support.php">support page</a>',
false, false, false, "php.webmaster"
),
],
'PHP documentation mailing lists',
array (
[
'phpdoc', 'Documentation discussion',
'List for discussing the PHP documentation',
false, true, false, "php.doc"
),
array (
],
[
'doc-cvs', 'Documentation changes and commits',
'Changes to the documentation are posted here',
true, "php-doc-cvs", false, "php.doc.cvs"
),
array (
],
[
'doc-bugs', 'Documentation bugs',
'Documentation bug activity (translations, sources, and build system) are posted here',
true, 'php-doc-bugs', false, "php.doc.bugs"
),
);
],
];
// Print out a table for a given list array
function output_lists_table($mailing_lists): void

View File

@@ -7,7 +7,7 @@ include_once __DIR__ . '/../include/posttohost.inc';
include_once __DIR__ . '/../include/shared-manual.inc';
include __DIR__ . '/spam_challenge.php';
site_header("Add Manual Note", array('css' => 'add-note.css'));
site_header("Add Manual Note", ['css' => 'add-note.css']);
// Copy over "sect" and "redirect" from GET to POST
if (empty($_POST['sect']) && isset($_GET['sect'])) {
@@ -19,7 +19,7 @@ if (empty($_POST['redirect']) && isset($_GET['redirect'])) {
// Decide on whether all vars are present for processing
$process = true;
$needed_vars = array('note', 'user', 'sect', 'redirect', 'action', 'func', 'arga', 'argb', 'answer');
$needed_vars = ['note', 'user', 'sect', 'redirect', 'action', 'func', 'arga', 'argb', 'answer'];
foreach ($needed_vars as $varname) {
if (empty($_POST[$varname])) {
$process = false;
@@ -93,13 +93,13 @@ if ($process) {
// Post the variables to the central user note script
$result = posttohost(
"https://main.php.net/entry/user-note.php",
array(
[
'user' => $user,
'note' => $note,
'sect' => $_POST['sect'],
'ip' => $_SERVER['REMOTE_ADDR'],
'redirip' => $redirip
)
]
);
// If there is any non-header result, then it is an error

View File

@@ -2,7 +2,7 @@
include_once __DIR__ . '/../include/prepend.inc';
$page = isset($_GET['page']) ? htmlspecialchars($_GET['page'], ENT_QUOTES, 'UTF-8') : '';
$page = strtr($page, array("\r"=>"", "\n"=>""));
$page = strtr($page, ["\r"=>"", "\n"=>""]);
// Redirect to new manual page
mirror_redirect("/manual/" . $page);

View File

@@ -24,7 +24,7 @@ The following list of languages already contain SVN modules, and will show up on
<ul>
<?php
// $archived are manuals we have old versions of
$archived = array('da', 'kr', 'pl', 'tw');
$archived = ['da', 'kr', 'pl', 'tw'];
foreach ($INACTIVE_ONLINE_LANGUAGES as $cc => $lang) {
$link = 'no archive';

View File

@@ -1,7 +1,7 @@
<?php
// simple and stupid SPAM protection (using little challenges)
const NUMS = array('zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine');
const NUMS = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'];
function plus($a, $b) {
return $a + $b;
@@ -27,13 +27,13 @@ function print_prefix($name, $a, $b) {
return "$name($a, $b)";
}
const CHALLENGES = array(
const CHALLENGES = [
// name, print, generator
array('max', 'print_prefix'),
array('min', 'print_prefix'),
array('minus', 'print_infix', 'gen_minus'),
array('plus', 'print_infix', 'gen_plus'),
);
['max', 'print_prefix'],
['min', 'print_prefix'],
['minus', 'print_infix', 'gen_minus'],
['plus', 'print_infix', 'gen_plus'],
];
// generate a challenge
function gen_challenge() {
@@ -44,7 +44,7 @@ function gen_challenge() {
$b = isset($c[2]) ? $c[2]($a) : rand(0, 9);
$bn = NUMS[$b];
return array($c[0], $an, $bn, $c[1]($c[0], $an, $bn));
return [$c[0], $an, $bn, $c[1]($c[0], $an, $bn)];
}
// test an answer for validity

View File

@@ -16,7 +16,7 @@ $master_url = "https://main.php.net/entry/user-notes-vote.php";
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (isset($_SERVER['HTTP_X_JSON']) && $_SERVER['HTTP_X_JSON'] == 'On' && !empty($_REQUEST['id']) && !empty($_REQUEST['page']) && ($N = manual_notes_load($_REQUEST['page'])) && array_key_exists($_REQUEST['id'], $N) && !empty($_REQUEST['vote']) && ($_REQUEST['vote'] === 'up' || $_REQUEST['vote'] === 'down')) {
$response = array();
$response = [];
$update = $N[$_REQUEST['id']]['votes']['up'] - $N[$_REQUEST['id']]['votes']['down'];
$hash = substr(md5($_REQUEST['page']), 0, 16);
$notes_file = $_SERVER['DOCUMENT_ROOT'] . "/backend/notes/" .
@@ -26,12 +26,12 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$response["msg"] = "Invalid request.";
}
else {
$data = array(
$data = [
"noteid" => $_REQUEST['id'],
"sect" => $_REQUEST['page'],
"vote" => $_REQUEST['vote'],
"ip" => $_SERVER['REMOTE_ADDR']
);
];
if (($r = posttohost($master_url, $data)) === null || strpos($r,"failed to open socket to") !== false) {
$response["success"] = false;
$response["msg"] = "Could not process your request at this time. Please try again later...";
@@ -70,12 +70,12 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$notes_file = $_SERVER['DOCUMENT_ROOT'] . "/backend/notes/" .
substr($hash, 0, 2) . "/$hash";
if (file_exists($notes_file)) {
$data = array(
$data = [
"noteid" => $_REQUEST['id'],
"sect" => $_REQUEST['page'],
"vote" => $_REQUEST['vote'],
"ip" => $_SERVER['REMOTE_ADDR'],
);
];
if (($r = posttohost($master_url, $data)) !== null && strpos($r,"failed to open socket to") === false) {
$r = json_decode($r);
if (isset($r->status, $r->votes) && $r->status) {

View File

@@ -31,7 +31,7 @@ $sqlite = get_available_sqlites();
$exts = implode(',', get_loaded_extensions());
echo implode('|', array(
echo implode('|', [
$MYSITE, // 0 : CNAME for mirror as accessed (CC, CC1, etc.)
PHP_VERSION, // 1 : PHP version overview
$LAST_UPDATED, // 2 : Update problems
@@ -43,4 +43,4 @@ echo implode('|', array(
$exts, // 8 : List of php extensions separated by comma
gethostname(), // 9 : The configured hostname of the local system
$_SERVER['SERVER_ADDR'], // 10: The IP address under which we're running
));
]);

View File

@@ -22,7 +22,7 @@ $MIRROR_IMAGE = '';
if (is_official_mirror()) {
// Iterate through possible mirror provider logo types in priority order
$types = array("gif", "jpg", "png");
$types = ["gif", "jpg", "png"];
foreach ($types as $ext) {
// Check if file exists for this type
if (file_exists("backend/mirror." . $ext)) {
@@ -48,7 +48,7 @@ if (is_official_mirror()) {
}
}
}
site_header("Information About This PHP Mirror Site", array("current" => "community"));
site_header("Information About This PHP Mirror Site", ["current" => "community"]);
?>
<h1>Information About This PHP Mirror Site</h1>

View File

@@ -9,7 +9,7 @@ $SIDEBAR_DATA = '
</p>
';
site_header("The PHP mirrors problem and troubleshooting guide", array("current" => "help"));
site_header("The PHP mirrors problem and troubleshooting guide", ["current" => "help"]);
?>
<h1>Common troubles that PHP.net mirrors face</h1>

View File

@@ -21,10 +21,10 @@ $SIDEBAR_DATA = '
site_header(
'Mirroring The PHP Website',
array(
[
'current' => 'community',
'layout_span' => 12,
)
]
);
?>

View File

@@ -8,7 +8,7 @@
$_SERVER['BASE_PAGE'] = 'mod.php';
include_once __DIR__ . '/include/prepend.inc';
site_header("Email confirmation", array("current" => "community"));
site_header("Email confirmation", ["current" => "community"]);
// Only run on main php.net box.
if (!is_primary_site()) {
@@ -24,7 +24,7 @@ ERROR;
}
// These sites are handled by automoderation
$sites = array("php.net", "lists.php.net");
$sites = ["php.net", "lists.php.net"];
// Get data from the URL
list($none, $site, $token, $sender) = explode("/", $_SERVER["PATH_INFO"]);

10
my.php
View File

@@ -7,7 +7,7 @@ header_nocache();
// Languages array copy and options to list
$langs = $ACTIVE_ONLINE_LANGUAGES;
$options = array();
$options = [];
// We have post data, and it is an available language
if (isset($_POST['my_lang'], $langs[$_POST['my_lang']])) {
@@ -60,11 +60,11 @@ if (isset($_POST["showug"])) {
// Prepare mirror array
$mirror_sites = $MIRRORS;
$mirror_sites["NONE"] = array(7 => MIRROR_OK);
$mirror_sites["NONE"] = [7 => MIRROR_OK];
myphpnet_save();
site_header("My PHP.net", array("current" => "community"));
site_header("My PHP.net", ["current" => "community"]);
?>
<form action="/my.php" method="post">
@@ -104,7 +104,7 @@ site_header("My PHP.net", array("current" => "community"));
<?php
// Data for the language settings table
$langinfo = array(
$langinfo = [
"<label for=\"form-my_lang\">Your preferred language</label>" =>
$langpref,
@@ -119,7 +119,7 @@ $langinfo = array(
default_language(),
"Default" => "en"
);
];
// Write a row for all settings
foreach ($langinfo as $lin => $lid) {

View File

@@ -1,7 +1,7 @@
<?php
$_SERVER['BASE_PAGE'] = 'privacy.php';
include_once __DIR__ . '/include/prepend.inc';
site_header("Privacy Policy", array("current" => "footer"));
site_header("Privacy Policy", ["current" => "footer"]);
?>
<h1>Privacy Policy</h1>

View File

@@ -50,7 +50,7 @@ if (!$dirh) {
error_noservice();
}
$functions = $maybe = $temp = $parts = array();
$functions = $maybe = $temp = $parts = [];
$p = 0;
// Get all file names from the directory
@@ -105,10 +105,10 @@ if (count($temp) > 0) {
}
// Do not index page if presented as a search result
if (count($maybe) > 0) { $head_options = array("noindex"); }
else { $head_options = array(); }
if (count($maybe) > 0) { $head_options = ["noindex"]; }
else { $head_options = []; }
site_header("Manual Quick Reference", $head_options+array("current" => "help"));
site_header("Manual Quick Reference", $head_options+["current" => "help"]);
// Note: $notfound is defined (with htmlspecialchars) inside manual-lookup.php
$notfound_enc = urlencode($notfound);
@@ -131,9 +131,9 @@ if ($snippet = is_known_snippet($notfound)) {
<?php
quickref_table($maybe, false);
$config = array(
$config = [
"sidebar" => '<p class="panel"><a href="/search.php?show=all&amp;pattern=' . $notfound_enc . '">Full website search</a>',
);
];
site_footer($config);
}

View File

@@ -1,7 +1,7 @@
<?php
$_SERVER['BASE_PAGE'] = 'releases/4_1_0_fr.php';
include_once __DIR__ . '/../include/prepend.inc';
site_header("Annonce de publication de PHP 4.1.0", array("lang" => "fr"));
site_header("Annonce de publication de PHP 4.1.0", ["lang" => "fr"]);
?>
<h1>Annonce de publication de PHP 4.1.0</h1>

View File

@@ -1,7 +1,7 @@
<?php
$_SERVER['BASE_PAGE'] = 'releases/4_2_0_fr.php';
include_once __DIR__ . '/../include/prepend.inc';
site_header("Annonce de publication de PHP 4.2.0", array("lang" => "fr"));
site_header("Annonce de publication de PHP 4.2.0", ["lang" => "fr"]);
?>
<h1>Annonce de publication de PHP 4.2.0</h1>

View File

@@ -1,7 +1,7 @@
<?php
$_SERVER['BASE_PAGE'] = 'releases/4_2_1_fr.php';
include_once __DIR__ . '/../include/prepend.inc';
site_header("Annonce de publication de PHP 4.2.1", array("lang" => "fr"));
site_header("Annonce de publication de PHP 4.2.1", ["lang" => "fr"]);
?>
<h1>Annonce de publication de PHP 4.2.1</h1>

View File

@@ -1,7 +1,7 @@
<?php
$_SERVER['BASE_PAGE'] = 'releases/4_2_2_fr.php';
include_once __DIR__ . '/../include/prepend.inc';
site_header("Annonce de publication de PHP 4.2.2", array("lang" => "fr"));
site_header("Annonce de publication de PHP 4.2.2", ["lang" => "fr"]);
?>
<h1>

View File

@@ -1,7 +1,7 @@
<?php
$_SERVER['BASE_PAGE'] = 'releases/4_3_0_fr.php';
include_once __DIR__ . '/../include/prepend.inc';
site_header("Annonce de publication de PHP 4.3.0", array("lang" => "fr"));
site_header("Annonce de publication de PHP 4.3.0", ["lang" => "fr"]);
?>
<h1>Annonce de publication de PHP 4.3.0</h1>

View File

@@ -1,7 +1,7 @@
<?php
$_SERVER['BASE_PAGE'] = 'releases/4_3_2_fr.php';
include_once __DIR__ . '/../include/prepend.inc';
site_header("Annonce de publication de PHP 4.3.2", array("lang" => "fr"));
site_header("Annonce de publication de PHP 4.3.2", ["lang" => "fr"]);
?>
<h1>Annonce de publication de PHP 4.3.2</h1>

View File

@@ -1,7 +1,7 @@
<?php
$_SERVER['BASE_PAGE'] = 'releases/4_3_4.php';
include_once __DIR__ . '/../include/prepend.inc';
site_header("Annonce de publication de PHP 4.3.4", array("lang" => "fr"));
site_header("Annonce de publication de PHP 4.3.4", ["lang" => "fr"]);
?>
<h1>Annonce de publication de PHP 4.3.4</h1>

View File

@@ -41,7 +41,7 @@ foreach ($RELEASED_VERSIONS as $version => $release) {
<summary type="html">There is a new PHP release in town!</summary>
XML;
$maxtime = array();
$maxtime = [];
foreach ($release["source"] as $source) {
if (!isset($source["date"])) {
continue;
@@ -50,7 +50,7 @@ XML;
$released = date(DATE_ATOM, $time);
echo " <link rel=\"enclosure\" title=\"{$source["name"]}\" href=\"/distributions/{$source["filename"]}\">\n";
foreach (array('md5', 'sha256') as $hashAlgo) {
foreach (['md5', 'sha256'] as $hashAlgo) {
if (isset($source[$hashAlgo])) {
echo " <php:{$hashAlgo}>{$source[$hashAlgo]}</php:{$hashAlgo}>\n";
}

View File

@@ -48,7 +48,7 @@ if (isset($_GET["serialize"]) || isset($_GET["json"])) {
}
if (empty($machineReadable)) {
$machineReadable = array("error" => "Unknown version");
$machineReadable = ["error" => "Unknown version"];
}
} else {
foreach ($RELEASES as $major => $release) {
@@ -71,10 +71,10 @@ if (isset($_GET["serialize"]) || isset($_GET["json"])) {
}
// Human Readable.
site_header("Releases", array(
site_header("Releases", [
'current' => 'downloads',
'css' => '/styles/releases.css',
));
]);
echo "<h1>Unsupported Historical Releases</h1>\n\n";
echo "<p>
@@ -166,7 +166,7 @@ site_footer(['sidebar' =>
']);
function recentEOLBranchesHTML(): string {
$eol = array();
$eol = [];
foreach (get_eol_branches() as $branches) {
foreach ($branches as $branch => $detail) {
$detail_date = $detail['date'];

View File

@@ -6,11 +6,11 @@ include __DIR__ . '/include/results.inc';
// HTTP status line is passed on, signifies an error
site_header(
'Search results',
array(
[
'noindex',
'current' => 'help',
'layout_span' => 12,
)
]
);
echo '<h1>Search results</h1>';

View File

@@ -45,13 +45,13 @@ if (!empty($_FORM['pattern'])) {
else {
// Print out common header
$link = array(
$link = [
"rel" => "search",
"type" => "application/opensearchdescription+xml",
"href" => $MYSITE . "phpnetimprovedsearch.src",
"title" => "Add PHP.net search"
);
site_header("Search", array("link" => array($link), "current" => "help"));
];
site_header("Search", ["link" => [$link], "current" => "help"]);
google_cse();
site_footer();

View File

@@ -1,7 +1,7 @@
<?php
$_SERVER['BASE_PAGE'] = 'security-note.php';
include_once __DIR__ . '/include/prepend.inc';
site_header("A Note on Security in PHP", array("current" => "docs"));
site_header("A Note on Security in PHP", ["current" => "docs"]);
?>
<h1>A Note on Security in PHP</h1>

View File

@@ -34,7 +34,7 @@ echo "<h1>PHP Security Center</h1>\n";
$dbfile = $_SERVER['DOCUMENT_ROOT'] . '/security/vulndb.txt';
$fp = @fopen($dbfile, "rt");
if (is_resource($fp)) {
$RECORDS = array();
$RECORDS = [];
$record_no = 1;
while ($s = fgets($fp)) {
if ($s == "\n") {

View File

@@ -1,7 +1,7 @@
<?php
$_SERVER['BASE_PAGE'] = 'sitemap.php';
include_once __DIR__ . '/include/prepend.inc';
site_header("Sitemap", array("current" => "help"));
site_header("Sitemap", ["current" => "help"]);
?>
<h1>PHP.net Sitemap</h1>

View File

@@ -1,7 +1,7 @@
<?php
$_SERVER['BASE_PAGE'] = 'sites.php';
include_once __DIR__ . '/include/prepend.inc';
site_header("A Tourist's Guide", array("current" => "help"));
site_header("A Tourist's Guide", ["current" => "help"]);
?>
<h1 class="content-header">PHP.net: A Tourist's Guide</h1>
@@ -223,7 +223,7 @@ SIDEBAR_DATA;
// Print the common footer.
site_footer(
array(
[
'sidebar' => $SIDEBAR
)
]
);

Some files were not shown because too many files have changed in this diff Show More