-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchapters.json
More file actions
204 lines (204 loc) · 7.42 KB
/
Copy pathchapters.json
File metadata and controls
204 lines (204 loc) · 7.42 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
{
"$comment": "Machine-readable chapter manifest. bin/check-chapters.php verifies it against the tree. See docs/CONVENTIONS.md.",
"php": "8.5",
"request": {
"o": "object (plugin)",
"m": "method (create|read|update|delete|list)",
"i": "id (int)",
"x": "export format ('' | json)"
},
"chapters": [
{
"id": "01",
"name": "Simple",
"dir": "01-Simple",
"idea": "A request becomes a page: one self-rendering anonymous class",
"entry": "01-Simple/public/index.php",
"adds": [
"public/index.php"
],
"php": [
"pipe operator |>",
"typed class constants",
"asymmetric visibility public private(set)",
"first-class callable syntax f(...)"
],
"visible_change": true,
"run": "php -S localhost:8001 -t 01-Simple/public",
"test": "vendor/bin/pest tests/Simple"
},
{
"id": "02",
"name": "Styled",
"dir": "02-Styled",
"idea": "Presentation: shared CSS/JS, the app shell, dark mode, colour schemes, toasts",
"entry": "02-Styled/public/index.php",
"adds": [],
"php": [
"heredoc and nowdoc discipline",
"match expression"
],
"visible_change": true,
"run": "php -S localhost:8002 -t 02-Styled/public",
"test": "vendor/bin/pest tests/Styled"
},
{
"id": "03",
"name": "Plugins",
"dir": "03-Plugins",
"idea": "The request contract (o, m, x) and the CRUDL plugin interface",
"entry": "03-Plugins/public/index.php",
"adds": [],
"php": [
"readonly classes",
"new X()->method() without parentheses",
"abstract classes and inheritance",
"match(true) dispatch"
],
"visible_change": false,
"run": "php -S localhost:8003 -t 03-Plugins/public",
"test": "vendor/bin/pest tests/Plugins"
},
{
"id": "04",
"name": "Views",
"dir": "04-Views",
"idea": "Model returns data, View returns HTML, Theme wraps it; escape at output",
"entry": "04-Views/public/index.php",
"adds": [],
"php": [
"#[\\Override]",
"static return types",
"htmlspecialchars flags"
],
"visible_change": false,
"run": "php -S localhost:8004 -t 04-Views/public",
"test": "vendor/bin/pest tests/Views"
},
{
"id": "05",
"name": "Autoload",
"dir": "05-Autoload",
"idea": "The same code as files: PSR-4, namespaces, Composer",
"entry": "05-Autoload/public/index.php",
"adds": [
"src/Core/Ctx.php",
"src/Core/Init.php",
"src/Core/Plugin.php",
"src/Core/View.php",
"src/Core/Theme.php",
"src/Plugins/Home/HomeModel.php",
"src/Plugins/Home/HomeView.php",
"src/Plugins/About/AboutModel.php",
"src/Plugins/Contact/ContactModel.php",
"src/Plugins/Contact/ContactView.php"
],
"php": [
"namespaces and use",
"PSR-4 autoloading",
"declare(strict_types=1)"
],
"visible_change": false,
"run": "php -S localhost:8005 -t 05-Autoload/public",
"test": "vendor/bin/pest tests/Autoload"
},
{
"id": "06",
"name": "Session",
"dir": "06-Session",
"idea": "State between requests: sessions, flash messages, CSRF, POST-only mutations",
"entry": "06-Session/public/index.php",
"adds": [
"src/Core/Flash.php"
],
"php": [
"enums with methods",
"session configuration",
"CSRF tokens",
"POST-only mutations with Post/Redirect/Get"
],
"visible_change": true,
"run": "php -S localhost:8006 -t 06-Session/public",
"test": "vendor/bin/pest tests/Session"
},
{
"id": "07",
"name": "PDO",
"dir": "07-PDO",
"idea": "Persistence: SQLite via PDO, a schema, prepared statements, a real CRUDL plugin",
"entry": "07-PDO/public/index.php",
"adds": [
"src/Core/Db.php",
"src/Core/QueryType.php",
"schema.sql",
"src/Plugins/Posts/PostsModel.php",
"src/Plugins/Posts/PostsView.php"
],
"php": [
"backed and pure enums",
"#[\\NoDiscard]",
"match on enum cases",
"PDO prepared statements with typed binding"
],
"visible_change": true,
"run": "php -S localhost:8007 -t 07-PDO/public",
"test": "vendor/bin/pest tests/PDO"
},
{
"id": "08",
"name": "Auth",
"dir": "08-Auth",
"idea": "Identity: users, password hashing, login/logout, roles, access control",
"entry": "08-Auth/public/index.php",
"adds": [
"src/Core/Role.php",
"src/Core/User.php",
"src/Plugins/Auth/AuthModel.php",
"src/Plugins/Auth/AuthView.php",
"src/Plugins/Users/UsersModel.php",
"src/Plugins/Users/UsersView.php"
],
"php": [
"enum methods as an ACL",
"readonly value objects",
"nullable types and ?->",
"password_hash / password_verify",
"session_regenerate_id"
],
"visible_change": true,
"run": "php -S localhost:8008 -t 08-Auth/public",
"test": "vendor/bin/pest tests/Auth"
},
{
"id": "09",
"name": "Blog",
"dir": "09-Blog",
"idea": "The application: content types, markdown, tags, pagination, self-hosted docs",
"entry": "09-Blog/public/index.php",
"adds": [
"src/Core/Type.php",
"src/Core/Md.php",
"src/Core/Post.php",
"src/Core/Content.php",
"src/Core/ContentView.php",
"src/Plugins/Blog/BlogModel.php",
"src/Plugins/Blog/BlogView.php",
"src/Plugins/Docs/DocsModel.php",
"src/Plugins/Docs/DocsView.php",
"src/Plugins/Tags/TagsModel.php",
"src/Plugins/Tags/TagsView.php",
"bin/seed-docs.php"
],
"php": [
"property hooks",
"array_first() / array_last()",
"URI extension for safe link schemes",
"the pipe operator as a render pipeline",
"abstract base sharing (Content)"
],
"visible_change": true,
"run": "php -S localhost:8009 -t 09-Blog/public",
"test": "vendor/bin/pest tests/Blog"
}
]
}