diff --git a/GearmanManager.php b/GearmanManager.php index 017bdb6..066da02 100644 --- a/GearmanManager.php +++ b/GearmanManager.php @@ -451,12 +451,10 @@ protected function getopt($config = array()) { if (isset($opts['p'])) { $this->prefix = $opts['p']; - } elseif(!empty($this->config['prefix'])) { + } elseif(isset($this->config['prefix'])) { $this->prefix = $this->config['prefix']; } elseif(defined('NET_GEARMAN_JOB_CLASS_PREFIX')) { $this->prefix = NET_GEARMAN_JOB_CLASS_PREFIX; - } else { - $this->prefix = 'Net_Gearman_Job_'; } if(isset($opts['u'])){ @@ -1219,5 +1217,3 @@ protected function show_help($msg = "") { } } - -?> diff --git a/GearmanPearManager.php b/GearmanPearManager.php index be2724e..d4b6e8c 100644 --- a/GearmanPearManager.php +++ b/GearmanPearManager.php @@ -13,6 +13,12 @@ class GearmanPearManager extends GearmanManager { private $start_time; + /** + * Job Class prefix to use. + * @var string + */ + protected $prefix = 'Net_Gearman_Job_'; + /** * Starts a worker for the PEAR library * diff --git a/composer.json b/composer.json index 6bd4bc5..faf0011 100644 --- a/composer.json +++ b/composer.json @@ -24,4 +24,4 @@ "autoload": { "classmap": [ "GearmanManager.php", "GearmanPearManager.php", "GearmanPeclManager.php" ] } -} +} \ No newline at end of file