Commit 174426b
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 like1 parent 95a466e commit 174426b
File tree
498 files changed
+216673
-40220
lines changed- deprecated
- Exceptions
- generated
- 8.1
- 8.2
- 8.3
- 8.4
- 8.5
- Exceptions
- generator
- src
- tests
- tests
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| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | 13 | | |
23 | | - | |
24 | 14 | | |
25 | 15 | | |
26 | 16 | | |
| |||
42 | 32 | | |
43 | 33 | | |
44 | 34 | | |
| 35 | + | |
45 | 36 | | |
46 | 37 | | |
47 | 38 | | |
| |||
59 | 50 | | |
60 | 51 | | |
61 | 52 | | |
| 53 | + | |
62 | 54 | | |
63 | 55 | | |
64 | 56 | | |
| |||
71 | 63 | | |
72 | 64 | | |
73 | 65 | | |
74 | | - | |
75 | 66 | | |
76 | 67 | | |
77 | 68 | | |
| |||
97 | 88 | | |
98 | 89 | | |
99 | 90 | | |
100 | | - | |
| 91 | + | |
| 92 | + | |
101 | 93 | | |
102 | 94 | | |
103 | 95 | | |
| |||
111 | 103 | | |
112 | 104 | | |
113 | 105 | | |
114 | | - | |
| 106 | + | |
115 | 107 | | |
116 | 108 | | |
117 | 109 | | |
| |||
This file was deleted.
This file was deleted.
This file was deleted.
0 commit comments