Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finding the installed version #280

Closed
fpiraneo opened this issue Nov 4, 2016 · 8 comments
Closed

Finding the installed version #280

fpiraneo opened this issue Nov 4, 2016 · 8 comments

Comments

@fpiraneo
Copy link

fpiraneo commented Nov 4, 2016

Where on the git repo and on the src/ folder I can argue the actual version of the library?

@moderndeveloperllc
Copy link

moderndeveloperllc commented Nov 4, 2016

That really depends on how you are installing the library. If you are using composer, your composer.lock file will show you, and your project's composer.json can limit it to what you want..

If you are manually downloading, you can choose one of the tagged versions here on GitHub by going to the Code tab, click the Branch: button, and select a Tagged version you would like to download. If you are downloading the master branch, then it doesn't really have a "version" as it's still in development.

The composer.json file does have a branch-alias describing the master branch as 1.1.x-dev, so that's the closest the master branch has to a "version" per se.

@jmikola
Copy link
Member

jmikola commented Jan 18, 2017

@fpiraneo: Was @moderndeveloperllc's response sufficent? If you are not using are tagged release, the version would be inferred from branch-alias. That only denotes the alias of the master branch, as other branches can be inferred from there name. For instance, v1.0 would be "1.0.x-dev".

@derickr did create PHPLIB-131 a while back to add a VERSION constant to the library, but I'm not sure it's necessary and would only add an extra step to the release process.

@moderndeveloperllc
Copy link

@jmikola I agree that a constant is a solution in need of a problem. Unlike a driver that could be variable depending on environment (like the PHP version), the library is always the version you want it to be for any deployment. Therefore no good reason I can think of to have version-checking code, so no need for a constant.

@fpiraneo
Copy link
Author

Sorry for late answer.
@jmikola the issue is that you really don't know which version of the library you have in use if you take the development of the code back in hand after some time; yes, I can create the "version" constant by myself... but why don't incorporate such constant directly on code and directly controlled by the library developers?

@alcaeus
Copy link
Member

alcaeus commented Jan 23, 2017

@fpiraneo isn't that a dependency management problem? If your project is managed by composer, you'll see the installed version by running composer show mongodb/mongodb. If you're using something else to track dependencies, it's their job to track your installed verions.

@fpiraneo
Copy link
Author

@alcaeus I don't use composer.

@lindelius
Copy link

lindelius commented Jan 23, 2017

In my opinion it's up to the project developers to manage the libraries and which versions are in use. If you don't use composer you'll have to do it in whichever way suits you, and not rely on the libraries providing this information as a constant or a function. I have no idea how you manage your external libraries today, but if I were to do it without composer I'd make sure to manually note it in my "include" or "autoload" file and then make sure to update it when updating the libraries. It's unrealistic to expect all libraries to provide this information in a way that it can be generalized and accessed the same way.

I do think, however, that it'd be good to have a @version in the documentation for each class reflecting the version it was last changed for.

@jmikola
Copy link
Member

jmikola commented Feb 27, 2018

Closing this due to inactivity. We ultimately decided not to introduce a version constant in PHPLIB-131.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants