Doc #63043 [Opn->Nab]: Only one option can be removed at time
| From: | laruence@php.net | Date: | Sat, 08 Sep 2012 15:59:55 +0000 |
| Subject: | Doc #63043 [Opn->Nab]: Only one option can be removed at time | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-8831@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63043&edit=1
ID: 63043
Updated by: laruence@php.net
Reported by: goran dot v dot miskovic at gmail dot com
Summary: Only one option can be removed at time
-Status: Open
+Status: Not a bug
Type: Documentation Problem
Package: gearman
Operating System: Ubuntu 12.04
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Previous Comments:
------------------------------------------------------------------------
[2012-09-08 09:00:47] goran dot v dot miskovic at gmail dot com
Hi Reeze! Thanks!
However, then, the next section "Parameters" could be enhanced.
Instead of reading "The options to be removed (unset)" it will be more
informative to say: Pipe separated list of the options to be removed (unset).
I will be free to post example in user comments.
------------------------------------------------------------------------
[2012-09-08 03:19:15] reeze dot xia at gmail dot com
Hi goran,
http://php.net/manual/zh/gearmanworker.removeoptions.php
THere is one param, these option should be combined if you want multiple
$client = new GearmanClient();
$client->addOptions(GEARMAN_CLIENT_NON_BLOCKING);
$client->addOptions(GEARMAN_CLIENT_FREE_TASKS);
$client->addOptions(GEARMAN_CLIENT_UNBUFFERED_RESULT);
$result = $client->removeOptions(GEARMAN_CLIENT_NON_BLOCKING | GEARMAN_CLIENT_FREE_TASKS |
GEARMAN_CLIENT_UNBUFFERED_RESULT);
You could do the same thing with addOptions() :)
------------------------------------------------------------------------
[2012-09-08 02:44:01] goran dot v dot miskovic at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/gearmanclient.removeoptions#refsect1-
gearmanclient.removeoptions-description
---
$ php -i | grep Version
PHP Version => 5.3.10-1ubuntu3.2
$ php -i | grep gearman
Additional .ini files parsed => /etc/php5/cli/conf.d/gearman.ini,
gearman
gearman support => enabled
libgearman version => 0.27
$ pecl info gearman
About pecl.php.net/gearman-1.0.2
Documentation reads that one or more options can be removed at time while only
one option can be removed at time.
Test script:
---------------
<?php
$client = new GearmanClient();
$client->addOptions(GEARMAN_CLIENT_NON_BLOCKING);
$client->addOptions(GEARMAN_CLIENT_FREE_TASKS);
$client->addOptions(GEARMAN_CLIENT_UNBUFFERED_RESULT);
$result = $client->removeOptions(GEARMAN_CLIENT_NON_BLOCKING, GEARMAN_CLIENT_FREE_TASKS,
GEARMAN_CLIENT_UNBUFFERED_RESULT);
var_dump($result);
Expected result:
----------------
bool(true)
Actual result:
--------------
Fatal error: Uncaught exception 'ErrorException' with message
'GearmanClient::removeOptions() expects exactly 1 parameter, 3 given'
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63043&edit=1