-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgithub-sync-v3
More file actions
executable file
·273 lines (234 loc) · 7.49 KB
/
Copy pathgithub-sync-v3
File metadata and controls
executable file
·273 lines (234 loc) · 7.49 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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
#!/usr/bin/env php
<?php
use Amp\Http\Client\HttpClientBuilder;
use Amp\Http\Client\Interceptor\AddRequestHeader;
use Amp\WebsiteTools\GitHubClient;
use Kelunik\OAuth\Providers\GitHubProvider;
use function Amp\ByteStream\getStdin;
use function Amp\ByteStream\getStdout;
use function Kelunik\OAuthCli\authenticate;
require __DIR__ . "/../vendor/autoload.php";
$stdin = getStdin();
$stdout = getStdout();
$httpClient = (new HttpClientBuilder)
->intercept(new AddRequestHeader('user-agent', 'amphp/website-tools'))
->build();
$oauthToken = getenv('AMPHP_GITHUB_SYNC_TOKEN');
if (!$oauthToken) {
$github = new GitHubProvider(
$httpClient,
"http://127.0.0.1:1337/oauth",
getenv("AMPHP_GITHUB_SYNC_APP_ID"),
getenv("AMPHP_GITHUB_SYNC_APP_SECRET"),
["repo"]
);
$oauthToken = authenticate($github);
print 'Set AMPHP_GITHUB_SYNC_TOKEN=' . $oauthToken . ' to avoid manual interaction in the future.' . PHP_EOL;
}
$githubClient = new GitHubClient($oauthToken, $httpClient);
$reference = $githubClient->getHead("amphp/v3.amphp.org", "main");
$stdout->write("amphp/amphp.org is at {$reference}\r\n");
syncReadme(
$githubClient,
'amphp/amp@3.x',
'Coroutines, Futures, and Cancellations in PHP',
'Get started with asynchronous PHP by learning how to use the fundamental primitives.',
'undraw/undraw_city_life.svg',
);
syncReadme(
$githubClient,
'amphp/byte-stream@2.x',
'Non-blocking I/O Streams in PHP',
'Learn how to stream data (ordered sequences of bytes) concurrently in PHP.',
'undraw/undraw_developer_activity.svg',
);
syncReadme(
$githubClient,
'amphp/sync@2.x',
'Synchronize Concurrent Execution in PHP',
'Learn how to use synchronization primitives to organize concurrency.',
'undraw/undraw_developer_activity.svg',
);
syncReadme(
$githubClient,
'amphp/redis@2.x',
'Communicate with Redis Servers',
'Learn how to efficiently communicate with Redis servers, enabling scalable and responsive data storage and retrieval.',
'undraw/undraw_searching.svg',
);
syncReadme(
$githubClient,
'amphp/cache@2.x',
'Cache Data in Concurrent PHP Applications',
'Learn how to cache data to serve requests faster in a concurrency safe way.',
'undraw/undraw_memory_storage.svg',
);
syncReadme(
$githubClient,
'amphp/dns@2.x',
'Non-blocking DNS Hostname Resolution and Queries in PHP',
'Learn how to resolve hostnames to IP addresses and query records the domain name system.',
'undraw/undraw_searching.svg',
);
syncReadme(
$githubClient,
'amphp/file@3.x',
'Non-blocking Filesystem Access in PHP',
'Learn how to read and write files without blocking the event loop.',
'undraw/undraw_my_files.svg',
);
syncReadme(
$githubClient,
'amphp/socket@2.x',
'Non-blocking TCP Servers and Clients in PHP',
'Learn how to connect to servers and serve connections yourself.',
'undraw/undraw_coffee.svg',
);
syncReadme(
$githubClient,
'amphp/windows-registry@1.x',
'Non-blocking Windows Registry Access in PHP',
'Learn how to read values from the Windows Registry.',
'undraw/undraw_welcome.svg',
);
syncReadme(
$githubClient,
'amphp/log@2.x',
'Non-blocking Logging in PHP',
'Learn how to write logs for your application in a non-blocking way.',
'undraw/undraw_diary.svg',
);
syncReadme(
$githubClient,
'amphp/parser@1.x',
'Writing Parsers in PHP',
'Learn how to write streaming generator parsers in PHP.',
'undraw/undraw_reading_time.svg',
);
syncReadme(
$githubClient,
'amphp/phpunit-util@3.x',
'Simplify PHPUnit Tests Involving Asynchronous Behavior',
'Learn how to write tests with PHPUnit while making use of timeouts and minimum runtimes.',
'undraw/undraw_qa_engineers.svg',
);
syncReadme(
$githubClient,
'amphp/mysql@3.x',
'MySQL Connection Pool in PHP',
'Learn how to query and update data in MySQL databases.',
'undraw/undraw_fishing.svg',
);
syncReadme(
$githubClient,
'amphp/postgres@2.x',
'Postgres Connection Pool in PHP',
'Learn how to query and update data in Postgres databases.',
'undraw/undraw_fishing.svg',
);
syncReadme(
$githubClient,
'amphp/process@2.x',
'Non-blocking Child Processes in PHP',
'Learn how to run child processes, stream data, and collect their exit codes.',
'undraw/undraw_fatherhood.svg',
);
syncReadme(
$githubClient,
'amphp/serialization@1.x',
'Serialization in PHP',
'Learn how to serialize data for IPC and data storage in PHP.',
'undraw/undraw_drone_delivery.svg',
);
syncReadme(
$githubClient,
'amphp/parallel@2.x',
'Parallel Processing in PHP',
'Learn how to do true parallel processing in PHP using multiple processes or native threads, without blocking and no extensions required.',
'undraw/undraw_upgrade.svg',
);
syncReadme(
$githubClient,
'amphp/http@2.x',
'HTTP in PHP',
'Learn how to use our standards-compliant collection of basic HTTP primitives which can be shared by servers and clients.',
'undraw/undraw_logistics.svg',
);
syncReadme(
$githubClient,
'amphp/http-client@5.x',
'Non-blocking HTTP Client in PHP',
'Learn how to do standards-compliant HTTP resource traversal and RESTful web service consumption.',
'undraw/undraw_logistics.svg',
);
syncReadme(
$githubClient,
'amphp/http-server@3.x',
'HTTP server applications in PHP based on Revolt',
'Learn how to build non-blocking, concurrent HTTP/1.1 and HTTP/2 server applications in PHP based on Revolt.',
'undraw/undraw_logistics.svg',
);
syncReadme(
$githubClient,
'amphp/http-server-form-parser@2.x',
'HTTP Multipart Form Parsing',
'Learn how to parse x-www-form-urlencoded or multipart/form-data data submitted to an HTTP server request handler.',
'undraw/undraw_server_cluster.svg',
);
syncReadme(
$githubClient,
'amphp/http-server-router@2.x',
'Routing for HTTP servers in PHP',
'Learn how to route to different HTTP server RequestHandler instances based on the request path and method using FastRoute.',
'undraw/undraw_logistics.svg',
);
syncReadme(
$githubClient,
'amphp/http-server-session@3.x',
'HTTP Server Sessions',
'Learn how to handle user sessions, securely managing data across requests.',
'undraw/undraw_server_cluster.svg',
);
syncReadme(
$githubClient,
'amphp/http-server-static-content@2.x',
'Static File Serving',
'Learn how to serve static files with Amp\'s HTTP server.',
'undraw/undraw_logistics.svg',
);
syncReadme(
$githubClient,
'amphp/pipeline@1.x',
'Concurrent Datasets in PHP',
'Learn how to create and consume asynchronous sets.',
'undraw/undraw_logistics.svg',
);
syncReadme(
$githubClient,
'amphp/react-adapter@master',
'ReactPHP Compatibility',
'Learn how to use any ReactPHP library and make it compatible with Amp.',
'undraw/undraw_logistics.svg',
);
syncReadme(
$githubClient,
'amphp/websocket-client@2.x',
'PHP WebSocket Client',
'Learn how to create WebSocket client connections.',
'undraw/undraw_coffee.svg',
);
syncReadme(
$githubClient,
'amphp/websocket-server@4.x',
'PHP WebSocket Server',
'Learn how to create WebSocket servers.',
'undraw/undraw_drone_delivery.svg',
);
syncReadme(
$githubClient,
'amphp/cluster@2.x',
'Tools for server clusters in PHP',
'Learn how to create multiprocess server clusters.',
'undraw/undraw_server_cluster.svg',
);
syncReleases($githubClient);