|
| 1 | +<div align="center"> |
| 2 | + |
| 3 | +# PHP Matrix |
| 4 | + |
| 5 | +[](https://packagist.org/packages/typisttech/php-matrix) |
| 6 | +[](https://github.com/typisttech/php-matrix/blob/readme/composer.json) |
| 7 | +[](https://github.com/typisttech/php-matrix/actions/workflows/test.yml) |
| 8 | +[](https://codecov.io/gh/typisttech/php-matrix) |
| 9 | +[](https://github.com/typisttech/php-matrix/blob/master/LICENSE) |
| 10 | +[](https://x.com/tangrufus) |
| 11 | +[](https://bsky.app/profile/tangrufus.com) |
| 12 | +[](https://github.com/sponsors/tangrufus) |
| 13 | +[](https://typist.tech/contact/) |
| 14 | + |
| 15 | +<p> |
| 16 | + <strong>List PHP versions that satisfy the given constraint.</strong> |
| 17 | + <br /> |
| 18 | + <br /> |
| 19 | + Built with ♥ by <a href="https://typist.tech/">Typist Tech</a> |
| 20 | +</p> |
| 21 | + |
| 22 | +</div> |
| 23 | + |
| 24 | +--- |
| 25 | + |
| 26 | +## Usage |
| 27 | + |
| 28 | +```console |
| 29 | +$ php-matrix "^7 || ^8" |
| 30 | +{ |
| 31 | + "constraint": "^7 || ^8", |
| 32 | + "versions": [ |
| 33 | + "7.4", |
| 34 | + "7.3", |
| 35 | + "7.2", |
| 36 | + "7.1", |
| 37 | + "7.0", |
| 38 | + "8.4", |
| 39 | + "8.3", |
| 40 | + "8.2", |
| 41 | + "8.1", |
| 42 | + "8.0" |
| 43 | + ], |
| 44 | + "lowest": "7.0", |
| 45 | + "highest": "8.4" |
| 46 | +} |
| 47 | + |
| 48 | +$ php-matrix --mode=full "~7.4.29 || ~8.1.29" |
| 49 | +{ |
| 50 | + "constraint": "~7.4.29 || ~8.1.29", |
| 51 | + "versions": [ |
| 52 | + "7.4.33", |
| 53 | + "7.4.32", |
| 54 | + "7.4.30", |
| 55 | + "7.4.29", |
| 56 | + "8.1.31", |
| 57 | + "8.1.30", |
| 58 | + "8.1.29" |
| 59 | + ], |
| 60 | + "lowest": "7.4.29", |
| 61 | + "highest": "8.1.31" |
| 62 | +} |
| 63 | + |
| 64 | +$ php-matrix --mode=minor-only ">=7.2 <8.4" |
| 65 | +{ |
| 66 | + "constraint": ">=7.2 <8.4", |
| 67 | + "versions": [ |
| 68 | + "7.4", |
| 69 | + "7.3", |
| 70 | + "7.2", |
| 71 | + "8.3", |
| 72 | + "8.2", |
| 73 | + "8.1", |
| 74 | + "8.0" |
| 75 | + ], |
| 76 | + "lowest": "7.2", |
| 77 | + "highest": "8.3" |
| 78 | +} |
| 79 | +``` |
| 80 | + |
| 81 | +### Options |
| 82 | + |
| 83 | +#### `--mode` |
| 84 | + |
| 85 | +| Value | Description | |
| 86 | +|------------------------|--------------------------------------------------------------| |
| 87 | +| `minor-only` (default) | Report `MAJOR.MINOR` versions only | |
| 88 | +| `full` | Report all satisfying versions in `MAJOR.MINOR.PATCH` format | |
| 89 | + |
| 90 | +#### `--source` |
| 91 | + |
| 92 | +| Value | Description | |
| 93 | +|------------------|-------------------------------------------------------------------------------------------------------------| |
| 94 | +| `auto` (default) | Use `offline` in `minor-only` mode. Otherwise, fetch from [php.net](https://www.php.net/releases/index.php) | |
| 95 | +| `php.net` | Fetch releases information from [php.net](https://www.php.net/releases/index.php) | |
| 96 | +| `offline` | Use [hardcoded releases](resources/all-versions.json) information | |
| 97 | + |
| 98 | +## Installation |
| 99 | + |
| 100 | +### Composer Global |
| 101 | + |
| 102 | +```bash |
| 103 | +composer global require typisttech/php-matrix |
| 104 | +php-matrix --help |
| 105 | +``` |
| 106 | + |
| 107 | +### Composer Project |
| 108 | + |
| 109 | +```bash |
| 110 | +composer create-project typisttech/php-matrix |
| 111 | +cd php-matrix |
| 112 | +php-matrix --help |
| 113 | +``` |
| 114 | + |
| 115 | +## Credits |
| 116 | + |
| 117 | +[`PHP Matrix`](https://github.com/typisttech/php-matrix) is a [Typist Tech](https://typist.tech) project and |
| 118 | +maintained by [Tang Rufus](https://x.com/TangRufus), freelance developer for [hire](https://typist.tech/contact/). |
| 119 | + |
| 120 | +Full list of contributors can be found [here](https://github.com/typisttech/php-matrix/graphs/contributors). |
| 121 | + |
| 122 | +## Copyright and License |
| 123 | + |
| 124 | +This project is a [free software](https://www.gnu.org/philosophy/free-sw.en.html) distributed under the terms of |
| 125 | +the MIT license. For the full license, see [LICENSE](./LICENSE). |
| 126 | + |
| 127 | +## Contribute |
| 128 | + |
| 129 | +Feedbacks / bug reports / pull requests are welcome. |
0 commit comments