Skip to content
This repository has been archived by the owner on Oct 12, 2021. It is now read-only.

Add to Packagist, add Composer installation instructions #3

Closed
tobyzerner opened this issue Nov 4, 2015 · 5 comments
Closed

Add to Packagist, add Composer installation instructions #3

tobyzerner opened this issue Nov 4, 2015 · 5 comments

Comments

@tobyzerner
Copy link
Contributor

We want to expose people to the idea of using Composer to install extensions. While a zip download is fine for extensions like this without any autoloading stuff, it'd be cool if you could put this up on Packagist and add composer require s9e/flarum-mediaembed as an alternative method of installation to the README. This would certainly be my preferred method of installation for discuss.flarum.org! And then updates are as easy as composer update 👍

I'm not sure if you can use a different package name on Packagist, but Flarum's Composer installer only truncates a flarum- prefix from the start, so ideally the package name would be flarum-mediaembed. That would be installed to extensions/s9e-mediaembed.

@tobyzerner
Copy link
Contributor Author

Uploading to Packagist/ installing via Composer also enables you to remove the "version" line from composer.json, as Packagist automatically gets this information from git tags and Flarum automatically gets this information from vendor/composer/installed.json.

@JoshyPHP
Copy link
Member

JoshyPHP commented Nov 4, 2015

Yeah, actually I did that a few minutes ago but I had to remove it from Packagist when I saw that it installed a snapshot from the tree rather than the release file. The difference between the two is that a snapshot from the tree contains my build script, and I don't want people to inadvertently install executable files.

Is there a way to tell Packagist to specifically use the release file?

@tobyzerner
Copy link
Contributor Author

Ah I see. I think if you add build export-ignore to a .gitattributes file that will exclude it from the downloadable GitHub zip archive (which is what Packagist uses). There's no other way to exclude files that I'm aware of.

@tobyzerner
Copy link
Contributor Author

Also keep in mind that we intend to prevent public web access to the extensions directory. The default .htaccess and the provided nginx configuration don't currently do this but they should/will when I get around to it. So executables in extensions won't be a problem.

That said, do you really need a build script if distributing via Packagist?

@JoshyPHP
Copy link
Member

JoshyPHP commented Dec 4, 2015

Alright, I've just checked and the latest version only installs the necessary files via Composer. Everything should work as expected.

@JoshyPHP JoshyPHP closed this as completed Dec 4, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants