2017 © Pedro Peláez
 

library composer-bump

Laravel artisan command to increment composer.json version.

image

talevskiigor/composer-bump

Laravel artisan command to increment composer.json version.

  • Thursday, March 3, 2016
  • by a87c81
  • Repository
  • 2 Watchers
  • 15 Stars
  • 7,156 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 9 % Grown

The README.md

Build Status Total Downloads Latest Stable Version Latest Unstable Version License, (*1)

Description

Laravel Bump is a package that allows you to easy change your version of your application or package in composer.json file through an Artisan command., (*2)

Pretend you have an application or package that you would like to ensure has the right version information in composer.json, you can run php artisan bump to get automatically increase version information., (*3)

Example output

unknown@Dell-Studio-1747:~/Code/ComposerBump$ php artisan bump
Bump from: 0.0.1 to 0.0.2
unknown@Dell-Studio-1747:~/Code/ComposerBump$

Also has nice Facade to be used in about page or similar where you need to show your application or package version to the customer., (*4)

For more information about versioning please visit http://semver.org/, (*5)

Given a version number MAJOR.MINOR.PATCH, increment the:, (*6)

  • MAJOR version when you make incompatible API changes,
  • MINOR version when you add functionality in a backwards-compatible manner, and
  • PATCH version when you make backwards-compatible bug fixes.

Usage

List of all commands:

php artisan bump:patch Increments PATCH version (major.minor.PATCH => verison 0.0.1), (*7)

Example output: Bump from: 0.0.1 to 0.0.2, (*8)

php artisan bump:minor Bump MINOR version (major.MINOR.patch => verison 0.1.0), (*9)

Example output: Bump from: 0.0.2 to 0.1.0, (*10)

php artisan bump:major Bump MAJOR version (MAJOR.minor.patch => verison 1.0.0), (*11)

Example output: Bump from: 0.1.0 to 1.0.0, (*12)

Using Facade support:

In your controller you can easy get and return version of your application or package, (*13)

`return ComposerBump::getVersion();`

Install

Step 1: Install through Composer

composer require talevskiigor/composer-bump

Step 2: Update config/app.php and insert the folowing line in Service Provider

Talevskiigor\ComposerBump\ComposerBumpServiceProvider::class,

Step 3 (optional): Add Facade support

'ComposerBump'=>Talevskiigor\ComposerBump\Facades\ComposerBump::class,

If you want to use this package for only local development, you don't need to update config/app.php. Instead, you can update provider app/Providers/AppServiceProvider.php, for example:, (*14)

public function register()
{
    if ($this->app->environment() == 'local') {
        $this->app->register('Talevskiigor\ComposerBump\ComposerBumpServiceProvider');
    }
}

Step 4: Run the new Artisan Commands

`php artisan bump` - this is alias of `bump:patch`

Nice to know

Package will make backup copy of you composer.json file on each use, so you can easy do undo on changes, simple use undo command as:, (*15)

`php artisan bump:undo`

Example output:, (*16)

!!! WARNING !!!!!! WARNING !!!!!! WARNING !!!
    This will replace content of: composer.json file with content from file: composer.json-backup   !!!

 Are you suere? [y|N] (yes/no) [no]:
 > yes

Restored file: composer.json-backup into file: composer.json

unknown@Dell-Studio-1747:~/Code/ComposerBump$

Contributing

Add unit tests for any new or changed functionality. Lint and test your code using PHPUnit., (*17)

  1. Fork it
  2. Switch to develop branch (git checkout develop)
  3. Create your feature branch (git checkout -b my-new-feature)
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request
  7. Thank You

License

Copyright (c) MIT license., (*18)

The Versions

03/03 2016

dev-master

9999999-dev

Laravel artisan command to increment composer.json version.

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

The Development Requires

by Igor T.

laravel composer artisan bump

03/03 2016

dev-develop

dev-develop

Laravel artisan command to increment composer.json version.

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

The Development Requires

by Igor T.

laravel composer artisan bump

03/03 2016

1.0.8

1.0.8.0

Laravel artisan command to increment composer.json version.

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

The Development Requires

by Igor T.

laravel composer artisan bump