macwinnie / phphelpers
reusable PHP functions, e.g. RegEx ones
Requires (Dev)
- behat/behat: >=3.8
- phpunit/phpunit: >=9.5
- dev-master
- 2.2.38
- 2.2.37
- 2.2.36
- 2.2.35
- 2.2.34
- 2.2.33
- 2.2.32
- 2.2.31
- 2.2.30
- 2.2.29
- 2.2.28
- 2.2.27
- 2.2.26
- 2.2.25
- 2.2.24
- 2.2.23
- 2.2.22
- 2.2.21
- 2.2.20
- 2.2.19
- 2.2.18
- 2.2.17
- 2.2.16
- 2.2.15
- 2.2.14
- 2.2.13
- 2.2.12
- 2.2.11
- 2.2.10
- 2.2.9
- 2.2.8
- 2.2.7
- 2.2.6
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.7
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.1.11
- 1.1.10
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.16
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2025-04-29 01:37:53 UTC
README
This small repo is used to maintain my regularly reused PHP functions, e.g. RegEx functions.
Usage
They can be used within any code for example like that:
var_dump( format2regex( 'uid=%s,ou=people,dc=example,dc=com' ) ); // string(43) "/uid\=(.*?),ou\=people,dc\=example,dc\=com/"
Installation by Composer
This repo is meant to be included within other projects, so simply run this command to require it:
composer require macwinnie/phphelpers
Since the tool is also tested, please ensure to run composer install --no-dev
in production stages, so no unnecessary tools are installed and autoloaded within your production environment!
Testing
All functionalities are developed along the BDD (behaviour driven development) principles. Therefor, Behat is used to write Gherkin test scenarios and test them – all that takes part within the /tests
folder.
To run the tests, you'll need the full composer installation with all dependencies, the production and development ones. For example use devopsansiblede/apache:latest
to run everything that follows:
docker pull devopsansiblede/apache docker run -p80:80 -d --name phphelpers -v $(pwd):/var/www/html devopsansiblede/apache docker exec -it -u www-data phphelpers composer install docker exec -it -u www-data phphelpers vendor/bin/behat
Documentation
Documentation current master state
The functions within this repository are documented with DocBlock style. To visualize the documentation, the project is using phpDocumentor to generate a viewable website with the documentation within the directory /docs
.
To create the latest documentation, simply run the following Docker command:
docker pull phpdoc/phpdoc:3 rm -rf docs docker run --rm -v $(pwd):/data phpdoc/phpdoc:3 --setting=graphs.enabled=true -d src -t docs --sourcecode --title=PHP-Helpers --no-interaction cat <<EOF >> docs/css/base.css code.prettyprint { background: var(--primary-color-lighten); border: 1px solid var(--code-border-color); border-radius: var(--border-radius-base-size); padding: 0.1em 0.4em; margin: 0.1em 0.2em; font-size: 0.9em !important; } pre.prettyprint { font-size: 0.8em !important; } EOF
ATTENTION: The phpDocumentor tag latest
from Docker is somehow a very old one – one wants to use a version tag like the :3
above.
last dependency update and test
2023-01-29 23:22:39