Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/ArcanistXMLLinter.php
Show All 21 Lines | public function getLinterConfigurationName() { | ||||
return 'xml'; | return 'xml'; | ||||
} | } | ||||
public function canRun() { | public function canRun() { | ||||
return extension_loaded('libxml') && extension_loaded('simplexml'); | return extension_loaded('libxml') && extension_loaded('simplexml'); | ||||
} | } | ||||
public function getCacheVersion() { | public function getCacheVersion() { | ||||
if (defined('LIBXML_VERSION')) { | |||||
return LIBXML_VERSION; | return LIBXML_VERSION; | ||||
} else { | |||||
return 'unavailable'; | |||||
} | |||||
} | } | ||||
public function lintPath($path) { | public function lintPath($path) { | ||||
libxml_use_internal_errors(true); | libxml_use_internal_errors(true); | ||||
libxml_clear_errors(); | libxml_clear_errors(); | ||||
if (simplexml_load_string($this->getData($path))) { | if (simplexml_load_string($this->getData($path))) { | ||||
// XML appears to be valid. | // XML appears to be valid. | ||||
Show All 36 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0