Phergie_Config::readArray PHP Method

readArray() public method

Merges an associative array of configuration setting values into the current configuration settings.
public readArray ( array $settings ) : Phergie_Config
$settings array Associative array of configuration setting values keyed by setting name
return Phergie_Config Provides a fluent interface
    public function readArray(array $settings)
    {
        $this->settings += $settings;
        return $this;
    }

Usage Example

Esempio n. 1
0
 /**
  * Initiate connection
  *
  * @return void
  */
 public function connect()
 {
     if (!$this->conn) {
         $this->conn = new Phergie_StatusnetBot();
         $config = new Phergie_Config();
         $config->readArray(array('connections' => array(array('host' => $this->plugin->host, 'port' => $this->plugin->port, 'username' => $this->plugin->username, 'realname' => $this->plugin->realname, 'nick' => $this->plugin->nick, 'password' => $this->plugin->password, 'transport' => $this->plugin->transporttype, 'encoding' => $this->plugin->encoding)), 'driver' => 'statusnet', 'processor' => 'async', 'processor.options' => array('sec' => 0, 'usec' => 0), 'plugins' => array('Pong', 'NickServ', 'AutoJoin', 'Statusnet'), 'plugins.autoload' => true, 'nickserv.password' => $this->plugin->nickservpassword, 'nickserv.identify_message' => $this->plugin->nickservidentifyregexp, 'autojoin.channels' => $this->plugin->channels, 'statusnet.messagecallback' => array($this, 'handle_irc_message'), 'statusnet.regcallback' => array($this, 'handle_reg_response'), 'statusnet.connectedcallback' => array($this, 'handle_connected'), 'statusnet.unregregexp' => $this->plugin->unregregexp, 'statusnet.regregexp' => $this->plugin->regregexp));
         $this->conn->setConfig($config);
         $this->conn->connect();
         $this->lastPing = time();
         $this->lastMessage = time();
     }
     return $this->conn;
 }
All Usage Examples Of Phergie_Config::readArray