Skip to content

Commit

Permalink
[K6.0] Kunena version displayed as GIT in cpanel on stable release (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
xillibit authored Jul 9, 2022
1 parent 842ede6 commit cb1d48e
Showing 1 changed file with 14 additions and 22 deletions.
36 changes: 14 additions & 22 deletions src/libraries/kunena/src/Forum/KunenaForum.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,32 +346,24 @@ public static function version()
*/
protected static function buildVersion(): void
{
if ('@kunenaversion@' == '@' . 'kunenaversion' . '@')
$file = JPATH_MANIFESTS . '/packages/pkg_kunena.xml';

if (file_exists($file))
{
$file = JPATH_MANIFESTS . '/packages/pkg_kunena.xml';

if (file_exists($file))
{
$manifest = simplexml_load_file($file);
self::$version = (string) $manifest->version . '-GIT';
self::$version_date = (string) $manifest->creationDate;
}
else
{
$db = Factory::getContainer()->get('DatabaseDriver');
$query = $db->getQuery(true);
$query->select('version')->from('#__kunena_version')->order('id');
$query->setLimit(1);
$db->setQuery($query);

self::$version = $db->loadResult();
self::$version_date = Factory::getDate()->format('Y-m-d');
}
$manifest = simplexml_load_file($file);
self::$version = (string) $manifest->version;
self::$version_date = (string) $manifest->creationDate;
}
else
{
self::$version = strtoupper('@kunenaversion@');
self::$version_date = strtoupper('@kunenaversiondate@');
$db = Factory::getContainer()->get('DatabaseDriver');
$query = $db->getQuery(true);
$query->select('version')->from('#__kunena_version')->order('id');
$query->setLimit(1);
$db->setQuery($query);

self::$version = $db->loadResult();
self::$version_date = Factory::getDate()->format('Y-m-d');
}

self::$version_major = substr(self::$version, 0, 3);
Expand Down

0 comments on commit cb1d48e

Please sign in to comment.