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


PHP Controller::init方法代码示例

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


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

示例1: init

 public function init()
 {
     parent::init();
     $this->token = (require __DIR__ . '/token.php');
     $this->datePath = __DIR__ . "/dateLastQuery.txt";
     $this->dateLastQuery = $this->getDateLastQuery();
 }
开发者ID:Olwn,项目名称:pm25,代码行数:7,代码来源:AirQualityController.php

示例2: init

 public function init()
 {
     if (strncmp($this->filename, './', 2) == 0) {
         $this->filename = Yii::$app->getBasePath() . substr($this->filename, 1);
     }
     parent::init();
 }
开发者ID:ivan-chkv,项目名称:yii2-kladovka,代码行数:7,代码来源:GenerateController.php

示例3: init

 public function init()
 {
     parent::init();
     if (empty(Yii::$app->params['hook_secret'])) {
         throw new Exception('Config param "hook_secret" is not configured!');
     }
 }
开发者ID:yiisoft-contrib,项目名称:github-bot,代码行数:7,代码来源:GithubController.php

示例4: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     foreach ($this->generators as $id => $config) {
         $this->generators[$id] = Yii::createObject($config);
     }
 }
开发者ID:yangguanghui,项目名称:yii2-extension-final,代码行数:10,代码来源:GenerateController.php

示例5: init

 public function init()
 {
     parent::init();
     $this->gman_worker = new \GearmanWorker();
     $this->gman_worker->addServers($this->module->gman_server);
     $this->gman_client = new \GearmanClient();
     $this->gman_client->addServers($this->module->gman_server);
 }
开发者ID:didwjdgks,项目名称:yii2-ebid-ex,代码行数:8,代码来源:Controller.php

示例6: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     // allow console requests only
     if (!Yii::$app->request->isConsoleRequest) {
         throw new HttpException(404, 'The requested page does not exist.');
     }
     parent::init();
 }
开发者ID:anawatom,项目名称:second,代码行数:11,代码来源:CopyController.php

示例7: init

 public function init()
 {
     parent::init();
     $this->api = Module::getInstance()->api;
     foreach ($this->allowedApiOptions as $option) {
         $this->{$option} = null;
     }
 }
开发者ID:gogl92,项目名称:yii2-teleduino,代码行数:8,代码来源:ApiController.php

示例8: init

 public function init()
 {
     if (!\Yii::$app instanceof ConsoleApplication) {
         throw new Exception('Yii::$app is not an instance of ConsoleApplication.');
         return Controller::EXIT_CODE_ERROR;
     }
     parent::init();
 }
开发者ID:jeremyltn,项目名称:yii2-scheduler,代码行数:8,代码来源:ScheduleController.php

示例9: init

 /**
  * Init
  */
 public function init()
 {
     parent::init();
     // Support cyrillic on windows
     if ($this->isWindows()) {
         system("chcp 65001");
     }
 }
开发者ID:uaoleg,项目名称:vvkp.in.ua,代码行数:11,代码来源:BaseController.php

示例10: init

 public function init()
 {
     pcntl_signal(SIGTERM, [$this, 'signalHandler']);
     pcntl_signal_dispatch();
     parent::init();
     if (self::$queue === null) {
         self::$queue = Yii::$app->{$this->queueObjectName};
     }
 }
开发者ID:AtlasGit,项目名称:yii2-queue,代码行数:9,代码来源:QueueController.php

示例11: init

 public function init()
 {
     if (\Yii::$app->has($this->schedule)) {
         $this->schedule = Instance::ensure($this->schedule, Schedule::className());
     } else {
         $this->schedule = \Yii::createObject(Schedule::className());
     }
     parent::init();
 }
开发者ID:gietos,项目名称:yii2-scheduling,代码行数:9,代码来源:ScheduleController.php

示例12: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->db = Instance::ensure($this->db, Connection::class);
     if (empty($this->db_driver)) {
         $this->db_driver = $this->db->driverName;
     }
     $this->prepareCredentials();
 }
开发者ID:cookyii,项目名称:base,代码行数:12,代码来源:Controller.php

示例13: init

 public function init()
 {
     parent::init();
     $this->token = (require __DIR__ . '/token.php');
     $this->datePath = __DIR__ . "/dateLastQuery.txt";
     $this->dateLastQuery = $this->getDateLastQuery();
     set_time_limit(0);
     //0表示没有限制
     ini_set('memory_limit', '500M');
 }
开发者ID:Olwn,项目名称:pm25,代码行数:10,代码来源:CreateController.php

示例14: init

 /**
  * Init function
  */
 public function init()
 {
     parent::init();
     //set PCNTL signal handlers
     pcntl_signal(SIGTERM, ['vyants\\daemon\\DaemonController', 'signalHandler']);
     pcntl_signal(SIGHUP, ['vyants\\daemon\\DaemonController', 'signalHandler']);
     pcntl_signal(SIGUSR1, ['vyants\\daemon\\DaemonController', 'signalHandler']);
     pcntl_signal(SIGCHLD, ['vyants\\daemon\\DaemonController', 'signalHandler']);
     $this->shortName = $this->shortClassName();
 }
开发者ID:aoyel,项目名称:yii2-daemon,代码行数:13,代码来源:DaemonController.php

示例15: init

 /**
  * {@inheritDoc}
  */
 public function init()
 {
     try {
         if (!isset(Yii::$app->getI18n()->translations['udokmeci.beanstalkd'])) {
             Yii::$app->getI18n()->translations['udokmeci.beanstalkd'] = ['class' => 'yii\\i18n\\PhpMessageSource', 'basePath' => '@app/messages', 'sourceLanguage' => 'en', 'fileMap' => []];
         }
     } catch (\Pheanstalk\Exception\ConnectionException $e) {
         Yii::error($e);
     }
     return parent::init();
 }
开发者ID:G1K,项目名称:yii2-beanstalk,代码行数:14,代码来源:BeanstalkController.php


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