Skip to content

Commit d147c3b

Browse files
Template and Framework Versioning in template object
1 parent b4d274a commit d147c3b

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

astroid/astroid-framework/framework/helper.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,4 +899,12 @@ public static function getPropertySet($property)
899899
break;
900900
}
901901
}
902+
903+
public static function frameworkVersion()
904+
{
905+
$xml = JFactory::getXML(JPATH_ADMINISTRATOR . '/manifests/libraries/astroid.xml');
906+
$version = (string) $xml->version;
907+
return $version;
908+
}
909+
902910
}

astroid/astroid-framework/framework/template.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ class AstroidFrameworkTemplate
1717
public $params;
1818
public $language;
1919
public $title = "";
20+
public $version = "";
21+
public $astroidVersion = "";
2022
public $direction;
2123
protected $logs;
2224
protected $debug = false;
@@ -44,8 +46,18 @@ public function __construct($template)
4446
$language = JFactory::getApplication()->getLanguage();
4547
$this->language = $language->getTag();
4648
$this->direction = $language->isRtl() ? 'rtl' : 'ltr';
49+
$this->version = $this->templateVersion();
50+
$this->astroidVersion = AstroidFrameworkHelper::frameworkVersion();
4751
$this->initAgent();
4852
$this->addMeta();
53+
$this->inspect();
54+
}
55+
56+
public function templateVersion()
57+
{
58+
$xml = JFactory::getXML(JPATH_SITE . "/templates/{$this->template}/templateDetails.xml");
59+
$version = (string) $xml->version;
60+
return $version;
4961
}
5062

5163
public function addMeta()
@@ -1042,6 +1054,12 @@ public function getPresets()
10421054
}
10431055
return $presets;
10441056
}
1057+
1058+
public function inspect()
1059+
{
1060+
// $this->version;
1061+
// $this->astroidVersion;
1062+
}
10451063
}
10461064

10471065
class AstroidLog

0 commit comments

Comments
 (0)