Manage version bump in your Zend Framework Application
php index.php version-showReturn current version
php index.php version-bump 0.0.1Bump version 0.0.1
- Write or edit VERSION file
- Add version node in your global.php configuration file
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><?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
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);