Ejemplo n.º 1
0
 /**
  * Return the requirements of this wizard
  *
  * @return  RequirementSet
  */
 public function getRequirements()
 {
     $set = new RequirementSet();
     $backendSet = new RequirementSet(false, RequirementSet::MODE_OR);
     $mysqlSet = new RequirementSet(true);
     $mysqlSet->add(new PhpModuleRequirement(array('optional' => true, 'condition' => 'pdo_mysql', 'alias' => 'PDO-MySQL', 'description' => mt('monitoring', 'To access the IDO stored in a MySQL database the PDO-MySQL module for PHP is required.'))));
     $mysqlSet->add(new ClassRequirement(array('optional' => true, 'condition' => 'Zend_Db_Adapter_Pdo_Mysql', 'alias' => mt('monitoring', 'Zend database adapter for MySQL'), 'description' => mt('monitoring', 'The Zend database adapter for MySQL is required to access a MySQL database.'))));
     $backendSet->merge($mysqlSet);
     $pgsqlSet = new RequirementSet(true);
     $pgsqlSet->add(new PhpModuleRequirement(array('optional' => true, 'condition' => 'pdo_pgsql', 'alias' => 'PDO-PostgreSQL', 'description' => mt('monitoring', 'To access the IDO stored in a PostgreSQL database the PDO-PostgreSQL module for PHP is required.'))));
     $pgsqlSet->add(new ClassRequirement(array('optional' => true, 'condition' => 'Zend_Db_Adapter_Pdo_Pgsql', 'alias' => mt('monitoring', 'Zend database adapter for PostgreSQL'), 'description' => mt('monitoring', 'The Zend database adapter for PostgreSQL is required to access a PostgreSQL database.'))));
     $backendSet->merge($pgsqlSet);
     $set->merge($backendSet);
     return $set;
 }
