Download the PHP package ninthday/version without Composer

On this page you can find all versions of the php package ninthday/version. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package version

Version

Take control over your Laravel app version

Latest Stable Version Code Quality Build

Coverage StyleCI Downloads

Description

This package is a Laravel (5.5+) utility which helps you keep and manage your application version, increment version numbers (major, minor, patch, commit), and can also use your last commit hash.

The end results of this package are:

Full SemVer compatibility

This package is able to parse a SemVer version:

And translate it to be used as:

You can use the format function to rewrite and show it in your app, for instance, as:

Some use cases for those results could be:

Features

Easily control you app version using a YAML config file

Use your git commit as your app commit hash/number

Configure it

And you may have an output like this

Or just use an incremental commit hash/number:

To get

Easily increment your version numbers, using Artisan commands

Which should print the new version number

Available for all of them:

The output format is highly configurable

You can configure the :

Those are the results for full and compact formats

It gives you access to dynamic methods:

And should you create a new one:

It will also become callable:

A Facade is available

Instantiating it

If you prefer not to use the Façade:

The best ways to instantiate it are:

A simple PHP object instantiation:

Or to get an already instantiated Version object from the container:

But you have to make sure you published the config file

A Blade directive is also ready to be used in your views

You can use this directive to render a full version format:

Or choose the format:

You can configure the directive name:

Then

Git tags

You can use your git tags as application versions, all you need is to set the version source to "git":

And if you add a commit hash/number to your tags:

Version will use it as your app commit hash/number

Matching other version (git tags) formats

You probably only need to change the git version matcher

So let's say you tag your releases as

You can change your matcher to

And remove dots from your formats:

Using the current application version in your code

Here's a community example on how to send the app version number when logging an exception to Bugsnag:

Commit Timestamp

This package also lets you absorb the last commit timestamp or store the current date to the version.yml file. This is the format in the config file:

To absorb you only need to configure mode: absorb then execute:

php artisan version:absorb

But you can also set mode: increment then execute:

To store the current date and time to the config file:

And you can then use it to show in your app:

Artisan commands

Those are the commands you have at your disposal:

version:show

Show the current app version:

version:absorb

You need to set mode: absorb.

Version can absorb git version and commit to the config file, so you can delete the .git folder and still keep your version and commit for fast access. You have to configure git_absorb in your config file:

And run it

The usual configuration setup to implement absorb is:

version:(major|minor|patch|commit)

You need to set mode: increment.

Increment the version item:

Regex Matcher

This is the current regex used to break a version string:

`

You can test it online: https://regex101.com/r/Ly7O1x/42

Install

Via Composer

Then publish the configuration file you'll have to:

And you should be good to use it in your views:

As git versions are cached, you can tell composer to refresh your version numbers every time an update or install occur, by adding the refresh command to post-autoload-dump:

[Optional] You may also can automated this process by set inside your .git/hooks/post-commit. It will automatic run the command once you have make a commit.

If you are using Git commits on your commit numbers, you may have to add the git repository to your .env file

If you are using git-local make sure the current folder is a git repository

Minimum requirements

Testing

Troubleshooting

Author

Antonio Carlos Ribeiro

License

This package is licensed under the MIT License - see the LICENSE file for details

Contributing

Pull requests and issues are welcome.


All versions of version with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
laravel/framework Version >=5.5.33
ninthday/yaml Version ^1.0
symfony/process Version ^3.3|^4.0|^5.0|^6.0|^7.0
illuminate/support Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ninthday/version contains the following files

Loading the files please wait ....