Skip to content

Commit 3b92107

Browse files
committed
Added documentation for 'pie install'
1 parent 16435ee commit 3b92107

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,36 @@ You must now add "extension=example_pie_extension" to your php.ini
4949
$
5050
```
5151

52+
## Installing all extensions for a project
53+
54+
When in your PHP project, you can install any missing top-level extensions:
55+
56+
```
57+
$ pie install
58+
🥧 PHP Installer for Extensions (PIE), 0.9.0, from The PHP Foundation
59+
You are running PHP 8.3.19
60+
Target PHP installation: 8.3.19 nts, on Linux/OSX/etc x86_64 (from /usr/bin/php8.3)
61+
Checking extensions for your project your-vendor/your-project
62+
requires: curl ✅ Already installed
63+
requires: intl ✅ Already installed
64+
requires: json ✅ Already installed
65+
requires: example_pie_extension ⚠️ Missing
66+
67+
The following packages may be suitable, which would you like to install:
68+
[0] None
69+
[1] asgrim/example-pie-extension: Example PIE extension
70+
> 1
71+
> 🥧 PHP Installer for Extensions (PIE), 0.9.0, from The PHP Foundation
72+
> This command may need elevated privileges, and may prompt you for your password.
73+
> You are running PHP 8.3.19
74+
> Target PHP installation: 8.3.19 nts, on Linux/OSX/etc x86_64 (from /usr/bin/php8.3)
75+
> Found package: asgrim/example-pie-extension:2.0.2 which provides ext-example_pie_extension
76+
... (snip) ...
77+
> ✅ Extension is enabled and loaded in /usr/bin/php8.3
78+
79+
Finished checking extensions.
80+
```
81+
5282
## More documentation...
5383

5484
The full documentation for PIE can be found in [usage](./docs/usage.md) docs.

docs/usage.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,39 @@ You can list the repositories for the target PHP installation with:
258258

259259
* `pie repository:list [--with-php-config=...]`
260260

261+
## Check and install missing extensions for your project
262+
263+
You can use `pie install` when in a PHP project working directory to check the
264+
extensions the project requires are present. If an extension is missing, PIE
265+
will try to find an installation candidate and interactively ask if you would
266+
like to install one. For example:
267+
268+
```
269+
$ pie install
270+
🥧 PHP Installer for Extensions (PIE), 0.9.0, from The PHP Foundation
271+
You are running PHP 8.3.19
272+
Target PHP installation: 8.3.19 nts, on Linux/OSX/etc x86_64 (from /usr/bin/php8.3)
273+
Checking extensions for your project your-vendor/your-project
274+
requires: curl ✅ Already installed
275+
requires: intl ✅ Already installed
276+
requires: json ✅ Already installed
277+
requires: example_pie_extension ⚠️ Missing
278+
279+
The following packages may be suitable, which would you like to install:
280+
[0] None
281+
[1] asgrim/example-pie-extension: Example PIE extension
282+
> 1
283+
> 🥧 PHP Installer for Extensions (PIE), 0.9.0, from The PHP Foundation
284+
> This command may need elevated privileges, and may prompt you for your password.
285+
> You are running PHP 8.3.19
286+
> Target PHP installation: 8.3.19 nts, on Linux/OSX/etc x86_64 (from /usr/bin/php8.3)
287+
> Found package: asgrim/example-pie-extension:2.0.2 which provides ext-example_pie_extension
288+
... (snip) ...
289+
> ✅ Extension is enabled and loaded in /usr/bin/php8.3
290+
291+
Finished checking extensions.
292+
```
293+
261294
## Comparison with PECL
262295

263296
Since PIE is a replacement for PECL, here is a comparison of the commands that

0 commit comments

Comments
 (0)