Skip to content

Commit

Permalink
Allow users to set the scm repo dir to be used to get the revision ve…
Browse files Browse the repository at this point in the history
…rsion
  • Loading branch information
gggeek committed May 20, 2016
1 parent 830913f commit 062d72c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 20 deletions.
9 changes: 8 additions & 1 deletion classes/ezsysinfoscmchecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ public static function getScmInfo()

protected static function getScmDir()
{
return is_dir('./.git') ? './.git' : (is_dir('../.git') && is_file('../ezpublish/EzPublishKernel.php') ? '../.git' : false);
$ini = eZINI::instance( 'sysinfo.ini' );
$dir = $ini->variable('SCMSettings', 'RepoDir');
if ($dir !== '')
{
return $dir;
}

return is_dir( './.git' ) ? './.git' : ( is_dir( '../.git' ) && is_file( '../ezpublish/EzPublishKernel.php' ) ? '../.git' : false );
}
}
2 changes: 1 addition & 1 deletion extension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<software>
<metadata>
<name>ggsysinfo</name>
<version>0.8.2</version>
<version>0.9.2</version>
<copyright>Copyright (C) 2008-2016 Gaetano Giunta</copyright>
<license>GNU General Public License v2.0</license>
</metadata>
Expand Down
2 changes: 1 addition & 1 deletion ezinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class ggsysinfoInfo
static function info()
{
return array( 'Name' => "<a href=\"http://projects.ez.no/ggsysinfo\">ggsysinfo</a>",
'Version' => "0.8.2",
'Version' => "0.9.2",
'Copyright' => "Copyright (C) 2008-2016 Gaetano Giunta",
'License' => "GNU General Public License v2.0"
);
Expand Down
16 changes: 0 additions & 16 deletions modules/sysinfo/sourcerevision.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
<?php

/*$revisionInfo = array();
$retcode = 0;
exec( "cd .. && git log -1", $revisionInfo, $retcode );
$statusInfo = array();
$retcode = 0;
exec( "cd .. && git status", $statusInfo, $retcode );
$tagInfo = array();
$retcode = 0;
exec( "cd .. && git describe", $tagInfo, $retcode );
$tpl->setVariable( 'revision_info', $revisionInfo );
$tpl->setVariable( 'status_info', $statusInfo );
$tpl->setVariable( 'tag_info', $tagInfo );*/

$tpl->setVariable( 'info', eZSysinfoSCMChecker::getScmInfo() );
5 changes: 4 additions & 1 deletion settings/sysinfo.ini
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,7 @@ TokenTTL=300
[SCMSettings]
#used in the tpl for SCM INFO
RepoLink=
RepoName=
RepoName=
# Set this to force the directory used to check source code version.
# Useful f.e. if there is a .git dir in the ezp_legacy directory
RepoDir=

0 comments on commit 062d72c

Please sign in to comment.