Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 17202 программиста и 1833 робота. Сейчас ищут 1696 программистов ...

HTTP_Client::attach()

Вернуться к: HTTP_Client

HTTP_Client::attach()

HTTP_Client::attach() – Adds a Listener to the list of listeners that are notified of the object's events

Synopsis

require_once 'HTTP/Client.php';

boolean HTTP_Client::attach ( object HTTP_Request_Listener &$listener , boolean $propagate = false )

The attached Listeners are notified of the following events:

'request'

sent before a HTTP request that is not a result of previous redirect.

'httpSuccess'

sent upon receiving a successfull 2xx response (or 3xx response, if it is not a redirect or if redirect processing is disabled).

'httpRedirect'

sent when a 3xx redirection response is received, before following a redirect

'httpError'

sent on 4xx, 5xx response

If $propagate is TRUE the Listener will be attached to the created HTTP_Request objects and will be notified of their events as well.

Parameter

object HTTP_Request_Listener &$listener

Listener instance to attach

boolean $propagate

Whether the listener should be attached to the created HTTP_Request objects

Return value

returns whether the listener was successfully attached

Throws

throws no exceptions thrown

See

see detach()

Note

This function can not be called statically.



Вернуться к: HTTP_Client

© 2024 «PHP.RU — Сообщество PHP-Программистов»
Главная | Форум | Реклама на сайте | Контакты VIP Сувениры
Разработка компании ODware