£Á°èZ¨Ä…–K§‚«“ô4“ÒÙ´dîfUÙÃÅ WKbyʦ•ꎅȮFÒ¿ÊÎóCozá¬S@6{Í:›œêZÌ:Š•_%:¢¾¾~;‘Ã~芩ÊǍí`ÔÑ©ú뙵'5I¿fš×WO%ø9¾«¾DK|€ùÍD”Ýs]nHÕ¶êםӼ㞪éUWŸÈË%DÒÕ¬ï‘]/Åcx ‰ï2ß]ä6G[]S£Ôϯrs{úëóµmÒï#UQxo·õÞCe]"±/aÙ&Eã4ú9Jé_ÞåëdãöKë)AÞ ¯¹ægƒÛowЍø^d™ý½ßB7áyMä9ÜÖUã !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --TEST-- GearmanWorker::addFunction(), context param --SKIPIF-- --FILE-- addServer($host, $port); $handle = $client->doBackground($job, $workload); $client->doBackground($job, $workload); $client->doBackground($job, $workload); $client->doBackground($job, $workload); print "GearmanWorker::doBackground() (OO): ".(preg_match('/^H:'.gethostname().':\d+$/', $handle) === 1? 'Success' : 'Failure').PHP_EOL; $worker = new TestWorker(); print "GearmanWorker::work() (OO, array ctx): " .($worker->work() === true ? 'Success' : 'Failure') . PHP_EOL; print "GearmanWorker::work() (OO, array ctx): " .($worker->work() === true ? 'Success' : 'Failure') . PHP_EOL; print "GearmanWorker::work() (OO, array ctx): " .($worker->work() === true ? 'Success' : 'Failure') . PHP_EOL; print "OK"; class TestWorker extends \GearmanWorker { public function __construct() { global $job; parent::__construct(); $this->addServer(); $this->addFunction($job, [$this, 'test'], ['firstArg' => 'firstValue']); } public function test($job, $context) { echo "Starting job {$job->workload()}". PHP_EOL; $firstArg = $context['firstArg']; echo "FirstArg is $firstArg" . PHP_EOL; } } ?> --EXPECT-- GearmanWorker::doBackground() (OO): Success Starting job {"workload":"test"} FirstArg is firstValue GearmanWorker::work() (OO, array ctx): Success Starting job {"workload":"test"} FirstArg is firstValue GearmanWorker::work() (OO, array ctx): Success Starting job {"workload":"test"} FirstArg is firstValue GearmanWorker::work() (OO, array ctx): Success OK