Skip to content
This repository
Newer
Older
100644 26 lines (18 sloc) 0.607 kb
c485332b » thousandsofthem
2012-02-20 php iron_worker examples
1 <?php
2 include("../IronWorker.class.php");
3
4 $name = "testPDO.php";
5
6 $config = parse_ini_file('../config.ini', true);
7
8 # Passing array of options instead of config file.
9 $iw = new IronWorker($config['iron_worker']);
10
1352144c » thousandsofthem
2012-04-18 Clean up php workers
11 # Creating and uploading code package.
12 $iw->upload(dirname(__FILE__)."/workers/PDO", 'Pdo.php', $name);
c485332b » thousandsofthem
2012-02-20 php iron_worker examples
13
14 $payload = array(
15 'connection' => $config['pdo'],
16 'yet_another' => array('value', 'value #2')
17 );
18
19 $task_id = $iw->postTask($name, $payload);
1352144c » thousandsofthem
2012-04-18 Clean up php workers
20
21 # Wait for task finish
22 $details = $iw->waitFor($task_id);
c485332b » thousandsofthem
2012-02-20 php iron_worker examples
23 print_r($details);
24
1352144c » thousandsofthem
2012-04-18 Clean up php workers
25 $log = $iw->getLog($task_id);
26 echo "Task log:\n $log\n";
c485332b » thousandsofthem
2012-02-20 php iron_worker examples
27
Something went wrong with that request. Please try again.