Ejemplo n.º 2
0
 /**
  * Return the requirements of this wizard
  *
  * @return  RequirementSet
  */
 public function getRequirements($skipModules = false)
 {
     $set = new RequirementSet();
     $set->add(new PhpVersionRequirement(array('condition' => array('>=', '5.3.2'), 'description' => mt('setup', 'Running Icinga Web 2 requires PHP version 5.3.2. Advanced features' . ' like the built-in web server require PHP version 5.4.'))));
     $set->add(new PhpConfigRequirement(array('condition' => array('date.timezone', true), 'title' => mt('setup', 'Default Timezone'), 'description' => sprintf(mt('setup', 'It is required that a default timezone has been set using date.timezone in %s.'), php_ini_loaded_file() ?: 'php.ini'))));
     $set->add(new OSRequirement(array('optional' => true, 'condition' => 'linux', 'description' => mt('setup', 'Icinga Web 2 is developed for and tested on Linux. While we cannot' . ' guarantee they will, other platforms may also perform as well.'))));
     $set->add(new PhpModuleRequirement(array('condition' => 'OpenSSL', 'description' => mt('setup', 'The PHP module for OpenSSL is required to generate cryptographically safe password salts.'))));
     $set->add(new PhpModuleRequirement(array('optional' => true, 'condition' => 'JSON', 'description' => mt('setup', 'The JSON module for PHP is required for various export functionalities as well as APIs.'))));
     $set->add(new PhpModuleRequirement(array('optional' => true, 'condition' => 'LDAP', 'description' => mt('setup', 'If you\'d like to authenticate users using LDAP the corresponding PHP module is required.'))));
     $set->add(new PhpModuleRequirement(array('optional' => true, 'condition' => 'INTL', 'description' => mt('setup', 'If you want your users to benefit from language, timezone and date/time' . ' format negotiation, the INTL module for PHP is required.'))));
     // TODO(6172): Remove this requirement once we do not ship dompdf with Icinga Web 2 anymore
     $set->add(new PhpModuleRequirement(array('optional' => true, 'condition' => 'DOM', 'description' => mt('setup', 'To be able to export views and reports to PDF, the DOM module for PHP is required.'))));
     $set->add(new PhpModuleRequirement(array('optional' => true, 'condition' => 'GD', 'description' => mt('setup', 'In case you want views being exported to PDF, you\'ll need the GD extension for PHP.'))));
     $set->add(new PhpModuleRequirement(array('optional' => true, 'condition' => 'Imagick', 'description' => mt('setup', 'In case you want graphs being exported to PDF as well, you\'ll need the ImageMagick extension for PHP.'))));
     $mysqlSet = new RequirementSet(true);
     $mysqlSet->add(new PhpModuleRequirement(array('optional' => true, 'condition' => 'mysql', 'alias' => 'PDO-MySQL', 'description' => mt('setup', 'To store users or preferences in a MySQL database the PDO-MySQL module for PHP is required.'))));
     $mysqlSet->add(new ClassRequirement(array('optional' => true, 'condition' => 'Zend_Db_Adapter_Pdo_Mysql', 'alias' => mt('setup', 'Zend database adapter for MySQL'), 'description' => mt('setup', 'The Zend database adapter for MySQL is required to access a MySQL database.'))));
     $set->merge($mysqlSet);
     $pgsqlSet = new RequirementSet(true);
     $pgsqlSet->add(new PhpModuleRequirement(array('optional' => true, 'condition' => 'pgsql', 'alias' => 'PDO-PostgreSQL', 'description' => mt('setup', 'To store users or preferences in a PostgreSQL database the PDO-PostgreSQL module for PHP is required.'))));
     $pgsqlSet->add(new ClassRequirement(array('optional' => true, 'condition' => 'Zend_Db_Adapter_Pdo_Pgsql', 'alias' => mt('setup', 'Zend database adapter for PostgreSQL'), 'description' => mt('setup', 'The Zend database adapter for PostgreSQL is required to access a PostgreSQL database.'))));
     $set->merge($pgsqlSet);
     $set->add(new ConfigDirectoryRequirement(array('condition' => Icinga::app()->getConfigDir(), 'description' => mt('setup', 'The Icinga Web 2 configuration directory defaults to "/etc/icingaweb2", if' . ' not explicitly set in the environment variable "ICINGAWEB_CONFIGDIR".'))));
     if (!$skipModules) {
         foreach ($this->getWizards() as $wizard) {
             $set->merge($wizard->getRequirements());
         }
     }
     return $set;
 }
