Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #40 from thousandsofthem/master

Added php hello_worker example
  • Loading branch information...
commit eb9d12d63e80f139769c86a8a644b24986494ad8 2 parents 3e9608f + 217ee69
@treeder treeder authored
View
8 php/hello_worker/README.md
@@ -0,0 +1,8 @@
+# HelloWorker Example
+
+This is the simplest example you can find and is a great place to start. It simply logs some output to the worker log.
+
+1. Be sure you've done your one time configuration
+2. Run `php upload.php`
+3. Run `php enqueue.php`
+4. Look at [HUD](https://hud.iron.io) to view your tasks running, check logs, etc.
View
12 php/hello_worker/enqueue.php
@@ -0,0 +1,12 @@
+<?php
+
+require "../../IronWorker.class.php";
+
+$worker = new IronWorker();
+
+$task_id = $worker->postTask('HelloWorker', array(
+ 'some_param' => 'some_value',
+ 'other_param' => array(1, 2, 3)
+));
+
+echo "Your task #$task_id has been queued up, check https://hud.iron.io to see your task status and log.";
View
7 php/hello_worker/hello_worker.php
@@ -0,0 +1,7 @@
+<?php
+
+echo "Hello PHP World!!!\n";
+
+$payload = getPayload();
+
+print_r($payload);
View
7 php/hello_worker/upload.php
@@ -0,0 +1,7 @@
+<?php
+
+require "../../IronWorker.class.php";
+
+$worker = new IronWorker();
+
+$worker->upload(dirname(__FILE__), 'hello_worker.php', 'HelloWorker');
Please sign in to comment.
Something went wrong with that request. Please try again.