Skip to content
This repository was archived by the owner on Nov 30, 2021. It is now read-only.

Commit 099ffda

Browse files
committed
Migrate codebase to PSR-4 namespace
https://getcomposer.org/doc/04-schema.md#autoload
1 parent fec6a8c commit 099ffda

22 files changed

+638
-641
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ before_install:
3232
install:
3333
- composer --no-interaction install --prefer-dist --no-progress
3434

35-
script: $(composer config bin-dir)/phpunit unittest
35+
script: $(composer config bin-dir)/phpunit tests

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## 3.0.0 [Unreleased]
44
- **Removed support for PHP 5.3.**
5+
- celery-php now uses a PSR-4 compliant namespace, `Celery`. To migrate to the
6+
new version, change code from `new Celery(…)` to `new \Celery\Celery(…)`.
57
- Now supports php-amqplib/php-amqplib for the amqplib backend as
68
videlalvaro/php-amqplib is abandoned.
79
- Fix crash with the ampqlib backend when Celery has not yet created the

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Last Celery version tested is 3.1.19
1818

1919
## POSTING TASKS
2020

21-
$c = new Celery('localhost', 'myuser', 'mypass', 'myvhost');
21+
$c = new \Celery\Celery('localhost', 'myuser', 'mypass', 'myvhost');
2222
$result = $c->PostTask('tasks.add', array(2,2));
2323

2424
// The results are serializable so you can do the following:
@@ -46,14 +46,14 @@ _tip: if using RabbitMQ guest user, set "/" vhost_
4646
}
4747

4848
## GET ASYNC RESULT MESSAGE
49-
$c = new Celery('localhost', 'myuser', 'mypass', 'myvhost');
49+
$c = new \Celery\Celery('localhost', 'myuser', 'mypass', 'myvhost');
5050
$message = $c->getAsyncResultMessage('tasks.add', 'taskId');
5151

5252
## PYTHON-LIKE API
5353

5454
An API compatible to AsyncResult in Python is available too.
5555

56-
$c = new Celery('localhost', 'myuser', 'mypass', 'myvhost');
56+
$c = new \Celery\Celery('localhost', 'myuser', 'mypass', 'myvhost');
5757
$result = $c->PostTask('tasks.add', array(2,2));
5858

5959
$result->get();
@@ -84,13 +84,13 @@ create a celery object with ssl options:
8484
'CN_match' => 'CERT_COMMON_NAME'
8585
);
8686

87-
$c = new Celery($host, $user, $password, $vhost, 'celery', 'celery', 5671, false, false, $ssl_options);
87+
$c = new \Celery\Celery($host, $user, $password, $vhost, 'celery', 'celery', 5671, false, false, $ssl_options);
8888

8989
## CONNECTING TO REDIS
9090

9191
Refer to files in testscenario/ for examples of celeryconfig.py.
9292

93-
$c = new Celery(
93+
$c = new \Celery\Celery(
9494
'localhost', /* Server */
9595
'', /* Login */
9696
'test', /* Password */

0 commit comments

Comments
 (0)