Skip to content

Instantly share code, notes, and snippets.

@gartes
Created July 31, 2020 18:54
Show Gist options
  • Save gartes/518bc2bc3e52c8991a685fecb2e45fb4 to your computer and use it in GitHub Desktop.
Save gartes/518bc2bc3e52c8991a685fecb2e45fb4 to your computer and use it in GitHub Desktop.
Получить версию плагина из файла манифеста
/**
* Получить версию плагина из XML файла
*
* @since version
*/
private function _getPluginVersion(){
$file = \Joomla\CMS\Filesystem\File::stripExt( basename(__FILE__) );
$xml_file = __DIR__ .'/'.$file.'.xml';
$dom = new DOMDocument("1.0", "utf-8");
$dom->load($xml_file);
$version = $dom->getElementsByTagName('version')->item(0)->textContent;
$this->version = $version ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment