Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow for use of a default server in the worker the same way as the c…

…lient
  • Loading branch information...
commit 77cbbb12a5b4bdb6ac2e879fc00cf4c391bb971b 1 parent 2391d67
@brianlmoon brianlmoon authored committed
Showing with 4 additions and 2 deletions.
  1. +4 −2 Net/Gearman/Worker.php
View
6 Net/Gearman/Worker.php
@@ -135,9 +135,11 @@ class Net_Gearman_Worker
* @throws Net_Gearman_Exception
* @see Net_Gearman_Connection
*/
- public function __construct($servers, $id = "")
+ public function __construct($servers = null, $id = "")
{
- if (!is_array($servers) && strlen($servers)) {
+ if (is_null($servers)){
+ $servers = array("localhost");
+ } elseif (!is_array($servers) && strlen($servers)) {
$servers = array($servers);
} elseif (is_array($servers) && !count($servers)) {
throw new Net_Gearman_Exception('Invalid servers specified');
Please sign in to comment.
Something went wrong with that request. Please try again.