1 # http\Client http\Client::notify([http\Client\Request $request = NULL[, object $progress = NULL]])
3 Implements SplSubject. Notify attached observers about progress with $request.
7 * Optional http\Client\Request $request = NULL
8 The request to notify about.
9 * Optional object $progress = NULL
10 stdClass instance holding progress information.
18 * http\Exception\InvalidArgumentException
19 * http\Exception\UnexpectedValueException
24 class Observer implements SplObserver {
25 function update(SplSubject $client, http\Client\Request $request = NULL, $progress = NULL) {
26 printf("%s %d%%\n", $progress->info,
27 $progress->dltotal ? ($progress->dlnow*100/$progress->dltotal) : 0);
31 $client = new http\Client;
33 $client->attach(new Observer);
34 $client->enqueue(new http\Client\Request("GET", "https://php.net/images/logos/php-logo.eps"));