ILIAS  release_7 Revision v7.30-3-g800a261c036
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 (\ilSetupConfig $config)
 

Protected Member Functions

 getClientDir ()
 

Additional Inherited Members

- Protected Attributes inherited from ilSetupObjective
 $config
 

Detailed Description

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

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

Member Function Documentation

◆ achieve()

ilOverwritesExistingInstallationConfirmed::achieve ( Setup\Environment  $environment)

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

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

51  : Setup\Environment
52  {
53  if (!$this->iniExists() && !$this->clientIniExists()) {
54  return $environment;
55  }
56 
57  $admin_interaction = $environment->getResource(Setup\Environment::RESOURCE_ADMIN_INTERACTION);
58 
59  $message =
60  "An installation already seems to exist in this location. Using this command\n" .
61  "might change your installation in unexpected ways. Also, the command might not\n".
62  "work as expected. Are you sure that you want to proceed anyway?";
63 
64  if (!$admin_interaction->confirmOrDeny($message)) {
65  throw new Setup\NoConfirmationException($message);
66  }
67 
68  return $environment;
69  }
$message
Definition: xapiexit.php:14
+ Here is the call graph for this function:

◆ clientIniExists()

ilOverwritesExistingInstallationConfirmed::clientIniExists ( )

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

References getClientDir().

Referenced by achieve(), and isApplicable().

85  {
86  return file_exists($this->getClientDir() . "/client.ini.php");
87  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getClientDir()

ilOverwritesExistingInstallationConfirmed::getClientDir ( )
protected

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

Referenced by clientIniExists().

89  : string
90  {
91  return dirname(__DIR__, 2) . "/data/" . $this->config->getClientId();
92  }
+ Here is the caller graph for this function:

◆ getHash()

ilOverwritesExistingInstallationConfirmed::getHash ( )

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

16  : string
17  {
18  return hash(
19  "sha256",
20  get_class($this)
21  );
22  }

◆ getLabel()

ilOverwritesExistingInstallationConfirmed::getLabel ( )

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

27  : string
28  {
29  return "Confirm that an existing installation should be overwritten.";
30  }

◆ getPreconditions()

ilOverwritesExistingInstallationConfirmed::getPreconditions ( Setup\Environment  $environment)

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

43  : array
44  {
45  return [];
46  }

◆ iniExists()

ilOverwritesExistingInstallationConfirmed::iniExists ( )

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

Referenced by achieve(), and isApplicable().

80  {
81  return file_exists(dirname(__DIR__, 2) . "/ilias.ini.php");
82  }
+ Here is the caller graph for this function:

◆ isApplicable()

ilOverwritesExistingInstallationConfirmed::isApplicable ( Setup\Environment  $environment)

◆ isNotable()

ilOverwritesExistingInstallationConfirmed::isNotable ( )

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

35  : bool
36  {
37  return false;
38  }

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