当前位置: 首页>>代码示例>>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;未经允许,请勿转载。