-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable by default the scm-info panel if git info is found
- Loading branch information
gggeek
committed
Feb 16, 2016
1 parent
1a85955
commit 0d3d754
Showing
12 changed files
with
91 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
class eZSysinfoSCMChecker implements ezSysinfoReport | ||
{ | ||
public function getReport() | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* @return array: | ||
* - 'tag' | ||
* - 'title' | ||
* - 'executingString' | ||
* - 'format' byrow, byline or html for now | ||
*/ | ||
public function getDescription() | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* @todo add check that 'git' is executable | ||
* @return bool | ||
*/ | ||
public static function hasScmInfo() | ||
{ | ||
return self::getScmDir() != false ? true : false; | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public static function getScmInfo() | ||
{ | ||
$dir = self::getScmDir(); | ||
if (!$dir) { | ||
return array(); | ||
} | ||
|
||
$revisionInfo = array(); | ||
exec( "cd $dir && git log -1", $revisionInfo, $retcode ); | ||
|
||
|
||
$statusInfo = array(); | ||
exec( "cd $dir && git status", $statusInfo, $retcode ); | ||
|
||
$tagInfo = array(); | ||
exec( "cd $dir && git describe", $tagInfo, $retcode ); | ||
|
||
return array( | ||
'revision_info' => $revisionInfo, | ||
'status_info' => $statusInfo, | ||
'tag_info' => $tagInfo | ||
); | ||
} | ||
|
||
protected static function getScmDir() | ||
{ | ||
return is_dir('./.git') ? './.git' : (is_dir('../.git') && is_file('../ezpublish/EzPublishKernel.php') ? '../.git' : false); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -364,4 +364,3 @@ protected static function parseIniFile( $filename, &$warnings, $isphp=false ) | |
} | ||
|
||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,4 +148,3 @@ protected static function parsePhpFile( $filename, &$warnings, $checksyntax=true | |
} | ||
|
||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -345,4 +345,3 @@ public static function eZTemplateFactory() | |
|
||
static $ezpClasses = false; | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,5 +76,3 @@ static function checkSetupRequirements() | |
} | ||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,4 +112,3 @@ protected static function parseTplFile( $filename, &$warnings ) | |
} | ||
|
||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters