Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

enables bad autoloaders to be used. #35

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+15 −21
Split
View
@@ -105,26 +105,23 @@ public function do_job($job) {
$func = $job_name;
}
- if(empty($objects[$job_name]) && !function_exists($func) && !class_exists($func)){
-
- if(!isset($this->functions[$job_name])){
- $this->log("Function $func is not a registered job name");
- return;
+ if(!isset($this->functions[$job_name])){
+ $this->log("Function $func is not a registered job name");
+ return;
+ }
+ if (empty($objects[$job_name])) {
+ if (!function_exists($func) && !class_exists($func)){
+ require_once $this->functions[$job_name]["path"];
}
-
- require_once $this->functions[$job_name]["path"];
-
- if(class_exists($func) && method_exists($func, "run")){
-
- $this->log("Creating a $func object", GearmanManager::LOG_LEVEL_WORKER_INFO);
- $objects[$job_name] = new $func();
-
- } elseif(!function_exists($func)) {
-
- $this->log("Function $func not found");
- return;
+ if (!function_exists($func)){
+ if (class_exists($func) && method_exists($func, "run")){
+ $this->log("Creating a $func object", GearmanManager::LOG_LEVEL_WORKER_INFO);
+ $objects[$job_name] = new $func();
+ } else {
+ $this->log("function $job_name could not be loaded");
+ return;
+ }
}
-
}
$this->log("($h) Starting Job: $job_name", GearmanManager::LOG_LEVEL_WORKER_INFO);
@@ -217,6 +214,3 @@ protected function validate_lib_workers() {
}
$mgr = new GearmanPeclManager();
-
-?>
-