Skip to content

Create composer.json #1241

Closed
wants to merge 2 commits into from

3 participants

@patforg

Make video js available in PHP projects that uses composer.

@patforg patforg Create composer.json
Make video js available in PHP projects that uses composer.
a19e157
@mmcc mmcc added the enhancement label
@mmcc
Video.js member

So many package managers! I'm not very familiar with the PHP world. How widely adopted is Composer?

@patforg

I know package managers are the new rage! I can imagine it's annoying to have a file for each package manager under the sun. Composer is the only PHP package manager I'm aware of that is adopted by the community.

All major PHP frameworks are using it: symphony 2, laravel, zend framework 2, codeigniter etc.

Let me know if you need more details.

@mmcc
Video.js member

Ok cool, sounds like this does have some traction. The only real concern is just having a bajillion json config files in the root directory, but in reality that's not a huge deal. I'm fine with this, but ultimately @heff will need to make the call.

@heff
Video.js member

Sorry for the delay, and thanks for the contribution! This was actually proposed back in #195 and I shot it down because it seemed excessive, but now the PHP guys here think it's a decent idea and bootstrap let one through, so I think we can go ahead and add it in. @patforg, are you up for taking ownership of it and keeping it up to date?

I was also going to say we should work it into the versioning grunt script, but there's no version in this one or bootstrap's. Does composer not use a version?

@patforg

Hi @heff,

I have no problem in keeping it up to date, it should require very little maintenance anyways.

All I have seen is a grunt-composer plugin which executes composer within grunt, but composer in itself has a way to run scripts. I could be mistaken but I don't think a grunt file would be needed.

@heff
Video.js member

Yeah, sorry, I meant updating the video.js grunt file. We have a grunt script that, when we make a new releases, will update the video.js version in the package.json, bower.json, and component.json. But composer.json doesn't appear to need a version? Do you know where the version of a package is tracked for composer, and is there anything we need to do in addition to adding the composer.json file?

@patforg

HI Heff,

Oh got it now. I've updated the version to 4.6.4 in all 3 files.

There is a version in the composer file but if omitted it takes the versions from tags and branches in the repository.

Optionally you can register the package with packagist.org, which is the main repository of packages.
It's best if it's done by the manager of the repository in order to setup a commit hook to update the package automatically. But like I said that part is optional, but recommended.

@heff
Video.js member

Oh man, sorry for the confusion. I didn't mean for you to actually update those versions. That's what the grunt script is used for. Now I actually need you to undo that last change and put the versions back to where they were...sorry.

Thanks for clearing up how composer versions work though. That's pretty nice that it can just read the tags. I'll register this will packagist after I pull this in.

@patforg

Here the changes were undone.

Let me know if I need to do anything else.

@heff heff closed this in 8a05aa1
@heff
Video.js member

done. Thanks!

@heff
Video.js member

And published to packagist. https://packagist.org/packages/videojs/video.js

Though it doesn't appear to be picking up the tagged versions? You'll have to try to install it and see if it uses the latest version tag or just master.

@patforg

Thank you @heff and @mmcc!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.