Comments (8)
A PR would be better :)
from php-resque.
The trouble with a pull request at this point is the question of why $args
is being wrapped in an(other) array. Should it, instead, be cast to an array? Knowing why it is wrapped will determine which of the two solutions should be submitted in a PR to begin with.
from php-resque.
True, I found out this:
The encapsulated array() call in Job::create was added 2 years ago in order to be better compatible with the Ruby version: f7eac3b
When you look at Job->getArguments() you'll see that it then returns the first index of the array: https://github.com/chrisboulton/php-resque/blob/master/lib/Resque/Job.php#L128
So this should be correct:
return self::create($this->queue, $this->payload['class'], $this->payload['args'][0], $monitor);
from php-resque.
Maybe $this->getArguments()
would be better as it returns an empty array when there are no arguments given. Where $this->payload['args'][0]
could throw an undefined index
error.
from php-resque.
You make it sound like git keeps a record of changes, and if commit messages are actually thoughtfully written, others can go back and see why things are done a certain way! A technology like that would be.... Well, useful.
Said another way: Oh. Right. The answer is probably in the commit history somewhere, and something like git blame
would probably help narrow down where. Duh. Should have thought of that.
from php-resque.
yeah $this->getArguments() would be the proper way to do it, like you said, in case $this->payload['args'][0] is undefined. Pull request sent, thanks guys.
from php-resque.
It looks like this issue could be closed? Fixed in #104
from php-resque.
True @Rockstar04
from php-resque.
Related Issues (20)
- The project has been abandoned? HOT 8
- Is it possible to add a job if it does not exists?
- Job Not Found Error specifications
- Could add a event before work reserve
- QUEUE=mail: Command not found. HOT 2
- Still job not found HOT 4
- Couldnt change the redis host while running the worker HOT 2
- 为什么不增加 redis Auth HOT 1
- event listener for any job HOT 1
- Resque_Job_Status Throughout STATUS_RUNNING
- PHP Warning: fread(): Length parameter must be greater than 0 HOT 2
- Please archive this repository -> This package is abandoned and no longer maintained. The author suggests using the resque/php-resque package instead. HOT 7
- QUEUE=message php vendor/bin/resque HOT 4
- add delay jobs HOT 1
- should check pcntl_wifexited first before pcntl_wexitstatus
- 项目还有人维护吗? HOT 3
- Why not "break"? HOT 1
- The documentation for 'scan' is described HOT 6
- Stat namespace growing
- PHP Deprecated: implode(): Passing glue string after array is deprecated.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-resque.