ILIAS  release_8 Revision v8.23
ilNoMajorVersionSkippedConditionObjective Class Reference
+ Inheritance diagram for ilNoMajorVersionSkippedConditionObjective:
+ Collaboration diagram for ilNoMajorVersionSkippedConditionObjective:

Public Member Functions

 __construct (Data\Factory $data_factory)
 
 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Setup\Environment $environment)
 
 achieve (Setup\Environment $environment)
 
 isApplicable (Setup\Environment $environment)
 

Protected Attributes

Data Factory $data_factory
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilNoMajorVersionSkippedConditionObjective::__construct ( Data\Factory  $data_factory)

Member Function Documentation

◆ achieve()

ilNoMajorVersionSkippedConditionObjective::achieve ( Setup\Environment  $environment)

Definition at line 58 of file class.ilNoMajorVersionSkippedConditionObjective.php.

References $factory, ILIAS\LTI\ToolProvider\$settings, ilVersionWrittenToSettingsObjective\ILIAS_VERSION_KEY, and ILIAS_VERSION_NUMERIC.

58  : Setup\Environment
59  {
60  $factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
61  $settings = $factory->settingsFor("common");
62 
63  // TODO ILIAS 9: This special case can vanish with ILIAS 9. It exists to make sure that
64  // installations on version 7.0 or greater can update to ILIAS 8. This is checked by
65  // looking into the version string (which is only updated starting with 8 and had a
66  // very old value previously) and the db_version (which is 5751 with ILIAS 7.0).
68  if ($current_version_string === "3.2.3 2004-11-22" && (int) $settings->get("db_version") >= 5751) {
69  return $environment;
70  }
71 
72  $current_version = $this->data_factory->version($current_version_string);
73  $target_version = $this->data_factory->version(ILIAS_VERSION_NUMERIC);
74 
75  if (($target_version->getMajor() - $current_version->getMajor()) > 1) {
76  throw new Setup\NotExecutableException(
77  "Updates may only be performed from one major version to the " .
78  "next, no major versions may be skipped."
79  );
80  }
81 
82  return $environment;
83  }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
const ILIAS_VERSION_NUMERIC
$factory
Definition: metadata.php:75

◆ getHash()

ilNoMajorVersionSkippedConditionObjective::getHash ( )

Definition at line 33 of file class.ilNoMajorVersionSkippedConditionObjective.php.

33  : string
34  {
35  return hash(
36  "sha256",
37  get_class($this)
38  );
39  }

◆ getLabel()

ilNoMajorVersionSkippedConditionObjective::getLabel ( )

Definition at line 41 of file class.ilNoMajorVersionSkippedConditionObjective.php.

41  : string
42  {
43  return "No major version is skipped in update.";
44  }

◆ getPreconditions()

ilNoMajorVersionSkippedConditionObjective::getPreconditions ( Setup\Environment  $environment)

◆ isApplicable()

ilNoMajorVersionSkippedConditionObjective::isApplicable ( Setup\Environment  $environment)

Definition at line 85 of file class.ilNoMajorVersionSkippedConditionObjective.php.

85  : bool
86  {
87  return true;
88  }

◆ isNotable()

ilNoMajorVersionSkippedConditionObjective::isNotable ( )

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

46  : bool
47  {
48  return true;
49  }

Field Documentation

◆ $data_factory

Data Factory ilNoMajorVersionSkippedConditionObjective::$data_factory
protected

Definition at line 26 of file class.ilNoMajorVersionSkippedConditionObjective.php.

Referenced by __construct().


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