31
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2024-05-31 20:50:48 +00:00

rule to found missed method="upgrade"

This commit is contained in:
Denis Ryabov 2021-04-04 14:24:10 +03:00
parent 3961bbf319
commit a426ccfd0e
2 changed files with 7 additions and 0 deletions

View File

@ -89,3 +89,4 @@ COM_JEDCHECKER_MANIFEST_MULTIPLE_FOUND="Node <%1$s> contains multiple <
COM_JEDCHECKER_MANIFEST_UNKNOWN_CHILD="Node <%1$s> contains unknown <%2$s> element"
COM_JEDCHECKER_MANIFEST_EMPTY_CHILD="Found empty <%s> element"
COM_JEDCHECKER_MANIFEST_MENU_UNUSED_ATTRIBUTE="Menu item attribute '%s' is not used with 'link' attribute"
COM_JEDCHECKER_MANIFEST_MISSED_METHOD_UPGRADE="Without the method="upgrade" attribute the extension package cannot be upgraded"

View File

@ -167,6 +167,12 @@ class JedcheckerRulesXMLManifest extends JEDcheckerRule
return true;
}
// warn if method="upgrade" attribute is not found
if ((string) $xml['method'] !== 'upgrade')
{
$this->report->addWarning($file, JText::_('COM_JEDCHECKER_MANIFEST_MISSED_METHOD_UPGRADE'));
}
$data = json_decode(file_get_contents($json_filename), true);
$this->DTDNodeRules = $data['nodes'];
$this->DTDAttrRules = $data['attributes'];