当前位置: 首页>>代码示例>>PHP>>正文


PHP AppShell::initialize方法代码示例

本文整理汇总了PHP中AppShell::initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP AppShell::initialize方法的具体用法?PHP AppShell::initialize怎么用?PHP AppShell::initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AppShell的用法示例。


在下文中一共展示了AppShell::initialize方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initialize

 /**
  * Overwrite shell initialize to dynamically load all Queue Related Tasks.
  *
  * @return void
  */
 public function initialize()
 {
     $paths = App::path('Console/Command/Task');
     foreach ($paths as $path) {
         $Folder = new Folder($path);
         $res = array_merge($this->tasks, $Folder->find('Queue.*\\.php'));
         foreach ($res as &$r) {
             $r = basename($r, 'Task.php');
         }
         $this->tasks = $res;
     }
     $plugins = CakePlugin::loaded();
     foreach ($plugins as $plugin) {
         $pluginPaths = App::path('Console/Command/Task', $plugin);
         foreach ($pluginPaths as $pluginPath) {
             $Folder = new Folder($pluginPath);
             $res = $Folder->find('Queue.*Task\\.php');
             foreach ($res as &$r) {
                 $r = $plugin . '.' . basename($r, 'Task.php');
             }
             $this->tasks = array_merge($this->tasks, $res);
         }
     }
     parent::initialize();
     $this->QueuedTask->initConfig();
 }
开发者ID:nilBora,项目名称:konstruktor,代码行数:31,代码来源:QueueShell.php

示例2: initialize

 public function initialize()
 {
     parent::initialize();
     $this->ProcessManager = new \Liip\ProcessManager\ProcessManager();
     $this->setPid(getmypid());
     $this->setProcessName($this->pid);
 }
开发者ID:davidsteinsland,项目名称:cakephp-shells,代码行数:7,代码来源:PidTask.php

示例3: initialize

 public function initialize()
 {
     $this->pluginPath = dirname(dirname(dirname(__FILE__))) . DS;
     $this->bootstrapPath = $this->pluginPath . 'Vendor' . DS . 'bootstrap' . DS;
     $this->Folder = new Folder($this->bootstrapPath);
     parent::initialize();
 }
开发者ID:ByMyHandsOnly,项目名称:BMHO_Web,代码行数:7,代码来源:CopyShell.php

示例4: initialize

 /**
  * Overwrite shell initialize to dynamically load all queue related tasks.
  *
  * @return void
  */
 public function initialize()
 {
     // Check for tasks inside plugins and application
     $paths = App::path('Console/Command/Task');
     foreach ($paths as $path) {
         $Folder = new Folder($path);
         $res = array_merge($this->tasks, $Folder->find('Queue.*\\.php'));
         foreach ($res as &$r) {
             $r = basename($r, 'Task.php');
         }
         $this->tasks = $res;
     }
     $plugins = App::objects('plugin');
     foreach ($plugins as $plugin) {
         $pluginPaths = App::path('Console/Command/Task', $plugin);
         foreach ($pluginPaths as $pluginPath) {
             $Folder = new Folder($pluginPath);
             $res = $Folder->find('Queue.*Task\\.php');
             foreach ($res as &$r) {
                 $r = $plugin . '.' . basename($r, 'Task.php');
             }
             $this->tasks = array_merge($this->tasks, $res);
         }
     }
     $conf = Configure::read('Queue');
     if (!is_array($conf)) {
         $conf = [];
     }
     // Merge with default configuration vars.
     Configure::write('Queue', array_merge(['workers' => 3, 'sleepTime' => 10, 'gcprop' => 10, 'defaultWorkerTimeout' => 2 * MINUTE, 'defaultWorkerRetries' => 4, 'workerMaxRuntime' => 0, 'cleanupTimeout' => DAY, 'exitWhenNothingToDo' => false], $conf));
     parent::initialize();
 }
开发者ID:oefenweb,项目名称:cakephp-queue,代码行数:37,代码来源:QueueShell.php

示例5: initialize

 /**
  * initialize method
  *
  * If the flags -h, -help or --help are present bail here and show help
  *
  * @return void
  * @access public
  */
 function initialize()
 {
     parent::initialize();
     /*
     if (file_exists(APP . 'Config' . DS . 'index.php')) {
     	include(APP . 'Config' . DS . 'index.php');
     	if (!empty($config)) {
     		$this->settings = am($this->settings, $config);
     	}
     }
     */
     $this->_loadModels();
 }
开发者ID:robksawyer,项目名称:grabitdown,代码行数:21,代码来源:IndexShell.php

示例6: initialize

 public function initialize()
 {
     parent::initialize();
     $this->_settings = Configure::read('Gearman') ?: array('servers' => array('127.0.0.1'));
     if (!self::$GearmanWorker) {
         $serversList = implode(',', $this->_settings['servers']);
         $this->log('Creating instance of GearmanWorker with servers: ' . $serversList, 'info', 'gearman');
         self::$GearmanWorker = new GearmanWorker();
         self::$GearmanWorker->addServers($serversList);
         self::$GearmanWorker->addOptions(GEARMAN_WORKER_GRAB_UNIQ);
         self::$GearmanWorker->addOptions(GEARMAN_WORKER_NON_BLOCKING);
     }
 }
开发者ID:davidsteinsland,项目名称:cakephp-gearman,代码行数:13,代码来源:GearmanShellTask.php

示例7: initialize

 public function initialize()
 {
     parent::initialize();
     //$this->loadModel('Gallery');
     $this->loadModel('Locality');
     $this->loadModel('ApertureConnector.Keyword');
     $this->loadModel('ApertureConnector.Place');
     $this->loadModel('ApertureConnector.Version');
     $this->loadModel('ApertureConnector.IptcProperty');
     $this->loadModel('ApertureConnector.OtherProperty');
     $this->loadModel('ApertureConnector.ExifStringProperty');
     $this->loadModel('ApertureConnector.ExifNumberProperty');
     $this->loadModel('ApertureConnector.ImageProxyState');
 }
开发者ID:theus77,项目名称:Aperture2Global,代码行数:14,代码来源:IndexShell.php

示例8: initialize

 public function initialize()
 {
     parent::initialize();
     $this->stdout->styles('header', array('text' => 'blue', 'bold' => true));
     $this->stdout->styles('bold', array('text' => 'white', 'bold' => true));
 }
开发者ID:simaostephanie,项目名称:Cloggy,代码行数:6,代码来源:InstallShell.php

示例9: initialize

 /**
  * Initialize seeder shell, make sure it's OK to seed
  *
  * @return void
  */
 public function initialize()
 {
     parent::initialize();
     $this->_checkSeedable();
 }
开发者ID:ravage84,项目名称:cakephp-fake-seeder,代码行数:10,代码来源:SeederShell.php

示例10: initialize

 public function initialize()
 {
     parent::initialize();
     $this->QueueTask = ClassRegistry::init('Queue.QueueTask');
 }
开发者ID:webtechnick,项目名称:cakephp-queue-plugin,代码行数:5,代码来源:QueueShell.php

示例11: initialize

 /**
  * Initialize method
  *
  * If the flags -h, -help or --help are present bail here and show help
  *
  * @return void
  */
 public function initialize()
 {
     parent::initialize();
     $this->_loadModels();
 }
开发者ID:ByMyHandsOnly,项目名称:BMHO_Web,代码行数:12,代码来源:IndexShell.php

示例12: initialize

 public function initialize()
 {
     parent::initialize();
 }
开发者ID:dereuromark,项目名称:cakephp-sandbox,代码行数:4,代码来源:FontIconShell.php


注:本文中的AppShell::initialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。