ILIAS  release_8 Revision v8.24
ilDatabaseResetStepsObjective Class Reference
+ Inheritance diagram for ilDatabaseResetStepsObjective:
+ Collaboration diagram for ilDatabaseResetStepsObjective:

Public Member Functions

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

Detailed Description

Definition at line 24 of file class.ilDatabaseResetStepsObjective.php.

Constructor & Destructor Documentation

◆ __construct()

ilDatabaseResetStepsObjective::__construct ( )

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

27 {
29 "This will reset failing steps in the setup progress. However -\n" .
30 "those steps failed for a reason!\n" .
31 "A step may fail due to a programming error, or, more likely, to some\n" .
32 "circumstances in your environment, e.g. inconsistent data in the DB,\n" .
33 "missing or unexpected files, etc.. Please double-check for the cause\n" .
34 "and only continue if you are certain about and fine with the consequences.\n" .
35 "Continue?"
36 );
37 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ achieve()

ilDatabaseResetStepsObjective::achieve ( Setup\Environment  $environment)

Definition at line 67 of file class.ilDatabaseResetStepsObjective.php.

67 : Setup\Environment
68 {
69 $environment = parent::achieve($environment);
70 $db = $environment->getResource(Setup\Environment::RESOURCE_DATABASE);
71 $db->manipulate('DELETE FROM il_db_steps WHERE finished IS NULL');
72 return $environment;
73 }

◆ getHash()

ilDatabaseResetStepsObjective::getHash ( )

Definition at line 39 of file class.ilDatabaseResetStepsObjective.php.

39 : string
40 {
41 return hash("sha256", self::class);
42 }

◆ getLabel()

ilDatabaseResetStepsObjective::getLabel ( )

Definition at line 44 of file class.ilDatabaseResetStepsObjective.php.

44 : string
45 {
46 return "failing update steps are removed.";
47 }

◆ getPreconditions()

ilDatabaseResetStepsObjective::getPreconditions ( Setup\Environment  $environment)
Returns
\ilDatabaseInitializedObjective[]|\ILIAS\Setup\Objective\ClientIdReadObjective[]|\ilIniFilesPopulatedObjective[]

Definition at line 57 of file class.ilDatabaseResetStepsObjective.php.

57 : array
58 {
59 $preconditions = [];
60 $preconditions[] = new Setup\Objective\ClientIdReadObjective();
61 $preconditions[] = new ilIniFilesPopulatedObjective();
62 $preconditions[] = new ilDatabaseInitializedObjective();
63
64 return $preconditions;
65 }

◆ isApplicable()

ilDatabaseResetStepsObjective::isApplicable ( Setup\Environment  $environment)

@inheritDoc

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

78 : bool
79 {
80 $db = $environment->getResource(Setup\Environment::RESOURCE_DATABASE);
81 $query = 'SELECT class FROM il_db_steps WHERE finished IS NULL';
82 return $db->numRows($db->query($query)) > 0;
83 }
$query

References $query.

◆ isNotable()

ilDatabaseResetStepsObjective::isNotable ( )

Definition at line 49 of file class.ilDatabaseResetStepsObjective.php.

49 : bool
50 {
51 return true;
52 }

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