Skip to content

Instantly share code, notes, and snippets.

@fabriziomachado
Created November 19, 2011 20:41
Show Gist options
  • Save fabriziomachado/1379326 to your computer and use it in GitHub Desktop.
Save fabriziomachado/1379326 to your computer and use it in GitHub Desktop.
application/workers/worker_helper.php
<?php
# load stack codeigniter
include_once dirname(__FILE__) . '/../third_party/CIUnit/bootstrap_phpunit.php';
require_default_class_job_this_worker();
function require_default_class_job_this_worker()
{
$currentFile = $_SERVER["SCRIPT_NAME"];
$parts = Explode('/', $currentFile);
$current_worker = $parts[count($parts) - 1];
$current_worker = str_replace('worker','job', $current_worker);
require_once(APPPATH ."/workers/$current_worker");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment