ILIAS  release_7 Revision v7.30-3-g800a261c036
ilCtrlStructureStoredObjective Class Reference
+ Inheritance diagram for ilCtrlStructureStoredObjective:
+ Collaboration diagram for ilCtrlStructureStoredObjective:

Public Member Functions

 __construct (\ilCtrlStructureReader $ctrl_reader, bool $populate_before=true)
 
 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Setup\Environment $environment)
 
 achieve (Setup\Environment $environment)
 
 isApplicable (Setup\Environment $environment)
 

Data Fields

const TABLE_CLASSFILES = "ctrl_classfile"
 
const TABLE_CALLS = "ctrl_calls"
 

Protected Attributes

 $ctrl_reader
 
 $populate_before
 

Detailed Description

Definition at line 6 of file class.ilCtrlStructureStoredObjective.php.

Constructor & Destructor Documentation

◆ __construct()

ilCtrlStructureStoredObjective::__construct ( \ilCtrlStructureReader  $ctrl_reader,
bool  $populate_before = true 
)

Member Function Documentation

◆ achieve()

ilCtrlStructureStoredObjective::achieve ( Setup\Environment  $environment)

Definition at line 64 of file class.ilCtrlStructureStoredObjective.php.

References $DIC, $GLOBALS, and ILIAS\Setup\Environment\getResource().

64  : Setup\Environment
65  {
66  $db = $environment->getResource(Setup\Environment::RESOURCE_DATABASE);
67  if (!$db) {
68  throw new Setup\UnachievableException("Need DB to store control-structure");
69  }
70 
71  if (!defined("ILIAS_ABSOLUTE_PATH")) {
72  define("ILIAS_ABSOLUTE_PATH", dirname(__FILE__, 5));
73  }
74 
75  // ATTENTION: This is a total abomination. It only exists to allow various
76  // sub components of the various readers to run. This is a memento to the
77  // fact, that dependency injection is something we want. Currently, every
78  // component could just service locate the whole world via the global $DIC.
79  $DIC = $GLOBALS["DIC"];
80  $GLOBALS["DIC"] = new DI\Container();
81  $GLOBALS["DIC"]["ilDB"] = $db;
82 
83  $reader = $this->ctrl_reader->withDB($db);
84  $reader->executed = false;
85  $reader->readStructure(true);
86 
87  $GLOBALS["DIC"] = $DIC;
88 
89  return $environment;
90  }
global $DIC
Definition: goto.php:24
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
+ Here is the call graph for this function:

◆ getHash()

ilCtrlStructureStoredObjective::getHash ( )

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

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

◆ getLabel()

ilCtrlStructureStoredObjective::getLabel ( )

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

38  : string
39  {
40  return "ilCtrl-structure is read and stored.";
41  }

◆ getPreconditions()

ilCtrlStructureStoredObjective::getPreconditions ( Setup\Environment  $environment)

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

54  : array
55  {
56  return [
57  new \ilDatabaseInitializedObjective()
58  ];
59  }

◆ isApplicable()

ilCtrlStructureStoredObjective::isApplicable ( Setup\Environment  $environment)

Definition at line 95 of file class.ilCtrlStructureStoredObjective.php.

95  : bool
96  {
97  $db = $environment->getResource(Setup\Environment::RESOURCE_DATABASE);
98  if (!$db) {
99  throw new Setup\UnachievableException("Need DB to read control-structure");
100  }
101 
102  if (!defined("ILIAS_ABSOLUTE_PATH")) {
103  define("ILIAS_ABSOLUTE_PATH", dirname(__FILE__, 5));
104  }
105 
106  $reader = $this->ctrl_reader->withDB($db);
107 
108  return !$reader->executed;
109  }

◆ isNotable()

ilCtrlStructureStoredObjective::isNotable ( )

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

46  : bool
47  {
48  return true;
49  }

Field Documentation

◆ $ctrl_reader

ilCtrlStructureStoredObjective::$ctrl_reader
protected

Definition at line 14 of file class.ilCtrlStructureStoredObjective.php.

Referenced by __construct().

◆ $populate_before

ilCtrlStructureStoredObjective::$populate_before
protected

Definition at line 19 of file class.ilCtrlStructureStoredObjective.php.

Referenced by __construct().

◆ TABLE_CALLS

const ilCtrlStructureStoredObjective::TABLE_CALLS = "ctrl_calls"

Definition at line 9 of file class.ilCtrlStructureStoredObjective.php.

◆ TABLE_CLASSFILES

const ilCtrlStructureStoredObjective::TABLE_CLASSFILES = "ctrl_classfile"

Definition at line 8 of file class.ilCtrlStructureStoredObjective.php.


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