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


PHP Console::renderColoredString方法代码示例

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


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

示例1: actionIndex

 public function actionIndex($environment)
 {
     $directory = \Yii::$app->basePath . '/environments/' . $environment;
     if (file_exists($directory)) {
         FileHelper::copyDirectory($directory, \Yii::$app->basePath);
         echo Console::renderColoredString('%g' . \Yii::t('app.console', 'Окружение успешно сменено на {env}', ['env' => $environment]), true);
         echo Console::renderColoredString("%n\n");
     } else {
         throw new Exception(\Yii::t('app.console', 'Указанного окружения не существует'));
     }
 }
开发者ID:vollossy,项目名称:app-template,代码行数:11,代码来源:EnvironmentController.php

示例2: actionUpdateExpired

 /**
  * Updates expired packages
  */
 public function actionUpdateExpired()
 {
     $packages = $this->packageRepository->getExpired();
     foreach ($packages as $package) {
         $package->load();
         Yii::$app->queue->push('package', Yii::createObject(PackageUpdateCommand::class, [$package]));
         $message = "Package %N" . $package->getFullName() . '%n';
         $message .= " was updated " . Yii::$app->formatter->asRelativeTime($package->getUpdateTime());
         $message .= ". %GAdded to queue for update%n\n";
         $this->stdout(Console::renderColoredString($message));
     }
 }
开发者ID:hiqdev,项目名称:asset-packagist,代码行数:15,代码来源:MaintenanceController.php

示例3: actionIndex

 public function actionIndex()
 {
     ini_set('memory_limit', '128M');
     echo '[database connection]', PHP_EOL;
     echo '  i2db   : ' . $this->module->i2db->dsn, PHP_EOL;
     echo '  infodb : ' . $this->module->infodb->dsn, PHP_EOL;
     echo '[gearman worker]', PHP_EOL;
     echo '  server   : ' . $this->module->gman_server, PHP_EOL;
     echo '  function : "pur_gman"', PHP_EOL;
     echo Console::renderColoredString("%yStart worker...%n"), PHP_EOL;
     $worker = new GearmanWorker();
     $worker->addServers($this->module->gman_server);
     $worker->addFunction('pur_gman', [$this, 'pur_gman']);
     while ($worker->work()) {
     }
 }
开发者ID:didwjdgks,项目名称:yii2-pur-gman,代码行数:16,代码来源:GearmanController.php

示例4: actionFetchTop

 /**
  * Fetches TOP-$count components from Bower ans saves to `config/bower.list`.
  *
  * @param int $count
  * @param bool $skipCache
  */
 public function actionFetchTop($count = 1000, $skipCache = false)
 {
     $result = [];
     $components = $this->getComponents($skipCache);
     ArrayHelper::multisort($components, 'stars', SORT_DESC, SORT_NUMERIC);
     foreach (array_slice($components, 0, $count) as $component) {
         $result[] = 'bower-asset/' . $component['name'];
         echo Console::renderColoredString("%R{$component['stars']}%N - %g{$component['name']}%N");
         Console::moveCursorTo(0);
         Console::clearLine();
     }
     $componentsListPath = Yii::getAlias('@hiqdev/assetpackagist/config/bower.list');
     file_put_contents($componentsListPath, implode("\n", $result));
     echo Console::renderColoredString('Fetched %YBower%N components list. Found %G' . count($components) . "%N components.\n");
     echo Console::renderColoredString('Only %bTOP-' . $count . "%N components were added to the packages list.\n");
     echo Console::renderColoredString('See %G' . $componentsListPath . "%N\n");
 }
开发者ID:hiqdev,项目名称:asset-packagist,代码行数:23,代码来源:BowerPackageController.php

示例5: actionUpdateList

 public function actionUpdateList($file = STDIN)
 {
     $handler = is_resource($file) ? $file : fopen($file, 'r');
     $errorPackages = [];
     while ($line = fgets($handler)) {
         list($full) = preg_split('/\\s+/', trim($line));
         list($type, $name) = AssetPackage::splitFullName($full);
         if (!$this->actionUpdate($type, $name)) {
             $errorPackages[] = $full;
         }
     }
     if (!is_resource($file)) {
         fclose($handler);
     }
     if (!empty($errorPackages)) {
         echo Console::renderColoredString("%RThe following packages were not updated due to unrecoverable errors:%n\n");
         echo implode("\n", $errorPackages);
     }
     echo "\n";
 }
开发者ID:hiqdev,项目名称:asset-packagist,代码行数:20,代码来源:AssetPackageController.php

示例6: attachEventHandlers

 /**
  * Attaches handlers on Queue events
  */
 private function attachEventHandlers()
 {
     $out = function ($string) {
         $this->stdout(Console::renderColoredString($string));
     };
     Event::on(Queue::class, Queue::EVENT_BEFORE_WORK, function ($event) use($out) {
         /** @var JobEvent $event */
         $out("%Y[{$event->channel}]%n %GNew job%n '" . get_class($event->job) . "'\n");
     });
     Event::on(Queue::class, Queue::EVENT_AFTER_WORK, function ($event) use($out) {
         /** @var JobEvent $event */
         $out("%Y[{$event->channel}]%n %GJob%n '" . get_class($event->job) . "' %Gis completed%n\n");
     });
     Event::on(Queue::class, Queue::EVENT_AFTER_ERROR, function ($event) use($out) {
         /** @var ErrorEvent $event */
         $out("%Y[{$event->channel}]%n %RJob '" . get_class($event->job) . "' finished with error:%n '" . $event->error . "'\n");
     });
     Event::on(AbstractPackageCommand::class, AbstractPackageCommand::EVENT_BEFORE_RUN, function ($event) use($out) {
         /** @var AbstractPackageCommand $command */
         $command = $event->sender;
         $out("%g[" . get_class($command) . "]%n Working on package %N" . $command->getPackage()->getFullName() . "%n\n");
     });
 }
开发者ID:hiqdev,项目名称:asset-packagist,代码行数:26,代码来源:QueueController.php

示例7: run

 public function run()
 {
     $this->beforeRun();
     $package = $this->package;
     $requires = [];
     foreach ($package->getReleases() as $release) {
         if (!isset($release['require'])) {
             continue;
         }
         foreach ($release['require'] as $name => $version) {
             $requires[$name] = true;
         }
     }
     foreach (array_keys($requires) as $name) {
         $assetPackage = AssetPackage::fromFullName($name);
         if ($this->packageRepository->exists($assetPackage)) {
             Yii::trace(Console::renderColoredString('Package %N' . $assetPackage->getFullName() . "%n already exists. Skipping.\n"), __CLASS__);
             continue;
         }
         Yii::$app->queue->push('package', Yii::createObject(PackageUpdateCommand::class, [$assetPackage]));
         Yii::trace(Console::renderColoredString('Created update command for %Y' . $assetPackage->getFullName() . "%n package\n"), __CLASS__);
     }
     $this->afterRun();
 }
开发者ID:hiqdev,项目名称:asset-packagist,代码行数:24,代码来源:CollectDependenciesCommand.php

示例8: i2conv_run

 public function i2conv_run($job)
 {
     $workload = $job->workload();
     $workload = Json::decode($workload);
     try {
         $this->module->i2db->close();
         $this->module->infodb->close();
         $bidKey = BidKey::findOne($workload['bidid']);
         if ($bidKey === null) {
             return;
         }
         $bidvalue = $bidKey->bidValue;
         if ($bidvalue === null) {
             return;
         }
         if (!ArrayHelper::isIn($bidKey->state, ['Y', 'N', 'D'])) {
             return;
         }
         if ($bidKey->bidproc === 'J') {
             return;
         }
         if (empty($bidKey->location)) {
             return;
         }
         switch ($bidKey->bidtype) {
             case 'con':
                 echo Console::renderColoredString('%y[공사]%n');
                 break;
             case 'ser':
                 echo Console::renderColoredString('%g[용역]%n');
                 break;
             case 'pur':
                 echo Console::renderColoredString('%b[구매]%n');
                 break;
             default:
                 return;
         }
         echo $bidKey->constnm;
         echo '[' . $bidKey->notinum . ']';
         echo '(' . $bidKey->state . ',' . $bidKey->bidproc . ')';
         //------------------------------------------------------
         // v3_bid_key
         //------------------------------------------------------
         $v3bidkey = V3BidKey::findNew($bidKey->bidid);
         $this->stdout($v3bidkey->isNewRecord ? "[NEW]\n" : "\n", Console::FG_RED);
         $v3bidkey->attributes = ['whereis' => $bidKey->whereis, 'bidtype' => $bidKey->bidtype, 'con' => strpos($bidKey->bidview, 'con') === false ? 'N' : 'Y', 'ser' => strpos($bidKey->bidview, 'ser') === false ? 'N' : 'Y', 'pur' => strpos($bidKey->bidview, 'pur') === false ? 'N' : 'Y', 'notinum' => $bidKey->notinum, 'orgcode' => $bidKey->orgcode_i, 'constnm' => $bidKey->constnm, 'org' => $bidKey->org_i, 'bidproc' => $bidKey->bidproc, 'contract' => $bidKey->contract, 'bidcls' => $bidKey->bidcls, 'succls' => $bidKey->succls, 'conlevel' => $bidKey->toV3BidKey_conlevel(), 'ulevel' => $bidKey->opt, 'concode' => $bidKey->toV3BidKey_concode(), 'sercode' => $bidKey->toV3BidKey_sercode(), 'purcode' => $bidKey->toV3BidKey_purcode(), 'location' => $bidKey->location ? $bidKey->location : 0, 'convention' => $bidKey->convention == '3' ? '2' : $bidKey->convention, 'presum' => $bidKey->presum ? $bidKey->presum : 0, 'basic' => $bidKey->basic ? $bidKey->basic : 0, 'pct' => $bidKey->pct ? $bidKey->pct : '', 'registdate' => strtotime($bidKey->registdt) > 0 ? date('Y-m-d', strtotime($bidKey->registdt)) : '', 'explaindate' => strtotime($bidKey->explaindt) > 0 ? date('Y-m-d', strtotime($bidKey->explaindt)) : '', 'agreedate' => strtotime($bidKey->agreedt) > 0 ? date('Y-m-d', strtotime($bidKey->agreedt)) : '', 'opendate' => strtotime($bidKey->opendt) > 0 ? date('Y-m-d', strtotime($bidKey->opendt)) : '', 'closedate' => strtotime($bidKey->closedt) > 0 ? date('Y-m-d', strtotime($bidKey->closedt)) : '', 'constdate' => strtotime($bidKey->constdt) > 0 ? date('Y-m-d', strtotime($bidKey->constdt)) : '', 'writedate' => strtotime($bidKey->writedt) > 0 ? date('Y-m-d', strtotime($bidKey->writedt)) : '', 'reswdate' => strtotime($bidKey->resdt) > 0 ? date('Y-m-d', strtotime($bidKey->resdt)) : '', 'state' => $bidKey->state, 'in_id' => 91];
         //------------------------------------------------------
         // v3_bid_value
         //------------------------------------------------------
         $v3BidValue = V3BidValue::findNew($v3bidkey->bidid);
         $v3BidValue->attributes = ['scrcls' => $bidvalue->scrcls, 'scrid' => $bidvalue->scrid, 'constno' => $bidvalue->constno, 'refno' => $bidvalue->refno, 'realorg' => $bidvalue->realorg, 'yegatype' => $bidvalue->yegatype, 'yegarng' => str_replace('|', '/', $bidvalue->yegarng), 'prevamt' => $bidvalue->prevamt, 'parbasic' => $bidvalue->parbasic, 'lvcnt' => $bidvalue->lvcnt, 'charger' => str_replace('|', '/', $bidvalue->charger), 'multispare' => str_replace('|', '/', str_replace(',', '', $bidvalue->multispare)), 'contper' => $bidvalue->contper, 'noticedt' => strtotime($bidKey->noticedt) > 0 ? strtotime($bidKey->noticedt) : 0, 'registdt' => strtotime($bidKey->registdt) > 0 ? strtotime($bidKey->registdt) : 0, 'explaindt' => strtotime($bidKey->explaindt) > 0 ? strtotime($bidKey->explaindt) : 0, 'agreedt' => strtotime($bidKey->agreedt) > 0 ? strtotime($bidKey->agreedt) : 0, 'opendt' => strtotime($bidKey->opendt) > 0 ? strtotime($bidKey->opendt) : 0, 'closedt' => strtotime($bidKey->closedt) > 0 ? strtotime($bidKey->closedt) : 0, 'constdt' => strtotime($bidKey->constdt) > 0 ? strtotime($bidKey->constdt) : 0, 'writedt' => strtotime($bidKey->writedt) > 0 ? strtotime($bidKey->writedt) : 0, 'editdt' => strtotime($bidKey->editdt) > 0 ? strtotime($bidKey->editdt) : 0];
         //공동도급지역코드 (사용하나??)
         $arr = explode('|', $bidvalue->contloc);
         foreach ($arr as $val) {
             if (empty($val)) {
                 continue;
             }
             $m = BidLocal::findOne(['bidid' => $v3bidkey->bidid, 'name' => iconv('utf-8', 'euckr', $val)]);
             if ($m !== null) {
                 $v3BidValue->contloc = $m->code;
                 break;
                 //v3_bid_key.contloc char(4) 때문 1개 지역만 처리...
             }
         }
         //------------------------------------------------------
         // v3_bid_itemcode
         //------------------------------------------------------
         V3BidItemcode::deleteAll(['bidid' => $v3bidkey->bidid]);
         $bidItemcodes = $bidKey->toV3BidItemcodes_attributes();
         foreach ($bidItemcodes as $row) {
             $v3BidItemcode = V3BidItemcode::findNew($v3bidkey->bidid, $row['bidtype'], $row['code']);
             $v3BidItemcode->name = $row['name'];
             $v3BidItemcode->save();
         }
         //------------------------------------------------------
         // v3_bid_local
         //------------------------------------------------------
         V3BidLocal::deleteAll(['bidid' => $v3bidkey->bidid]);
         $bidlocals = $bidKey->bidLocals;
         foreach ($bidlocals as $bidlocal) {
             $v3BidLocal = new V3BidLocal(['bidid' => $v3bidkey->bidid, 'code' => $bidLocal->code, 'name' => $bidLocal->name]);
             $v3BidLocal->save();
         }
         //------------------------------------------------------
         // v3_bid_subcode
         //------------------------------------------------------
         V3BidSubcode::deleteAll(['bidid' => $v3bidkey->bidid]);
         $subcodes = $bidKey->bidSubcodes;
         foreach ($subcodes as $subcode) {
             $v3BidSubcode = new V3BidSubcode(['bidid' => $v3bidkey->bidid, 'g2b_code' => $subcode->g2b_code, 'g2b_code_nm' => $subcode->g2b_code_nm, 'i2_code' => $subcode->i2_code, 'itemcode' => $subcode->itemcode, 'pri_cont' => $subcode->pri_cont, 'share' => $subcode->share]);
             $v3BidSubcode->save();
         }
         //-------------------------------------------------------
         // v3_bid_content
         //-------------------------------------------------------
         $bidcontent = $bidKey->bidContent;
         if ($bidcontent !== null) {
             $v3content = V3BidContent::findNew($v3bidkey->bidid);
             $v3content->attributes = ['content_bid' => $bidcontent->bid_html, 'important_suc' => $bidcontent->nbidcomment, 'content_suc' => $bidcontent->nbid_html, 'upfile_bid' => $bidcontent->bid_file, 'upfile_suc' => $bidcontent->nbid_file, 'important_bid' => !empty($bidcontent->bidcomment_mod) ? $bidcontent->bidcomment_mod . '\\n<hr/>\\n' . $bidcontent->bidcomment : $bidcontent->bidcomment];
             $v3content->save();
//.........这里部分代码省略.........
开发者ID:didwjdgks,项目名称:yii2-i2conv,代码行数:101,代码来源:GearmanController.php

示例9: stdout

 public function stdout($str)
 {
     $this->controller->stdout(Console::renderColoredString($str));
 }
开发者ID:didwjdgks,项目名称:yii2-kepco,代码行数:4,代码来源:Suc2WorkAction.php

示例10: onSucData

 public function onSucData($event)
 {
     $row = $event->row;
     \Yii::info('[' . __METHOD__ . '] $row ' . VarDumper::dumpAsString($row), 'kwater');
     $this->stdout(Console::renderColoredString("[KWATER] %g{$row['notinum']}%n {$row['constnm']} ({$row['status']})\n"));
     try {
         $bidkey = BidKey::find()->where(['whereis' => '07', 'notinum' => $row['notinum']])->orderBy('bidid desc')->limit(1)->one();
         if ($bidkey === null) {
             $this->stdout(" > 입찰공고가 없습니다.\n", Console::FG_RED);
             return;
         }
         $bidvalue = BidValue::findOne($bidkey->bidid);
         if ($bidvalue === null) {
             throw new \Exception('bid_value is empty');
         }
         $bidres = BidRes::findOne($bidkey->bidid);
         if ($bidres === null) {
             $bidres = new BidRes(['bidid' => $bidkey->bidid]);
         }
         BidSuccom::deleteAll(['bidid' => $bidkey->bidid]);
         if ($row['bidproc'] == 'F') {
             $bidres->yega = 0;
             $bidres->selms = '';
             $bidres->multispare = '';
             $bidres->officenm1 = '유찰';
             $bidres->reswdt = date('Y-m-d H:i:s');
             $bidres->save();
             $bidkey->bidproc = 'F';
             $bidkey->resdt = date('Y-m-d H:i:s');
             $bidkey->editdt = date('Y-m-d H:i:s');
             $bidkey->save();
             return;
         }
         $bidres->yega = $row['yega'];
         $bidres->innum = $row['innum'];
         $bidres->selms = $row['selms'];
         $bidres->multispare = $bidvalue->multispare;
         $bidres->save();
         Console::startProgress(0, $row['innum']);
         foreach ($row['succoms'] as $succom) {
             $bidsuccom = new BidSuccom(['bidid' => $bidkey->bidid, 'seq' => $succom['seq'], 'officeno' => '', 'officenm' => $succom['officenm'], 'prenm' => '', 'success' => $succom['success'], 'pct' => $succom['pct'], 'rank' => $succom['rank'], 'selms' => '', 'etc' => $succom['etc']]);
             $bidsuccom->save();
             Console::updateProgress($succom['seq'], $row['innum']);
         }
         Console::endProgress();
         $bidkey->bidproc = 'S';
         $bidkey->resdt = date('Y-m-d H:i:s');
         $bidkey->editdt = date('Y-m-d H:i:s');
         $bidkey->save();
     } catch (\Exception $e) {
         $this->stdout("{$e}\n", Console::FG_RED);
         \Yii::error($e, 'kwater');
     }
 }
开发者ID:didwjdgks,项目名称:yii2-kwater,代码行数:54,代码来源:WorkController.php

示例11: work


//.........这里部分代码省略.........
         $event = new WatchEvent();
         $event->row = ['notinum' => $workload['notinum'], 'bidproc' => 'F'];
         $this->trigger(WatchEvent::EVENT_ROW, $event);
         return;
     }
     $data['notinum'] = $workload['notinum'];
     $data['bidproc'] = 'S';
     try {
         $html = $http->request('GET', static::URL_M, ['query' => ['BidNo' => $workload['notinum']]]);
         $html = strip_tags($html, '<tr><td>');
         $html = preg_replace('/<tr[^>]*>/', '<tr>', $html);
         $html = preg_replace('/<td[^>]*>/', '<td>', $html);
         $html = str_replace('&nbsp;', ' ', $html);
         \Yii::info($workload['notinum'] . "\n{$html}", 'kwater');
         //추첨번호
         $p = '/추첨된번호: (?<no>\\d{1,2}) 번/';
         $p = str_replace(' ', '\\s*', $p);
         if (preg_match_all($p, $html, $matches, PREG_SET_ORDER)) {
             $selms = [];
             foreach ($matches as $m) {
                 $selms[] = $m['no'];
             }
             sort($selms);
             $data['selms'] = join('|', $selms);
             if (count($selms) == 1) {
                 $data['selms'] = '';
             }
         }
         //개찰결과
         $html = $http->request('GET', static::URL, ['query' => ['BidNo' => $workload['notinum']]]);
         $html = strip_tags($html, '<tr><td>');
         $html = preg_replace('/<tr[^>]*>/', '<tr>', $html);
         $html = preg_replace('/<td[^>]*>/', '<td>', $html);
         $html = str_replace('&nbsp;', ' ', $html);
         $p = '#<tr> <td>예정가격</td>( <td>[^<]*</td>){2} </tr>' . ' <tr> <tr> <td> (?<yega>\\d{1,3}(,\\d{3})*) 원 </td>( <td>[^<]*</td>){2} </tr>#';
         $p = str_replace(' ', '\\s*', $p);
         if (preg_match($p, $html, $m)) {
             $data['yega'] = str_replace(',', '', $m['yega']);
         }
         //참여업체
         $succoms = [];
         $s_plus = [];
         $s_minus = [];
         $p = '#<tr>' . ' <td>(?<seq>\\d+)</td>' . ' <td>(?<officenm>[^<]*)</td>' . ' <td>(?<pct>[^<]*)</td>' . ' <td>(?<success>[^<]*)</td>' . ' <td>(?<etc>[^<]*)</td>' . ' </tr>#';
         $p = str_replace(' ', '\\s*', $p);
         if (preg_match_all($p, $html, $matches, PREG_SET_ORDER)) {
             foreach ($matches as $m) {
                 $s = ['seq' => $m['seq'], 'officenm' => trim($m['officenm']), 'pct' => substr(str_replace('%', '', trim($m['pct'])), 0, 8), 'success' => str_replace(',', '', trim(str_replace('원', '', $m['success']))), 'etc' => trim($m['etc'])];
                 $succoms[$s['seq']] = $s;
                 switch ($s['etc']) {
                     case '적격심사 1 순위':
                     case '낙찰예정자':
                     case '우선협상대상자':
                         $data['success1'] = $s['success'];
                         $data['officenm1'] = $s['oficenm'];
                         break;
                 }
                 if (isset($data['success1'])) {
                     $s_plus[] = $s['seq'];
                 } else {
                     $s_minus[] = $s['seq'];
                 }
             }
         }
         //최저가
         if (empty($s_plus)) {
             $i = 1;
             foreach ($s_minus as $seq) {
                 $succoms[$seq]['rank'] = $i;
                 if ($i == 1) {
                     $data['success1'] = $succoms[$seq]['success'];
                     $data['officenm1'] = $succoms[$seq]['officenm1'];
                 }
                 $i++;
             }
         } else {
             $i = 1;
             foreach ($s_plus as $seq) {
                 $succoms[$seq]['rank'] = $i;
                 $i++;
             }
             $i = count($s_minus) * -1;
             foreach ($s_minus as $seq) {
                 $succoms[$seq]['rank'] = $i;
                 $i++;
             }
         }
         $data['succoms'] = $succoms;
         $data['innum'] = count($succoms);
         $event = new \kwater\WatchEvent();
         $event->row = $data;
         $this->trigger(\kwater\WatchEvent::EVENT_ROW, $event);
     } catch (\Exception $e) {
         echo Console::renderColoredString("%r{$e}%n"), PHP_EOL;
         \Yii::error($e, 'kwater');
     }
     $this->module->db->close();
     echo sprintf("[%s] Peak memory usage: %sMb\n", date('Y-m-d H:i:s'), memory_get_peak_usage(true) / 1024 / 1024);
     sleep(1);
 }
开发者ID:didwjdgks,项目名称:yii2-kwater,代码行数:101,代码来源:SucWorker.php

示例12: stdout2

 public function stdout2($string)
 {
     $this->stdout(Console::renderColoredString($string));
 }
开发者ID:didwjdgks,项目名称:yii2-kepco,代码行数:4,代码来源:WatchController.php

示例13: getGlobalOptionsHelp

    public function getGlobalOptionsHelp()
    {
        return Console::renderColoredString(<<<HEREDOC

GLOBAL OPTIONS (for all methods):

    %r--responseFormat%n
        Possible values:
          %ypretty%n - format response in human readable representation.
          %yjson%n   - raw JSON, as received from the server.
        Default: %ypretty%n

    %r--apiEndpoint%n
    %r--apiKey%n
    %r--userAgent%n
    %r--sslVerifyPeer%n
HEREDOC
, $this->color);
    }
开发者ID:gogl92,项目名称:yii2-teleduino,代码行数:19,代码来源:ApiController.php

示例14: onRow

 public function onRow($event)
 {
     $row = $event->row;
     $out[] = "[KWATER] [{$row['bidtype']}] %g{$row['notinum']}%n {$row['constnm']} ({$row['contract']},{$row['status']})";
     $bidkey = BidKey::find()->where(['whereis' => \kwater\Module::WHEREIS, 'notinum' => $row['notinum']])->orderBy('bidid desc')->limit(1)->one();
     if ($bidkey === null) {
         if (!ArrayHelper::isIn($row['status'], ['입찰완료', '적격신청', '결과발표']) and !ArrayHelper::isIn($row['contract'], ['지명경쟁', '수의계약(시담)'])) {
             $out[] = "%rNEW%n";
             $this->gman_client->doBackground('kwater_work_bid', Json::encode($row));
             $sleep = 1;
         }
     } else {
         $out[] = "({$bidkey->bidproc})";
         if ($bidkey->bidproc === 'B' and $bidkey->state === 'Y') {
             $bidcheck = BidModifyCheck::findOne($bidkey->bidid);
             if ($bidcheck === null) {
                 $out[] = "%yCHECK%n";
                 $this->gman_client->doBackground('kwater_work_bid', Json::encode($row));
             } else {
                 $diff = time() - $bidcheck->check_at;
                 if ($diff >= 60 * 60 * 1) {
                     $out[] = "%yCHECK%n";
                     $this->gman_client->doBackground('kwater_work_bid', Json::encode($row));
                     $bidcheck->check_at = time();
                     $bidcheck->save();
                     $sleep = 1;
                 }
             }
         }
     }
     $this->stdout(Console::renderColoredString(join(' ', $out)) . PHP_EOL);
     if (isset($sleep)) {
         sleep(3);
     }
 }
开发者ID:didwjdgks,项目名称:yii2-kwater,代码行数:35,代码来源:WatchController.php

示例15: onSucPdb2Row

 public function onSucPdb2Row($event)
 {
     $row = $event->row;
     $out[] = Console::renderColoredString(" %c{$row['constno']}%n %g{$row['degree']}%n {$row['constnm']} ({$row['bidproc']})");
     $bidkey = BidKey::findOne(['whereis' => '10', 'notinum' => $row['hidAnmtNumb'] . '-' . $row['degree'], 'notinum_ex' => $row['constno'], 'state' => 'Y']);
     if ($bidkey !== null) {
         if ($row['bidproc'] === '유찰') {
             if ($bidkey->bidproc === 'F' or $bidkey->bidproc === 'M') {
                 $out[] = 'PASS';
             } else {
                 $out[] = Console::renderColoredString("%yNEW%n");
             }
         } else {
             if ($bidkey->bidproc === 'S') {
                 $out[] = 'PASS';
             } else {
                 $out[] = Console::renderColoredString("%yNEW%n");
             }
         }
     } else {
         $out[] = Console::renderColoredString("%rMISS%n");
     }
     $this->stdout(join(' ', $out) . PHP_EOL);
 }
开发者ID:didwjdgks,项目名称:yii2-d2b,代码行数:24,代码来源:WatchController.php


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