Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork206
-
Hey there, I just want to make sure I got a couple of things right – regarding theDistribute via Packagist section of the documentation about building standalone applications, do we agree that installing the app running In other words, Composer will automatically create a file in The other thing is that, while running some tests, I was able to install my app using Isn't that kind of weird/wrong? I.e. using one method to install the app (Composer) and another one to update it (PHAR self-update). And if it's wrong, is there a way to programmatically know whether the app was installed using Composer and to conditionally hide/remove the self-update command in Thanks, Yannick |
BetaWas this translation helpful?Give feedback.
All reactions
Regarding your first query, if you leave the dependencies in therequire section of yourcomposer.json, they will be installed. This is why it is recommended to move them to therequire-dev (other than thephp version requirement). It's also recommended to exclude unnecessary files from your built archive (so that only the Phar is included).
You can see an example of this with the Oh Dear CLI:
- The
.gitattributesexcludes all content other thanbuild/ohdear, and accompanyingLICENSE.md,README.md, andcomposer.json - The
composer.jsondefines the PHP requirement for Composer, but the other dependencies are included in-devso that they are not included when installing globally through Composer
Replies: 2 comments 3 replies
-
I've answered the second question myself – while So I am now removing the self-update command when the app was installed via Composer by performing a check on the current directory ( I still would like to know whether my first assumption is correct though (i.e. Composer installs the dependencies but they are not used). |
BetaWas this translation helpful?Give feedback.
All reactions
-
Regarding your first query, if you leave the dependencies in the You can see an example of this with the Oh Dear CLI:
As you have mentioned, correctly, if you specify the Regarding your second query, I agree that is a bit of a weird scenario, and does seem odd to include that. However, I think in a way that makes sense as it's just a Phar file, so it has no knowledge of whether it's installed via Composer, Brew, Phive, or whatever. 🤷🏻 (Unless you do a check like you have). I think, if you are wanting to disable the |
BetaWas this translation helpful?Give feedback.
All reactions
-
Now that's super interesting. It hadn't quite clicked why Laravel Zero's documentation was instructing to move the framework over as a development dependency – makes much more sense now! Kinda feels like it should be made clearer in the doc? |
BetaWas this translation helpful?Give feedback.
All reactions
-
Feel free to open a PR if there's anything you think would make it clearer. 👍🏻 |
BetaWas this translation helpful?Give feedback.
All reactions
-
Thanks, just submitted aPR |
BetaWas this translation helpful?Give feedback.