ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables 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 21 of file ProxyConnectableCondition.php.

Constructor & Destructor Documentation

◆ __construct()

ProxyConnectableCondition::__construct (   $config)

Definition at line 23 of file ProxyConnectableCondition.php.

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

24  {
26  "Can establish a connection to proxy",
27  function (Setup\Environment $env) use ($config): bool {
28  try {
29  $host = $config->getProxyHost();
30  if (strspn($host, '.0123456789') != strlen($host) && strstr($host, '/') === false) {
31  $host = gethostbyname($host);
32  }
33  $port = $config->getProxyPort() % 65536;
34 
35  if (!fsockopen($host, $port, $errno, $errstr, 10)) {
36  throw new Exception("Can`t establish connection to proxy.");
37  }
38  } catch (\Exception $e) {
39  return false;
40  }
41 
42  return true;
43  },
44  "Can`t establish connection to proxy."
45  );
46  }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85
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: