-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.php
More file actions
102 lines (71 loc) · 2.33 KB
/
Copy pathindex.php
File metadata and controls
102 lines (71 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?php
declare(strict_types = 1);
require_once __DIR__ . "/../../../src/web_bootstrap.php";
use OpenDocs\Page;
use RfcCodexOpenDocs\RfcCodexEntry;
use RfcCodexOpenDocs\RfcCodexSection;
use function RfcCodexOpenDocs\getUnderDiscussionList;
use function RfcCodexOpenDocs\getAchievedList;
use function RfcCodexOpenDocs\getMootList;
use function RfcCodexOpenDocs\createGlobalPageInfoForRfcCodex;
/**
* @param RfcCodexEntry[] $links
* @return string
*/
function getLinkList(RfcCodexSection $section, $links)
{
$htmlLines = [];
foreach ($links as $linkAndDescription) {
$description = $linkAndDescription->getName();
$link = $linkAndDescription->getPath();
$htmlLines[] = sprintf(
"<li><a href='%s/%s'>%s</a></li>",
$section->getPrefix(),
$link,
$description
);
}
return "<ul>" . implode("\n", $htmlLines) . "</ul>";
}
function getHtml(RfcCodexSection $section): string
{
$under_discussion = getLinkList($section, getUnderDiscussionList());
$achieved_html = getLinkList($section, getAchievedList());
$moot_html = getLinkList($section, getMootList());
$html = <<< HTML
<h1>RFC Codex</h1>
<p>
These are some notes on PHP RFCs, why some were declined, and what others might need for them to be implemented.
</p>
<p>
The purpose of these documents is to avoid information from being lost and to try to avoid conversations needing to be repeated multiple times on PHP internals.
</p>
<h2> Things still being discussed</h2>
$under_discussion
<h2>Ideas that overcame their challenges</h2>
<p>
PHP is actually getting better. These are all things that used to be pipe-dreams, but are now in PHP core.
</p>
$achieved_html
<h2>Things that are probably moot</h2>
<p>
PHP is actually getting better, but that means that some solutions to problems have become pretty moot, as they seek to solve problems that are now less of a problem.
</p>
$moot_html
<h2>Misc notes</h2>
<p>
Someone asked for a summary of the <a href="/rfc_codex/spl_summary">general issues with the PHP SPL
</a>.
</p>
HTML;
return $html;
};
$fn = function (RfcCodexSection $section): Page
{
createGlobalPageInfoForRfcCodex(
title: 'RFC codex',
html: getHtml($section)
);
return \OpenDocs\Page::createFromHtmlGlobalPageInfo();
};
showPageResponse($fn);