Skip to content

Commit 174426b

Browse files
committed
Generate files for multiple versions
tl;dr: replace ```php $function_list = read_docs(); generate_files($function_list, "../generated/"); ``` with ```php foreach(["8.1", "8.2", "8.3", "8.4"] as $version) { exec("cd docs && git checkout $version"); $function_list = read_docs(); generate_files($function_list, "../generated/$version/"); } ``` generate a bunch of stubs like generated/misc.php: ```php <?php if(PHP_VERSION == "8.1") require_once __DIR__ . "/8.1/misc.php"; if(PHP_VERSION == "8.2") require_once __DIR__ . "/8.2/misc.php"; if(PHP_VERSION == "8.3") require_once __DIR__ . "/8.3/misc.php"; if(PHP_VERSION == "8.4") require_once __DIR__ . "/8.4/misc.php"; ``` This also automates generation of "deprecated" `safe` functions (ie, instead of hard-coding `deprecated/apache.php`, any functions which were generated in `8.1/apache.php` but are no longer needed and thus not-generated in `8.2/apache.php` will end up in `8.2/deprecated.php`. Perhaps it'd be better to put them at the tail of `8.2/apache.php`? PRs welcome) Currently the `Exceptions` are shared between all versions, which I _think_ is a good idea? (Thoughts, anybody?) This isn't even remotely tested, just a proof of concept to show what this kind of approach might look like
1 parent 95a466e commit 174426b

File tree

498 files changed

+216673
-40220
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

498 files changed

+216673
-40220
lines changed

composer.json

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,10 @@
77
"lib/DateTime.php",
88
"lib/DateTimeImmutable.php",
99
"lib/Exceptions/",
10-
"deprecated/Exceptions/",
1110
"generated/Exceptions/"
1211
],
1312
"files": [
14-
"deprecated/array.php",
15-
"deprecated/datetime.php",
16-
"deprecated/libevent.php",
17-
"deprecated/misc.php",
18-
"deprecated/password.php",
19-
"deprecated/mssql.php",
20-
"deprecated/stats.php",
21-
"deprecated/strings.php",
2213
"lib/special_cases.php",
23-
"deprecated/mysqli.php",
2414
"generated/apache.php",
2515
"generated/apcu.php",
2616
"generated/array.php",
@@ -42,6 +32,7 @@
4232
"generated/ftp.php",
4333
"generated/funchand.php",
4434
"generated/gettext.php",
35+
"generated/gmp.php",
4536
"generated/gnupg.php",
4637
"generated/hash.php",
4738
"generated/ibase.php",
@@ -59,6 +50,7 @@
5950
"generated/mbstring.php",
6051
"generated/misc.php",
6152
"generated/mysql.php",
53+
"generated/mysqli.php",
6254
"generated/network.php",
6355
"generated/oci8.php",
6456
"generated/opcache.php",
@@ -71,7 +63,6 @@
7163
"generated/ps.php",
7264
"generated/pspell.php",
7365
"generated/readline.php",
74-
"generated/rnp.php",
7566
"generated/rpminfo.php",
7667
"generated/rrd.php",
7768
"generated/sem.php",
@@ -97,7 +88,8 @@
9788
"generated/yaml.php",
9889
"generated/yaz.php",
9990
"generated/zip.php",
100-
"generated/zlib.php"
91+
"generated/zlib.php",
92+
"generated/rnp.php"
10193
]
10294
},
10395
"require": {
@@ -111,7 +103,7 @@
111103
"php-parallel-lint/php-parallel-lint": "^1.4"
112104
},
113105
"scripts": {
114-
"lint": "parallel-lint deprecated/ lib/ tests/",
106+
"lint": "parallel-lint lib/ tests/",
115107
"test": "phpunit",
116108
"phpstan": "phpstan analyse",
117109
"cs-fix": "phpcbf",

deprecated/Exceptions/LibeventException.php

Lines changed: 0 additions & 11 deletions
This file was deleted.

deprecated/Exceptions/PasswordException.php

Lines changed: 0 additions & 15 deletions
This file was deleted.

deprecated/Exceptions/StatsException.php

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)