Ejemplo n.º 3
0
 public function testNestedMixedRequirementsOfTypeOr()
 {
     $mandatoryMandatoryTrueSet = new RequirementSet(false, RequirementSet::MODE_OR);
     $mandatoryMandatoryTrueSet->add(new TrueRequirement());
     $mandatoryOptionalTrueSet = new RequirementSet(false, RequirementSet::MODE_OR);
     $mandatoryOptionalTrueSet->add(new TrueRequirement(array('optional' => true)));
     $mandatoryMandatoryFalseSet = new RequirementSet(false, RequirementSet::MODE_OR);
     $mandatoryMandatoryFalseSet->add(new FalseRequirement());
     $mandatoryOptionalFalseSet = new RequirementSet(false, RequirementSet::MODE_OR);
     $mandatoryOptionalFalseSet->add(new FalseRequirement(array('optional' => true)));
     $optionalMandatoryTrueSet = new RequirementSet(true, RequirementSet::MODE_OR);
     $optionalMandatoryTrueSet->add(new TrueRequirement());
     $optionalOptionalTrueSet = new RequirementSet(true, RequirementSet::MODE_OR);
     $optionalOptionalTrueSet->add(new TrueRequirement(array('optional' => true)));
     $optionalMandatoryFalseSet = new RequirementSet(true, RequirementSet::MODE_OR);
     $optionalMandatoryFalseSet->add(new FalseRequirement());
     $optionalOptionalFalseSet = new RequirementSet(true, RequirementSet::MODE_OR);
     $optionalOptionalFalseSet->add(new FalseRequirement(array('optional' => true)));
     $mandatoryMandatoryOptionalTrueSet = new RequirementSet(false, RequirementSet::MODE_OR);
     $mandatoryMandatoryOptionalTrueSet->merge($mandatoryOptionalTrueSet);
     $mandatoryMandatoryOptionalTrueSet->merge($mandatoryMandatoryFalseSet);
     $this->assertTrue($mandatoryMandatoryOptionalTrueSet->fulfilled());
     $mandatoryMandatoryOptionalFalseSet = new RequirementSet(false, RequirementSet::MODE_OR);
     $mandatoryMandatoryOptionalFalseSet->merge($mandatoryOptionalFalseSet);
     $mandatoryMandatoryOptionalFalseSet->merge($mandatoryMandatoryTrueSet);
     $this->assertTrue($mandatoryMandatoryOptionalFalseSet->fulfilled());
     $optionalOptionalOptionalTrueSet = new RequirementSet(true, RequirementSet::MODE_OR);
     $optionalOptionalOptionalTrueSet->merge($optionalOptionalTrueSet);
     $optionalOptionalOptionalTrueSet->merge($optionalMandatoryFalseSet);
     $this->assertTrue($optionalOptionalOptionalTrueSet->fulfilled());
     $optionalOptionalOptionalFalseSet = new RequirementSet(true, RequirementSet::MODE_OR);
     $optionalOptionalOptionalFalseSet->merge($optionalOptionalFalseSet);
     $optionalOptionalOptionalFalseSet->merge($optionalMandatoryTrueSet);
     $this->assertTrue($optionalOptionalOptionalFalseSet->fulfilled());
 }
Ejemplo n.º 4
0
 /**
  * Return the requirements of this wizard
  *
  * @return  RequirementSet
  */
 public function getRequirements()
 {
     $set = new RequirementSet();
     // TODO(8254): Add this to the $backendSet
     $set->add(new PhpModuleRequirement(array('optional' => true, 'condition' => 'Sockets', 'description' => mt('monitoring', 'In case it\'s desired that a TCP connection is being used by Icinga Web 2 to' . ' access a Livestatus interface, the Sockets module for PHP is required.'))));
     $backendSet = new RequirementSet(false, RequirementSet::MODE_OR);
     $mysqlSet = new RequirementSet(true);
     $mysqlSet->add(new PhpModuleRequirement(array('optional' => true, 'condition' => 'mysql', 'alias' => 'PDO-MySQL', 'description' => mt('monitoring', 'To access the IDO stored in a MySQL database the PDO-MySQL module for PHP is required.'))));
     $mysqlSet->add(new ClassRequirement(array('optional' => true, 'condition' => 'Zend_Db_Adapter_Pdo_Mysql', 'alias' => mt('monitoring', 'Zend database adapter for MySQL'), 'description' => mt('monitoring', 'The Zend database adapter for MySQL is required to access a MySQL database.'))));
     $backendSet->merge($mysqlSet);
     $pgsqlSet = new RequirementSet(true);
     $pgsqlSet->add(new PhpModuleRequirement(array('optional' => true, 'condition' => 'pgsql', 'alias' => 'PDO-PostgreSQL', 'description' => mt('monitoring', 'To access the IDO stored in a PostgreSQL database the PDO-PostgreSQL module for PHP is required.'))));
     $pgsqlSet->add(new ClassRequirement(array('optional' => true, 'condition' => 'Zend_Db_Adapter_Pdo_Pgsql', 'alias' => mt('monitoring', 'Zend database adapter for PostgreSQL'), 'description' => mt('monitoring', 'The Zend database adapter for PostgreSQL is required to access a PostgreSQL database.'))));
     $backendSet->merge($pgsqlSet);
     $set->merge($backendSet);
     return $set;
 }