Skip to content
This repository was archived by the owner on Jun 22, 2021. It is now read-only.

gianarb/corley-version-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Manage version bump in your Zend Framework Application

  • Master Travis-CI: Build Status

Console Command

php index.php version-show

Return current version

php index.php version-bump 0.0.1

Bump version 0.0.1

  • Write or edit VERSION file
  • Add version node in your global.php configuration file

View Helper

You can use $this->version() to append the version number in your static resources

<html>
    ...    
    <?php echo $this->headScript()
        ->prependFile($this->basePath("/js/script.js?v={$this->vesion()}"))
        ->prependFile($this->basePath('/js/bootstrap.min.js'))
        ->prependFile($this->basePath('/js/jquery.min.js'))
    ; ?>
    ...
</html>

Configuration

<?php
return array(
    'corley-version' => array(
        'version-file-path' => ".",
        'config-path' => "./config/autoload/global.php",
    )
);

version-file-path is path of VERSION file

Write 'version' node into config-path

Event Driven

version-bump <version> trigger version.bump event. This module attach only one listener

/** @var \Zend\EventManager\EventManager $em */
$em->getSharedManager()->attach('version' ,'version.bump', function($e){
    $e->getTarget()->bump($e->getParams()['version']);
}, 100);

About

Zend Framework 2 Bump Version Module

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages