Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.

Commit f9aef74

Browse files
committed
README
1 parent a01e1df commit f9aef74

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
phpstan.phar Composer source
2+
------------------------
3+
4+
When the user installs PHPStan with Composer with preference for source instead of dist:
5+
6+
```
7+
composer require phpstan/phpstan --prefer-source
8+
```
9+
10+
Composer would clone the entire [`phpstan/phpstan`](https://github.com/phpstan/phpstan) repository which has multiple gigabytes in size, because it contains all compiled phpstan.phar files for each [phpstan-src](https://github.com/phpstan/phpstan-src) commit in its history.
11+
12+
Cloning the entire repository often fails with timeouts and leads to bad initial user experience for users who configured Composer to clone entire repositories instead of downloading small dist .zip files.
13+
14+
Thanks to an undocumented Composer feature, it's possible to override which repository will Composer clone during installation.
15+
16+
This repository (`github.com/phpstan/phpstan-phar-composer-source`) is referenced in `source` key in `phpstan/phpstan` [composer.json](https://github.com/phpstan/phpstan/blob/2.1.x/composer.json) file.
17+
18+
When the user tries to use PHPStan with this repository in their `vendor/` directory, a script downloads `phpstan.phar` from [GitHub releases](https://github.com/phpstan/phpstan/releases) and prints a short warning before running PHPStan as usual.

0 commit comments

Comments
 (0)