當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CConsoleCommand類代碼示例

本文整理匯總了PHP中CConsoleCommand的典型用法代碼示例。如果您正苦於以下問題:PHP CConsoleCommand類的具體用法?PHP CConsoleCommand怎麽用?PHP CConsoleCommand使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了CConsoleCommand類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * GenerateWorklistsCommand constructor.
  *
  * @param string                $name
  * @param CConsoleCommandRunner $runner
  * @param WorklistManager       $manager
  */
 public function __construct($name, $runner, $manager = null)
 {
     if (is_null($manager)) {
         $manager = new WorklistManager();
     }
     $this->manager = $manager;
     parent::__construct($name, $runner);
 }
開發者ID:openeyes,項目名稱:openeyes,代碼行數:15,代碼來源:GenerateWorklistsCommand.php

示例2: renderPartial

 /**
  * Load and render the view
  *
  * @param $view view file path (yii path alias)
  * @param null $data parameters to render in the view
  * @return string the rendered view
  * @throws CException if the view cannot be found
  */
 public function renderPartial($view, $data = null)
 {
     if (($viewFile = $this->getViewFile($view)) !== false) {
         $output = CConsoleCommand::renderFile($viewFile, $data, true);
         return $output;
     } else {
         throw new CException(Yii::t('yii', '{controller} cannot find the requested view "{view}".', array('{controller}' => get_class($this), '{view}' => $view)));
     }
 }
開發者ID:narwold,項目名稱:Small-Potatoes,代碼行數:17,代碼來源:SYiiMessage.php

示例3: afterAction

 /**
  * (non-PHPdoc)
  * @see CConsoleCommand::afterAction()
  */
 protected function afterAction($action, $params, $exitCode = 0)
 {
     $dirPath = Yii::app()->runtimePath . '/locks/';
     $commandName = $this->getName();
     $lockFileName = "{$commandName}_{$action}_.lock";
     $lockFilePath = $dirPath . $lockFileName;
     if (file_exists($lockFilePath)) {
         unlink($lockFilePath);
     }
     return parent::afterAction($action, $params, $exitCode);
 }
開發者ID:xiaoxiaochengxyuan,項目名稱:kshenghuo,代碼行數:15,代碼來源:ConsoleCommand.php

示例4: init

 public function init()
 {
     parent::init();
     Yii::getLogger()->autoFlush = 10;
     Yii::getLogger()->detachEventHandler('onFlush', array(Yii::app()->log, 'collectLogs'));
     Yii::getLogger()->attachEventHandler('onFlush', array($this, 'processLogs'));
 }
開發者ID:alexanderkuz,項目名稱:test-yii2,代碼行數:7,代碼來源:C2goCConsoleCommand.php

示例5: __construct

 public function __construct($name, $runner)
 {
     parent::__construct($name, $runner);
     if ($this->_log == null) {
         $this->_log = new CronFileLogRoute('command_update');
     }
 }
開發者ID:hucongyang,項目名稱:test,代碼行數:7,代碼來源:UpdateCommand.php

示例6: init

 /**
  * Ini system param
  */
 public function init()
 {
     parent::init();
     ini_set('memory_limit', '-1');
     set_time_limit(0);
     $this->_logger = LoggerFactory::getFileLogger('process_sync_db');
 }
開發者ID:anton-itscript,項目名稱:WM-Web,代碼行數:10,代碼來源:SyncDBCommand.php

示例7: pluralize

 /**
  * Pluralize word depending on count
  *
  * @param string $name
  * @param int $count
  * @return string
  */
 public function pluralize($name, $count = 1)
 {
     if ($count == 1) {
         return $name;
     }
     return parent::pluralize($name);
 }
開發者ID:septembermd,項目名稱:n1,代碼行數:14,代碼來源:ConsoleCommand.php

示例8: run

 public function run($args)
 {
     \Yii::getLogger()->autoFlush = 1;
     \Yii::getLogger()->detachEventHandler('onFlush', [\Yii::app()->log, 'collectLogs']);
     \Yii::getLogger()->attachEventHandler('onFlush', [$this, 'processLogs']);
     parent::run($args);
 }
開發者ID:herroffizier,項目名稱:yiiq,代碼行數:7,代碼來源:Base.php

示例9: init

 /**
  * Initialize the command object.
  */
 public function init()
 {
     // Tell yii to flush the logs every message (instead of buffering for the default 10,000)
     // Without this, you cannot use the log to find out where the script has got to in it's current run.
     Yii::getLogger()->autoFlush = 1;
     Yii::getLogger()->autoDump = true;
     parent::init();
 }
開發者ID:peopleperhour,項目名稱:yii-ses-feedback,代碼行數:11,代碼來源:ASesFeedbackCommand.php

示例10: afterAction

 protected function afterAction($action, $params, $exitCode = 0)
 {
     if (isset($this->service['name'])) {
         $this->log("SERVICE: Service {$this->service['name']} exited with code {$exitCode} [PID: {$this->pid}] ");
         ServiceManager::markAsStopped($this->service['name'], $this->id);
     }
     return parent::afterAction($action, $params, $exitCode);
 }
開發者ID:reggi49,項目名稱:plansys,代碼行數:8,代碼來源:Service.php

示例11: init

 public function init()
 {
     parent::init();
     ini_set('memory_limit', '-1');
     set_time_limit(0);
     $this->_logger = LoggerFactory::getFileLogger('sms');
     //		$this->_logger = LoggerFactory::getConsoleLogger();
 }
開發者ID:anton-itscript,項目名稱:WM-Web,代碼行數:8,代碼來源:SmsSendCommand.php

示例12: init

 public function init()
 {
     parent::init();
     ini_set('memory_limit', '-1');
     set_time_limit(0);
     // All reports are generated basing on data in UTC time.
     TimezoneWork::set('UTC');
 }
開發者ID:anton-itscript,項目名稱:WM-Web,代碼行數:8,代碼來源:ReportSendTestCommand.php

示例13: afterAction

 public function afterAction($action, $params, $exitCode = 0)
 {
     if ($this->outputLog) {
         echo implode("\n", $this->_log) . "\n";
     }
     array_unshift($this->_log, 'Launched at: ' . date("Y-m-d H:i:s"));
     file_put_contents(Yii::app()->params['logDirPath'] . '/moveFollowUpAppointment.log', implode("\n", $this->_log), FILE_APPEND);
     return parent::afterAction($action, $params, $exitCode);
 }
開發者ID:jankichaudhari,項目名稱:yii-site,代碼行數:9,代碼來源:CronMoveFollowUpAppointmentsCommand.php

示例14: init

 public function init()
 {
     parent::init();
     ini_set('memory_limit', '-1');
     set_time_limit(0);
     self::$_logger = LoggerFactory::getFileLogger('reports');
     // All reports are generated basing on data in UTC time.
     TimezoneWork::set('UTC');
 }
開發者ID:anton-itscript,項目名稱:WM-Web,代碼行數:9,代碼來源:ScheduleCommand_old.php

示例15: init

 public function init()
 {
     parent::init();
     Yii::import('application.modules.yupe.components.*');
     Yii::import('application.modules.yupe.models.*');
     Yii::import('application.modules.comment.models.*');
     $this->migrator = is_object($this->migrator) ? $this->migrator : new Migrator();
     $this->db = is_object($this->db) ? $this->db : Yii::app()->db;
 }
開發者ID:alextravin,項目名稱:yupe,代碼行數:9,代碼來源:MigrateToNestedSetsCommand.php


注:本文中的CConsoleCommand類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。