php-resque
php-resque copied to clipboard
[WIP] Introduce Namespaces
This is a request for comments on introducing namespaces to php-resque :slightly_smiling_face:
The files are reorganized quite a bit to make namespaces more natural. I summarize as best as I can:
- All exceptions now can be found in
lib/Exceptions- Rename
DontCreatetoDoNotCreateException - Rename
DontPerformtoDoNotPerformException
- Rename
- All job related classes can be found in
lib\Job - All failure related classes can be found in
lib\Failure - The resque and resquescheduler Worker classes have been renamed to
ResqueWorkerandSchedulerWorkerand moved tolib/Worker Resque_Failurehas been renamed toFailureHandler- This because
Resque_Failureworked with Failures, but wasn't one itself
- This because
Resque_Jobhas been renamed toJobHandler.- Similar to
Resque_Failure. Additionally this would also allow us to introduce an actual Job class later that can be used for inheritance
- Similar to
- Plus some more other minor renames
Code and code comments have been updated, but there's a chance I missed some. Unit tests are updated as well though, and pass. However, I didn't update documentation until the actual implementation is agreed upon.
PR is based on #55, because working with the unit tests was easier that way.
Fixes #36
Import statements must not begin with a leading backslash
I did it so we can have Resque\Exceptions\Exception extending Exception. Without the leading backslash name resolution gets confusing. Then it would be better to rename the exception to Resque\Exceptions\ResqueException (which would also allow to remove the aliasing I did in the code to better differentiate it (ResqueException) from the one in core (CoreException))
it would be better to rename the exception
Go ahead. We're renaming everything already anyway. 🙂
@danhunsaker I think I got everything now. At least I can no longer find references to the old class names. Didn't yet really proof-read the documentation though
No idea why I moved this back to main, it's meant to stay on develop. Can you rebase?
I opened it against main at the time, couldn't point it to develop until #60 as merged. But should be all good now :slightly_smiling_face: