The more I play with composer the more I like it … I plan to provide a composer.json file for my (few) published yii extensions.
One question : wouldn’t it be useful to add a ‘theme’ location in the Yii Installer ? ‘module’ and ‘extension’ are all right, but a ‘theme’ would also be a good candidate wouldn’t it ?
Don’t worry about this. At the point in the tutorial where I mentioned the lock file I had not even started to use Composer. The lock file will automatically be added in this step Run a composer update of course.
It was just not logical that it was displayed in the list of files and folder to be found in the installation folder.
If all rants were as informative as that I take a rant any day
The installers are very basic and the custom functionality you have built is way more powerful than what a plain installer can give. I mostly wrote the Wiki to get a discussion going for a unified solution for Composer and Yii 1.1.x. from looking at the thread you mention it sounds like both you and me are ahead of the Yii dev team when it comes to using Composer… I don’t really care what the end solution will be as long as it is flexible and light enough. A bonus would be if it was very similar to what we will get in Yii2.
When it come to installing to specific folders for each extension is this what you mean?
On a side note, will defining my extension as type yii-extension break if I try to use the Phundament Composer repository? If so we might have a problem.
Tbh I haven’t looked into exactly how the installer you have made is implemented. It is probably a good idea for me to add Yiiron to your repository so I get a feel for how it works.
No, what should break?
I was thinking of if you were using the type in any way or if requiring the installers would mess up anything you have done since it changes the behaviour for where the packages gets installed.
That is very nice work. It looks like it is pretty tied in to Phundament. If it is not it might be good to write a Wiki for how to use it free standing from Phundament.
I wasn’t really thinking about redistribution of the application. I can see how that would be a big problem for an application like Phundament or any other full application that is source controlled.
A middle ground for the installer based wiki wrote I wrote could be to use the extension, module and vendor folders for Composer installations only. Make sure these folders are git ignored and commit the composer lock file so that redistribution will be easy. If manual installation of extensions and modules are needed we can create separate folders for them since they have to be committed to Git to be redistributed anyway. The manual installation folders could be prefixed with manual_ or something like that. Not so pretty but as the installers are getting more common we will have less stuff in the manual_ folders and in Yii 2 it will not be needed at all if all extensions and modules are going to be forced to live in Composer anyway.
Another way would be to have subfolders within the extension and module folders but that would make the composer file messier. like so ext.manual.extension1 and ext.composer.extension2. Here we git ignore the path for ext.composer.
I think that would improve the installer based way of using Composer.
I don’t but since the official installer is using those directories I thought it was best to use them. It also seems to be standard Yii behaviour. I am just trying to get people to not having to change much from the standard installation.
Yes, it is the Yii standard behavior that you place extensions and modules into these folders. But doing it with composer is raising a lot of problems in my opinion.
As mentioned it gives you no benefit of placing the stuff into the folders above. Place it into vendor and you’re good to go, with more or less the same amount of config changes.
And I don’t want to be picky, but this is not an official installer from the Yii Dev team.
I guess it is just a matter of taste where you place the installed Composer packages. And the fact that both solutions can do this I think it is OK to do what you like. Though I wonder how it will work in Yii 2…
And no this is not the official installer released by Yii. It is the official Yii installer for Composers, maybe that was not clear enough.
I think I will leave the Wiki as it is for now but continue to plat with the installers to see if I come up with a better way. Just putting everything in the standard vendor folder might actually turn out to be the best thing.
Let me know if you get to know about any new Composer stuff. I think it is crucial to get this right in Yii 2. A PHP framework without proper Composer support will probably be a dead framework in a year or so…