Download the PHP package olinox14/path-php without Composer
On this page you can find all versions of the php package olinox14/path-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download olinox14/path-php
More information about olinox14/path-php
Files in olinox14/path-php
Package path-php
Short Description Object-oriented file and path operations, inspired by the path.py python library
License MIT
Informations about the package path-php
Path-php
An intuitive, standalone, and object-oriented library for file and path operations.
See the full documentation here : Documentation
Requirement
path-php requires php8.0 or ulterior versions.
Installation
Install with composer :
composer require olinox14/path-php
Usage
Import the Path class :
Instantiate with some path :
And use it as needed. For example, if you want to rename all the html files in the directory where your current script lies into .md files :
Contribute
Git branching
Contributions shall follow the gitflow pattern.
Tests
First build
Default php version in the dockerfile is set to be the oldest actively supported version of php, but you can change it locally before building your container.
Build your docker container :
docker build -t path .
Run it (name can be changed):
# On Linux
docker run -v "$(pwd)":/path --name path path
# On Windows
docker run -d -v "%cd%:/path" --name path path
Execute it and install dependencies :
docker exec -it path bash
composer install
Run the unit tests :
XDEBUG_MODE=coverage vendor/bin/phpunit -c phpunit.xml
Run on a built container
If you've already built your container, start it and run unit tests with :
docker start path
docker exec -it path bash
XDEBUG_MODE=coverage vendor/bin/phpunit -c phpunit.xml
Run code quality tools
Phpstan
Build and start the docker as explained in the unit tests section, then run :
vendor/bin/phpstan analyse --memory-limit=-1
see: https://phpstan.org/
CS Fixer
Build and start the docker as explained in the unit tests section, then run :
vendor/bin/php-cs-fixer fix src
Generate documentation
To install and run phpdoc :
docker pull phpdoc/phpdoc
# On Linux
docker run --rm -v "$(pwd):/data" "phpdoc/phpdoc:3"
# On Windows
docker run --rm -v "%cd%:/data" "phpdoc/phpdoc:3"
If you're on Linux, you could create an alias with :
alias phpdoc="docker run --rm -v $(pwd):/data phpdoc/phpdoc:3"
Licence
Path-php is under the MIT licence.