/** * Constructeur de la classe abstraite * * - ajoute les input nécessaires a une interrogation snmp * * @author Olivier Dupuis * @return void */ public function __construct() { trigger_error("start", E_USER_NOTICE); if (!isset($this->_input['host'])) { $this->addInput('host', '/(\\-H)\\s+([^\\s]+)/', false); } else { trigger_error('il ne faut pas definir manuellement -h', E_USER_ERROR); } if (!isset($this->_input['port'])) { $this->addInput('port', '/(\\-p)\\s+([^\\s]+)/', true, 161); } else { trigger_error('il ne faut pas definir manuellement -p', E_USER_ERROR); } if (!isset($this->_input['community'])) { $this->addInput('community', '/(\\-C)\\s+([^\\s]+)/', true, "public"); } else { trigger_error('il ne faut pas definir manuellement -C', E_USER_ERROR); } if (!isset($this->_input['timeout'])) { $this->addInput('timeout', '/(\\-t)\\s+([^\\s]+)/', true, "10"); } else { trigger_error('il ne faut pas definir manuellement -t', E_USER_ERROR); } if (!isset($this->_input['retries'])) { $this->addInput('retries', '/(\\-r)\\s+([^\\s]+)/', true, "3"); } else { trigger_error('il ne faut pas definir manuellement -r', E_USER_ERROR); } if (!isset($this->_input['version'])) { $this->addInput('version', '/(\\-V)\\s+([^\\s]+)/', true, "auto"); } else { trigger_error('il ne faut pas definir manuellement -V', E_USER_ERROR); } parent::__construct(); }
public function __construct() { parent::__construct(); trigger_error("start", E_USER_NOTICE); $this->defineSpecialProperty('login'); $this->defineSpecialProperty('password'); $this->_parseconfiguration(); $this->_connect(); trigger_error("end", E_USER_NOTICE); }