Skip to content

Commit

Permalink
Read core module version from the AsgardCms class other modules keep …
Browse files Browse the repository at this point in the history
…same logic.

This allows to change the version at one place only for all core modules.
  • Loading branch information
nWidart committed Aug 1, 2017
1 parent 00dc040 commit 8f13ea3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
</td>
<td>
<a href="{{ route('admin.workshop.modules.show', [$module->getLowerName()]) }}">
{{ str_replace('v', '', $module->version) }}
{{ module_version($module) }}
</a>
</td>
<td>
Expand Down
3 changes: 3 additions & 0 deletions Modules/Workshop/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
url: https://github.com/AsgardCms/Platform
versions:
"2.x.x@unreleased":
changed:
- Read core module version from the AsgardCms class other modules keep same logic (<code>version</code> key in <code>module.json</code>)
"2.5.0":
added:
- Module scaffold command now also generates form requests
Expand Down
11 changes: 11 additions & 0 deletions Modules/Workshop/helpers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

if (! function_exists('module_version')) {
function module_version($module)
{
if (is_core_module($module->name) === true) {
return \Modules\Core\AsgardCms::VERSION;
}
return $module->version;
}
}
3 changes: 2 additions & 1 deletion Modules/Workshop/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"Modules\\Workshop\\Providers\\WorkshopServiceProvider"
],
"files": [
"composers.php"
"composers.php",
"helpers.php"
]
}

0 comments on commit 8f13ea3

Please sign in to comment.