static-php-cli
static-php-cli copied to clipboard
Vendor mode in a custom project, with custom extensions
What does this PR do?
Minor changes for allowing to use the library in a custom project instead of forking and adjusting code within the "project base".
Thread of the question can be found in and also fix #687.
Added the following options to adjust:
- Adding a custom command
- Allow for custom changes for
BuilderProviderafter initializing. - By adding the following tree/namespace you can add custom extensions project-based without forking:
➜ poc-vendored-php-static-cli git:(main) tree --gitignore
.
├── bin
│ └── spc
├── composer.json
├── composer.lock
├── config
│ ├── ext.json
│ ├── lib.json
│ └── source.json
└── src
├── ConsoleApplication.php
├── MyCommand.php
└── builder
├── extension
│ └── snowflake.php
├── linux
│ └── library
│ └── snowflake.php
├── macos
│ └── library
│ └── snowflake.php
└── unix
└── library
└── snowflake.php
Project example can be found here. In the example I have added pdo_snowflake extension, because I need it, and it gives a good example.
Compling works, only the testing part fails at the moment due to PHP not using the pdo_snowflake.so file.
Checklist before merging
If your PR involves the changes mentioned below and completed the action, please tick the corresponding option. If a modification is not involved, please skip it directly.
- [x] If you modified
*.php, runcomposer cs-fixat local machine. - [x] If it's an extension or dependency update, make sure adding related extensions in
src/global/test-extensions.php. - [x] If you changed the behavior of static-php-cli, update docs in
./docs/. - [x] If you updated
config/xxx.jsoncontent, runbin/spc dev:sort-config xxx.