Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 needed safe wrappers in 8.1 but no longer need safe wrappers in 8.2 will have no-op stubs generated instead) 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
- Loading branch information