https://github.com/pforret/pa
like "php artisan" but more intelligent (use optimal PHP version for the project)
https://github.com/pforret/pa
artisan bash bashew composer php
Last synced: 7 months ago
JSON representation
like "php artisan" but more intelligent (use optimal PHP version for the project)
- Host: GitHub
- URL: https://github.com/pforret/pa
- Owner: pforret
- License: mit
- Created: 2022-09-26T14:47:37.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-01-08T20:44:39.000Z (over 2 years ago)
- Last Synced: 2025-01-13T22:22:10.202Z (9 months ago)
- Topics: artisan, bash, bashew, composer, php
- Language: Shell
- Homepage:
- Size: 692 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README






[](https://basher.gitparade.com/package/)# pforret/pa

Run `php artisan` and `composer` with the correct PHP version for the project, derived from composer.json
## 🔥 Usage
```
Program : pa by peter@forret.com
Version : v0.1.1 (2023-01-08 21:29)
Purpose : php artisan replacement
Usage : pa [-h] [-q] [-v] [-f] [-l ] [-t ] [-P ]
Flags, options and parameters:
-h|--help : [flag] show usage [default: off]
-q|--quiet : [flag] no output [default: off]
-v|--verbose : [flag] also show debug messages [default: off]
-f|--force : [flag] do not ask for confirmation (always yes) [default: off]
-l|--log_dir > : [option] folder for log files [default: /home/pforret/log/pa]
-t|--tmp_dir > : [option] folder for temp files [default: /tmp/pa]
-P|--OVERRIDE_PHP >: [option] override PHP binary to use (e.g. php8.1)
: [parameter] action to perform (see pa -h for details)
✅ Remote: gh_pforret:pforret/pa.git
### TIPS & EXAMPLES
* use pa list to show the available PHP versions on this machine
pa list
* use pa pick to show the best PHP version for this machine/repo
pa pick
* use pa co to run 'composer' with the optimal PHP version
pa co require author/package
pa co install
```## ⚡️ Examples
```bash
# run `php artisan`, but with the correct PHP version for this project
$ pa route:list
$ pa make:model ModelName# run `composer install`, with the correct PHP version
> pa c install
> pa co install
> pa com install
> pa comp install
> pa composer install# run `composer require` author/package, with the correct PHP version
> pa co require author/package# run 'pa pick' to see what PHP version would be chosen in this folder
# will parse PHP requirements from composer.json like "^8.0" or "^7.4|^8.0"
# and use the lowest version of PHP that is installed and qualifies
$ pa pick
/usr/bin/php7.4# show all available PHP versions on this machine
> pa list
# Installed on this machine [name]:
# - - - - - - - - - - - - - - - - - - - - -
# /usr/bin/php 8.0.26 ✅ Supported until 2023-11-26
# /usr/bin/php8.2 8.2.0 ✅ Supported until 2025-12-08
# /usr/bin/php8.1 8.1.13 ✅ Supported until 2024-11-25
# /usr/bin/php8.0 8.0.26 ✅ Supported until 2023-11-26
# /usr/bin/php7.4 7.4.33 ⛔ Unsupported since 2022-11-28
# /usr/local/bin/composer 2.5.1 2022-12-22
```## 🚀 Installation
with [basher](https://github.com/basherpm/basher)
$ basher install pforret/pa
or with `git`
$ git clone https://github.com/pforret/pa.git
$ cd pa## 📝 Acknowledgements
* script created with [bashew](https://github.com/pforret/bashew)
© 2022 Peter Forret