ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilOverwritesExistingInstallationConfirmed Class Reference

There seems to already exist an ILIAS installation, an interaction with it should be confirmed. More...

+ Inheritance diagram for ilOverwritesExistingInstallationConfirmed:
+ Collaboration diagram for ilOverwritesExistingInstallationConfirmed:

Public Member Functions

 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Setup\Environment $environment)
 
 achieve (Setup\Environment $environment)
 
 isApplicable (Setup\Environment $environment)
 
 iniExists ()
 
 clientIniExists ()
 
- Public Member Functions inherited from ilSetupObjective
 __construct (Setup\Config $config)
 

Protected Member Functions

 getClientDir ()
 

Additional Inherited Members

- Protected Attributes inherited from ilSetupObjective
Setup Config $config
 

Detailed Description

There seems to already exist an ILIAS installation, an interaction with it should be confirmed.

Definition at line 27 of file class.ilOverwritesExistingInstallationConfirmed.php.

Member Function Documentation

◆ achieve()

ilOverwritesExistingInstallationConfirmed::achieve ( Setup\Environment  $environment)

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

References $message, clientIniExists(), ILIAS\Setup\Environment\getResource(), and iniExists().

67  : Setup\Environment
68  {
69  if (!$this->iniExists() && !$this->clientIniExists()) {
70  return $environment;
71  }
72 
73  $admin_interaction = $environment->getResource(Setup\Environment::RESOURCE_ADMIN_INTERACTION);
74 
75  $message =
76  "An installation already seems to exist in this location. Using this command\n" .
77  "might change your installation in unexpected ways. Also, the command might not\n" .
78  "work as expected. Are you sure that you want to proceed anyway?";
79 
80  if (!$admin_interaction->confirmOrDeny($message)) {
81  throw new Setup\NoConfirmationException($message);
82  }
83 
84  return $environment;
85  }
$message
Definition: xapiexit.php:31
+ Here is the call graph for this function:

◆ clientIniExists()

ilOverwritesExistingInstallationConfirmed::clientIniExists ( )

Definition at line 100 of file class.ilOverwritesExistingInstallationConfirmed.php.

References getClientDir().

Referenced by achieve(), and isApplicable().

100  : bool
101  {
102  return file_exists($this->getClientDir() . "/client.ini.php");
103  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getClientDir()

ilOverwritesExistingInstallationConfirmed::getClientDir ( )
protected

Definition at line 105 of file class.ilOverwritesExistingInstallationConfirmed.php.

Referenced by clientIniExists().

105  : string
106  {
107  return dirname(__DIR__, 4) . "/public/data/" . ((string) $this->config->getClientId());
108  }
+ Here is the caller graph for this function:

◆ getHash()

ilOverwritesExistingInstallationConfirmed::getHash ( )

Definition at line 32 of file class.ilOverwritesExistingInstallationConfirmed.php.

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

◆ getLabel()

ilOverwritesExistingInstallationConfirmed::getLabel ( )

Definition at line 43 of file class.ilOverwritesExistingInstallationConfirmed.php.

43  : string
44  {
45  return "Confirm that an existing installation should be overwritten.";
46  }

◆ getPreconditions()

ilOverwritesExistingInstallationConfirmed::getPreconditions ( Setup\Environment  $environment)

Definition at line 59 of file class.ilOverwritesExistingInstallationConfirmed.php.

59  : array
60  {
61  return [];
62  }

◆ iniExists()

ilOverwritesExistingInstallationConfirmed::iniExists ( )

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

Referenced by achieve(), and isApplicable().

95  : bool
96  {
97  return file_exists(dirname(__DIR__, 4) . "/ilias.ini.php");
98  }
+ Here is the caller graph for this function:

◆ isApplicable()

ilOverwritesExistingInstallationConfirmed::isApplicable ( Setup\Environment  $environment)

◆ isNotable()

ilOverwritesExistingInstallationConfirmed::isNotable ( )

Definition at line 51 of file class.ilOverwritesExistingInstallationConfirmed.php.

51  : bool
52  {
53  return false;
54  }

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