https://github.com/firehed/dependencies
PHP dependency checker
https://github.com/firehed/dependencies
Last synced: about 1 year ago
JSON representation
PHP dependency checker
- Host: GitHub
- URL: https://github.com/firehed/dependencies
- Owner: Firehed
- Created: 2011-02-23T21:41:09.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2011-03-30T06:17:51.000Z (about 15 years ago)
- Last Synced: 2025-02-13T22:27:03.101Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 93.8 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
# PHP Dependency checker
Different applications end up depending on various non-standard functionality. Many of these applications end up running checks for the existence of these extensions on every request, adding unnecessary logic and overhead.
It's easier to simply keep track of extension dependencies in a single file run on the server before deployment. If it exits clean, it's OK to continue deployment. If not, something is missing from the environment and the deployment should be halted.
## Setup
In the script, there are many calls to `show()`. The first parameter is simply a label for the extension, and the second param is some sort of check (returning `true`, `false`, or `"skip"`). The `label` calls are purely aesthetic.
Example:
label('Text/Unicode');
show('mbstring extension', extension_loaded('mbstring'));
if (extension_loaded('mbstring'))
show('mbstring overload is disabled', !(ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING));
else
show('mbstring overload is disabled', 'skip');
Depending on your environment settings, you may see a result like this:
-=[ Text/Unicode ]=-
mbstring extension [ OK ]
mbstring overload is disabled [ OK ]
Or, you may see something like this:
-=[ Text/Unicode ]=-
mbstring extension [FAILED]
mbstring overload is disabled [ SKIP ]
## Usage
At the most basic level, simply run the script from the command line:
`php check.php`
Any missing functionality will be listed.
To integrate with a deployment script, check the return code of the script execution: