Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
f8e020ff
Commit
f8e020ff
authored
Nov 10, 2015
by
Thomas Müller
Browse files
Merge pull request #20390 from owncloud/appcheckcode-no-duplicate-requirement
Do not allow two different version requirements
parents
a8ea3aca
fe04451c
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/command/app/checkcode.php
View file @
f8e020ff
...
...
@@ -131,6 +131,10 @@ class CheckCode extends Command {
}
});
$infoChecker
->
listen
(
'InfoChecker'
,
'duplicateRequirement'
,
function
(
$minMax
)
use
(
$output
)
{
$output
->
writeln
(
"<error>Duplicate
$minMax
ownCloud version requirement found</error>"
);
});
$infoChecker
->
listen
(
'InfoChecker'
,
'differentVersions'
,
function
(
$versionFile
,
$infoXML
)
use
(
$output
)
{
$output
->
writeln
(
"<error>Different versions provided (appinfo/version:
$versionFile
- appinfo/info.xml:
$infoXML
)</error>"
);
});
...
...
lib/private/app/codechecker/infochecker.php
View file @
f8e020ff
...
...
@@ -77,6 +77,21 @@ class InfoChecker extends BasicEmitter {
$info
=
$this
->
infoParser
->
parse
(
$appPath
.
'/appinfo/info.xml'
);
if
(
isset
(
$info
[
'dependencies'
][
'owncloud'
][
'@attributes'
][
'min-version'
])
&&
(
$info
[
'requiremin'
]
||
$info
[
'require'
]))
{
$this
->
emit
(
'InfoChecker'
,
'duplicateRequirement'
,
[
'min'
]);
$errors
[]
=
[
'type'
=>
'duplicateRequirement'
,
'field'
=>
'min'
,
];
}
if
(
isset
(
$info
[
'dependencies'
][
'owncloud'
][
'@attributes'
][
'max-version'
])
&&
$info
[
'requiremax'
])
{
$this
->
emit
(
'InfoChecker'
,
'duplicateRequirement'
,
[
'max'
]);
$errors
[]
=
[
'type'
=>
'duplicateRequirement'
,
'field'
=>
'max'
,
];
}
foreach
(
$info
as
$key
=>
$value
)
{
if
(
is_array
(
$value
))
{
$value
=
json_encode
(
$value
);
...
...
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