ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ProxyConnectableCondition Class Reference
+ Inheritance diagram for ProxyConnectableCondition:
+ Collaboration diagram for ProxyConnectableCondition:

Public Member Functions

 __construct ($config)
 
- Public Member Functions inherited from ILIAS\Setup\Condition\ExternalConditionObjective
 __construct (string $label, \Closure $condition, ?string $message=null, bool $block_setup=false)
 
 getHash ()
 Get a hash for this objective.The hash of two objectives must be the same, if they are the same objective, with the same config on the same environment, i.e. if the one is achieved the other is achieved as well because they are the same. More...
 
 getLabel ()
 Get a label that describes this objective. More...
 
 isNotable ()
 Get to know if this is an interesting objective for a human. More...
 
 getPreconditions (Setup\Environment $environment)
 
 achieve (Setup\Environment $environment)
 
 isApplicable (Setup\Environment $environment)
 
- Public Member Functions inherited from ILIAS\Setup\Objective
 getPreconditions (Environment $environment)
 Objectives might depend on other objectives. More...
 
 achieve (Environment $environment)
 Objectives can be achieved. More...
 
 isApplicable (Environment $environment)
 Get to know whether the objective is applicable. More...
 

Additional Inherited Members

- Protected Attributes inherited from ILIAS\Setup\Condition\ExternalConditionObjective
string $label
 
Closure $condition
 
string $message
 
bool $block_setup
 

Detailed Description

Definition at line 24 of file ProxyConnectableCondition.php.

Constructor & Destructor Documentation

◆ __construct()

ProxyConnectableCondition::__construct (   $config)

Definition at line 26 of file ProxyConnectableCondition.php.

References Vendor\Package\$e, and ILIAS\GlobalScreen\Provider\__construct().

27  {
29  "Can establish a connection to proxy",
30  function (Setup\Environment $env) use ($config): bool {
31  try {
32  $host = $config->getProxyHost();
33  if (strspn($host, '.0123456789') != strlen($host) && strstr($host, '/') === false) {
34  $host = gethostbyname($host);
35  }
36  $port = $config->getProxyPort() % 65536;
37 
38  if (!fsockopen($host, $port, $errno, $errstr, 10)) {
39  throw new Exception("Can`t establish connection to proxy.");
40  }
41  } catch (\Exception $e) {
42  return false;
43  }
44 
45  return true;
46  },
47  "Can`t establish connection to proxy."
48  );
49  }
An environment holds resources to be used in the setup process.
Definition: Environment.php:27
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

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