Download the PHP package iron-io/iron_worker without Composer

On this page you can find all versions of the php package iron-io/iron_worker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package iron_worker

iron_worker_php is PHP language binding for IronWorker.

IronWorker is a massively scalable background processing system. See How It Works

Getting Started

Branches

Get credentials

To start using iron_worker_php, you need to sign up and get an oauth token.

  1. Go to http://iron.io/ and sign up.
  2. Get an Oauth Token at http://hud.iron.io/tokens

Install iron_worker_php

There are two ways to use iron_worker_php:

Using composer

Create composer.json file in project directory:

Do composer install (install it if needed: https://getcomposer.org/download/)

And use it:

Using classes directly (strongly not recommended)
  1. Copy classes from src to target directory
  2. Grab IronCore classes there and copy to target directory
  3. Include them all.

Configure

Three ways to configure IronWorker:

Creating a Worker

Here's an example worker:

Upload code to server

Using CLI tool (preferred)

.worker syntax reference

Worker examples

You can find worker examples here: iron_worker_examples

Queueing a Worker

queueing options

Scheduling a Worker

postScheduleAdvanced($name, $payload, $start_at, $label = null, $run_every = null, $end_at = null, $run_times = null, $priority = null, $cluster = null)

If you want to run worker tasks in specific time intervals, once at a particular time, or n number of things starting at a specific time you should schedule it:

scheduling options

Status of a Worker

To get the status of a worker, you can use the method.

Get Worker Log

Use any function that print text inside your worker to put messages to log.

Loading the Task Data Payload

To provide Payload to your worker simply put an array with any content you want.

When your code is executed, it will be passed four program arguments:

IronWorker provide functions getArgs(), getPayload(), getConfig() in your worker to help you using payload:

Setting Task Priority

You can specify priority of the task by setting the corresponding parameter.

Value of priority parameter means the priority queue to run the task in. Valid values are 0, 1, and 2. 0 is the default.

Setting progress status

To set current task progress, just call setProgress($percent, $message) inside your worker.

To retrieve this data on client side, use $worker->getTaskDetails($task_id);

Troubleshooting

http error: 0

If you see Uncaught exception 'Http_Exception' with message 'http error: 0 | ' it most likely caused by misconfigured cURL https certificates. There are two ways to fix this error:

  1. Disable SSL certificate verification - add this line after IronWorker initialization: $worker->ssl_verifypeer = false;
  2. Switch to http protocol - add this to configuration options: protocol = http and port = 80
  3. Fix the error! Recommended solution: download actual certificates - cacert.pem and add them to php.ini:

Full Documentation

You can find more documentation here:

Note for Developers

You can test this library by modifying it and setting up a symbolic link to your local code after you run composer install on the Dockerworker example. See http://blog.grossi.io/2013/testing-your-packagistcomposer-package-locally/ for a detailed description on the Composer file layout and the symlinking strategy.


All versions of iron_worker with dependencies

PHP Build Version
Package Version
Requires php Version >=5.2.0
iron-io/iron_core Version 1.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package iron-io/iron_worker contains the following files

Loading the files please wait ....