Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
16bd1c06
Commit
16bd1c06
authored
Aug 30, 2018
by
Christian Giupponi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
By default add the 1.0.0 version to all modules generated with asgard:module:scaffold
parent
09fcd83c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
ModuleScaffold.php
Modules/Workshop/Scaffold/Module/ModuleScaffold.php
+12
-1
No files found.
Modules/Workshop/Scaffold/Module/ModuleScaffold.php
View file @
16bd1c06
...
...
@@ -227,6 +227,7 @@ class ModuleScaffold
$moduleJson
=
$this
->
loadProviders
(
$moduleJson
);
$moduleJson
=
$this
->
setModuleOrderOrder
(
$moduleJson
);
$moduleJson
=
$this
->
setModuleVersion
(
$moduleJson
);
$moduleJson
=
$this
->
removeStartPhpFile
(
$moduleJson
);
$this
->
finder
->
put
(
$this
->
getModulesPath
(
'module.json'
),
$moduleJson
);
...
...
@@ -259,6 +260,16 @@ JSON;
return
str_replace
(
'"order": 0,'
,
'"order": 1,'
,
$content
);
}
/**
* Set the module version to 1.0.0 by default
* @param string $content
* @return string
*/
private
function
setModuleVersion
(
$content
)
{
return
str_replace
(
"
\"
active
\"
"
,
"
\"
version
\"
:
\"
1.0.0
\"
,
\n\t\"
active
\"
"
,
$content
);
}
/**
* Remove the start.php start file
* Also removes the auto loading of that file
...
...
@@ -301,7 +312,7 @@ JSON;
$replace
=
<<<JSON
"description": "",
"type": "asgard-module",
"license": "MIT",
"license": "MIT",
"require": {
"php": ">=7.0.0",
"composer/installers": "~1.0",
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment