ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilExportMetadataGatheredObjective Class Reference
+ Inheritance diagram for ilExportMetadataGatheredObjective:
+ Collaboration diagram for ilExportMetadataGatheredObjective:

Public Member Functions

 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Setup\Environment $environment)
 
 achieve (Setup\Environment $environment)
 
 isApplicable (Setup\Environment $environment)
 @inheritDoc More...
 

Data Fields

const EXPORT_META = "export_meta"
 

Protected Member Functions

 getCurrentGitCommitHash ()
 

Detailed Description

Definition at line 23 of file class.ilExportMetadataGatheredObjective.php.

Member Function Documentation

◆ achieve()

ilExportMetadataGatheredObjective::achieve ( Setup\Environment  $environment)

Definition at line 63 of file class.ilExportMetadataGatheredObjective.php.

63 : Setup\Environment
64 {
65 $meta = [
66 "user_name=" . posix_getpwuid(posix_geteuid())['name'],
67 "created=" . date('Y-m-d H:i:s'),
68 "commit=" . $this->getCurrentGitCommitHash(),
69 "host=" . gethostname()
70 ];
71
72 return $environment->withConfigFor(self::EXPORT_META, $meta);
73 }

References getCurrentGitCommitHash(), and ILIAS\Setup\Environment\withConfigFor().

+ Here is the call graph for this function:

◆ getCurrentGitCommitHash()

ilExportMetadataGatheredObjective::getCurrentGitCommitHash ( )
protected

Definition at line 83 of file class.ilExportMetadataGatheredObjective.php.

83 : string
84 {
85 $path = realpath('.git') . DIRECTORY_SEPARATOR;
86
87 if (!$path) {
88 return "";
89 }
90
91 $head = trim(substr(file_get_contents($path . 'HEAD'), 4));
92 $hash = trim(file_get_contents($path . $head));
93
94 return $hash;
95 }
$path
Definition: ltiservices.php:30

References $path.

Referenced by achieve().

+ Here is the caller graph for this function:

◆ getHash()

ilExportMetadataGatheredObjective::getHash ( )

Definition at line 30 of file class.ilExportMetadataGatheredObjective.php.

30 : string
31 {
32 return hash("sha256", self::class);
33 }

◆ getLabel()

ilExportMetadataGatheredObjective::getLabel ( )

Definition at line 38 of file class.ilExportMetadataGatheredObjective.php.

38 : string
39 {
40 return "Gathering export metadata";
41 }

◆ getPreconditions()

ilExportMetadataGatheredObjective::getPreconditions ( Setup\Environment  $environment)

Definition at line 54 of file class.ilExportMetadataGatheredObjective.php.

54 : array
55 {
56 return [
57 ];
58 }

◆ isApplicable()

ilExportMetadataGatheredObjective::isApplicable ( Setup\Environment  $environment)

@inheritDoc

Definition at line 78 of file class.ilExportMetadataGatheredObjective.php.

78 : bool
79 {
80 return true;
81 }

◆ isNotable()

ilExportMetadataGatheredObjective::isNotable ( )

Definition at line 46 of file class.ilExportMetadataGatheredObjective.php.

46 : bool
47 {
48 return true;
49 }

Field Documentation

◆ EXPORT_META

const ilExportMetadataGatheredObjective::EXPORT_META = "export_meta"

The documentation for this class was generated from the following file: