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


PHP CConsoleCommand::beforeAction方法代碼示例

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


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

示例1: beforeAction

 public function beforeAction($action, $params)
 {
     if ($this->domain == '') {
         echo 'You need to specify the domain as Xpress support multi-sites and multi-database.', "\n", 'i.e: --domain=www.domain.com', "\n";
         return false;
     }
     return parent::beforeAction($action, $params);
 }
開發者ID:hung5s,項目名稱:yap,代碼行數:8,代碼來源:XConsoleCommand.php

示例2: beforeAction

 protected function beforeAction($action, $params)
 {
     $this->lockFile = $this->getLockPath() . DIRECTORY_SEPARATOR . $this->getLockFilename($action);
     if ($this->isLocked()) {
         \Yii::log("Action was canceled because it's locked now", \CLogger::LEVEL_WARNING, self::CATEGORY);
         return false;
     }
     \Yii::log("Lock before action", \CLogger::LEVEL_TRACE, self::CATEGORY);
     return parent::beforeAction($action, $params);
 }
開發者ID:Wazelin,項目名稱:yii-locked-console-command,代碼行數:10,代碼來源:LockedCommand.php

示例3: beforeAction

 public function beforeAction($action, $params)
 {
     $path = Yii::getPathOfAlias($this->migrationPath);
     if ($path === false || !is_dir($path)) {
         echo 'Error: The migration directory does not exist: ' . $this->migrationPath . "\n";
         exit(1);
     }
     $this->migrationPath = $path;
     return parent::beforeAction($action, $params);
 }
開發者ID:schmunk42,項目名稱:database-command,代碼行數:10,代碼來源:EDatabaseCommand.php

示例4: beforeAction

 /**
  * Determine if the command should use colors, if you overwrite this method
  * remember to return the parent value.
  * @param string $action the action name
  * @param array $params the parameters to be passed to the action method.
  * @return bool whether the action should be executed.
  */
 protected function beforeAction($action, $params)
 {
     $this->shouldUseColors = true;
     if (function_exists('posix_isatty')) {
         $this->shouldUseColors = posix_isatty(STDOUT);
     }
     if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
         $this->shouldUseColors = false;
     }
     return parent::beforeAction($action, $params);
 }
開發者ID:nek-v,項目名稱:yii-econsolecommand,代碼行數:18,代碼來源:EConsoleCommand.php

示例5: beforeAction

 public function beforeAction($action, $params)
 {
     $path = Yii::getPathOfAlias($this->migrationPath);
     if ($path === false || !is_dir($path)) {
         echo 'Error: The migration directory does not exist: ' . $this->migrationPath . "\n";
         exit(1);
     }
     $this->migrationPath = $path;
     $yiiVersion = Yii::getVersion();
     echo "\nYii Migration Tool v1.0 (based on Yii v{$yiiVersion})\n\n";
     return parent::beforeAction($action, $params);
 }
開發者ID:salem-dev-acc,項目名稱:yiiapp,代碼行數:12,代碼來源:MigrateCommand.php

示例6: beforeAction

 public function beforeAction($action, $params)
 {
     $yiiVersion = Yii::getVersion();
     echo "\nData Patch  Migration Tool v1.0 (based on Yii v{$yiiVersion} Migration Tool)\n\n";
     echo 'Data Patch Migration Table : ' . self::migrationTable . "\n\n";
     echo 'Data Patch Path : ' . $this->dataPatchPath . "\n\n";
     $path = $this->dataPatchPath;
     if ($path === false || !is_dir($path)) {
         echo 'Error: The migration directory does not exist: ' . $this->dataPatchPath . "\n";
         exit(1);
     }
     return parent::beforeAction($action, $params);
 }
開發者ID:openeyes,項目名稱:openeyes,代碼行數:13,代碼來源:DataPatchCommand.php

示例7: beforeAction

 /**
  * (non-PHPdoc)
  * @see CConsoleCommand::beforeAction()
  */
 protected function beforeAction($action, $params)
 {
     $commandName = $this->getName();
     $lockFileName = "{$commandName}_{$action}_.lock";
     $dirPath = Yii::app()->runtimePath . '/locks/';
     if (!file_exists($dirPath)) {
         mkdir($dirPath);
     }
     $lockFilePath = $dirPath . $lockFileName;
     if (file_exists($lockFilePath)) {
         die("鎖文件\"{$lockFilePath}\"存在,不能運行\n");
         return !parent::beforeAction($action, $params);
     }
     touch($lockFilePath);
     return parent::beforeAction($action, $params);
 }
開發者ID:xiaoxiaochengxyuan,項目名稱:kshenghuo,代碼行數:20,代碼來源:ConsoleCommand.php

示例8: beforeAction

 public function beforeAction($action, $params)
 {
     $this->attachBehaviors(array('UpdaterBehavior' => array('class' => 'application.components.UpdaterBehavior', 'isConsole' => true, 'scenario' => 'update')));
     $this->requireDependencies();
     return parent::beforeAction($action, $params);
 }
開發者ID:dsyman2,項目名稱:X2CRM,代碼行數:6,代碼來源:UpdateCommand.php

示例9: beforeAction

 /**
  * @inheritdoc
  */
 public function beforeAction($action, $params)
 {
     $this->_service = Yii::app()->cron;
     return parent::beforeAction($action, $params);
 }
開發者ID:Stevad,項目名稱:yii-cron-tasks,代碼行數:8,代碼來源:CronCommand.php

示例10: beforeAction

 public function beforeAction($action, $params)
 {
     Console::writeLine('Command started');
     return parent::beforeAction($action, $params);
 }
開發者ID:evgeniys-hyuna,項目名稱:leadsite,代碼行數:5,代碼來源:ExecutorTestCommand.php

示例11: beforeAction

 protected function beforeAction($action, $params)
 {
     CLIHelper::outputLn(CLIHelper::writeSuccessLn('Let\'s do this...'));
     return parent::beforeAction($action, $params);
 }
開發者ID:eugenesavenko,項目名稱:migraptor,代碼行數:5,代碼來源:MigraptorCommand.php


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