Beispiel #1
0
 public function run()
 {
     $this->showHeader();
     $cli_args = $this->parseArguments();
     $args = array_merge($this->init_args, $cli_args);
     Console::output('');
     $this->includeConfigFile($args);
     if (!empty($args['bootstrap'])) {
         $this->includeBootstrapFile($args['bootstrap']);
     }
     Base::init();
     $cmd = $args['cmd'];
     if ($this->debug) {
         Console::output("%C[Info]%n: Preparing to execute: {$args['cmd']}");
     }
     if (!in_array($cmd, $this->valid_cmd)) {
         $this->help();
     } else {
         $this->{$cmd}($args);
     }
 }
Beispiel #2
0
use CKFQueue\Base as CKFQ;
class DemoConfig implements PHPQueue\Interfaces\Config
{
    public static $backend_types = array('Generic' => array('backend' => 'Beanstalkd', 'server' => '127.0.0.1', 'tube' => 'genericjobs'));
    /**
     * @param string $type
     * @return array
     */
    public static function getConfig($type = null)
    {
        $config = isset(self::$backend_types[$type]) ? self::$backend_types[$type] : array();
        return $config;
    }
    /**
     * @return string
     */
    public static function getAppRoot()
    {
        return __DIR__;
    }
    /**
     * @return string No trailing slash
     */
    public static function getLogRoot()
    {
        return __DIR__;
    }
}
CKFQ::setConfigClass('DemoConfig');
CKFQ::init();