/** * Set the extensions which the service reports in the connection object * @param Swift_Events_ResponseEvent The list of extensions as reported by the service */ protected function setConnectionExtensions(Swift_Events_ResponseEvent $list) { $le = strpos($list->getString(), "\r\n") !== false ? "\r\n" : "\n"; $list = explode($le, $list->getString()); for ($i = 1, $len = count($list); $i < $len; $i++) { $extension = substr($list[$i], 4); $attributes = preg_split("![ =]!", $extension); $this->connection->setExtension($attributes[0], isset($attributes[1]) ? array_slice($attributes, 1) : array()); } }
/** * Set the extensions which the service reports in the connection object * @param Swift_Events_ResponseEvent The list of extensions as reported by the service */ function setConnectionExtensions(&$list) { if (!is_a($list, "Swift_Events_ResponseEvent")) { trigger_error("Swift::setConnectionExtensions expects parameter 1 to be of type Swift_Events_ResponseEvent."); return; } $le = strpos($list->getString(), "\r\n") !== false ? "\r\n" : "\n"; $list = explode($le, $list->getString()); for ($i = 1, $len = count($list); $i < $len; $i++) { $extension = substr($list[$i], 4); $attributes = preg_split('/[ =]/', $extension); $this->connection->setExtension($attributes[0], isset($attributes[1]) ? array_slice($attributes, 1) : array()); } }