ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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)
 
 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. Are you sure that you\n" .
62  "want to proceed?";
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 76 of file class.ilOverwritesExistingInstallationConfirmed.php.

References getClientDir().

Referenced by achieve().

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

◆ getClientDir()

ilOverwritesExistingInstallationConfirmed::getClientDir ( )
protected

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

Referenced by clientIniExists().

81  : string
82  {
83  return dirname(__DIR__, 2) . "/data/" . $this->config->getClientId();
84  }
+ 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 if applicable.";
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 71 of file class.ilOverwritesExistingInstallationConfirmed.php.

Referenced by achieve().

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

◆ 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: