Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
crazyfactory/jobs / examples / 00_simple_dance.php
Size: Mime:
<?php

/**
 * This is a very simple usage example intended to show
 * the general workflow and configuration.
 *
 * We will create a job manager and configure a single
 * job, which we will then execute.
 *
 * PS: This file should be run via CLI
 */

require_once __DIR__.'/../vendor/autoload.php';

// instantiate the manager
$jobManager = new \CrazyFactory\Jobs\JobManager();

// add a job configuration. This would normally be done
// by looping over a config array, files in folder, etc. etc.
$jobConfig = new \CrazyFactory\Jobs\JobConfig([
    'name' => 'dance',
    'cmd' => 'php ' . __DIR__ . '/jobs/dance_job.php',
]);

// Add it to the manager
$jobManager->withJob($jobConfig);

// Execute by name
$jobManager->run('dance');