PHP Method Yii::info Code Examples

This page contains top rated real world PHP examples of method Yii::info extracted from open source projects. You can rate examples to help us improve the quality of examples
Example #1
Show file File: CartWidget.php Project: Sywooch/WebStore
0
 public function init()
 {
     parent::init();
     //Get cart items and calculate total value
     //Cookie cart array type : ['product_id' => 'quantity', ...]
     $cart_info = \Yii::$app->request->cookies->getValue('cart');
     if ($cart_info !== null) {
         $products = unserialize($cart_info);
         if (is_array($products)) {
             $product_ids = array_keys($products);
             $product_models = ProductModel::getProducts($product_ids);
             //find()->where(['id'=>$product_ids])->all();
             foreach ($product_models as $product_model) {
                 $this->value += $product_model->price * $products[$product_model->id];
                 $this->items += $products[$product_model->id];
                 \Yii::info('Quantity of ' . $product_model->id . ' (' . $product_model->price . ') - ' . $products[$product_model->id]);
             }
         }
     }
     if ($this->value > 0) {
         $this->message = "\$('.cart').addClass('active'); \$('.cart').append(\"<span class='cart-value'> ({$this->value} ₴ - {$this->items} items)</span>\");";
     } else {
         $this->message = "";
     }
 }
Example #2
Show file File: ImporterController.php Project: CAPITALOV/capitalov
0
 /**
  * Импортирует курсы сразу для всех индексов
  */
 public function actionCandels()
 {
     $rows = Stock::query()->all();
     foreach ($rows as $row) {
         $stock_id = $row['id'];
         $this->log('Попытка получить данные для: ' . $row['name']);
         $importer = ['params' => ['market' => $row['finam_market'], 'em' => $row['finam_em'], 'code' => $row['finam_code']]];
         $class = new \app\service\DadaImporter\Finam($importer);
         $date = new \DateTime();
         $date->sub(new \DateInterval('P7D'));
         $data = $class->importCandels($date->format('Y-m-d'));
         // стратегия: Если данные есть то, они не трогаются
         $dateArray = ArrayHelper::getColumn($data, 'date');
         sort($dateArray);
         $rows2 = StockKurs::query(['between', 'date', $dateArray[0], $dateArray[count($dateArray) - 1]])->andWhere(['stock_id' => $stock_id])->all();
         $dateArrayRows = ArrayHelper::getColumn($rows2, 'date');
         $new = [];
         foreach ($data as $row) {
             if (!in_array($row['date'], $dateArrayRows)) {
                 $new[] = [$stock_id, $row['date'], $row['open'], $row['high'], $row['low'], $row['close'], $row['volume'], $row['close']];
             }
         }
         if (count($new) > 0) {
             \Yii::info('Импортированы данные: ' . VarDumper::dumpAsString($new), 'cap\\importer\\index');
             $this->log('Импортированы данные: ' . VarDumper::dumpAsString($new));
             StockKurs::batchInsert(['stock_id', 'date', 'open', 'high', 'low', 'close', 'volume', 'kurs'], $new);
         } else {
             $this->log('Нечего импортировать');
         }
     }
 }
Example #3
Show file File: MaterializedAttributes.php Project: DevGroup-ru/dotplant-monster
0
 /**
  * @param ActionData $actionData
  *
  * @return void
  */
 public function run(&$actionData)
 {
     $monsterContentConfigs = [];
     foreach ($this->entities as $definition) {
         if (!isset($definition['entity'], $definition['attributes'])) {
             continue;
         }
         $entity = $definition['entity'];
         $definition['attributes'] = (array) $definition['attributes'];
         /** @var yii\base\Model $model */
         $models = ArrayHelper::getValue($actionData->entities, $entity, []);
         $model = is_object($models) ? $models : reset($models);
         if ($model === null) {
             Yii::info("Entities list: " . yii\helpers\VarDumper::dumpAsString($actionData->entities));
             Yii::info((array) ArrayHelper::getValue($actionData->entities, $entity, []));
             Yii::info("Searching for " . $entity);
             throw new \RuntimeException("Model is empty");
         }
         foreach ($definition['attributes'] as $index => $attribute) {
             $materials = $model->{$attribute};
             if (is_array($materials) || is_object($materials)) {
                 $monsterContentConfigs[] = ['materials' => $materials, 'uniqueContentId' => $model::className() . ":{$index}:" . $model->id];
             } else {
                 Yii::warning("Model attribute {$attribute} of entity {$entity} is not array or object");
             }
         }
     }
     $content = '';
     foreach ($monsterContentConfigs as $index => $config) {
         $content .= "<!-- MonsterContent::{$index} -->\n" . MonsterContent::widget($config) . "\n\n";
     }
     $actionData->content = $content;
 }
Example #4
Show file File: SettingKVModel.php Project: yinheark/yincart2
0
 /**
  * @inheritdoc
  */
 public function save($runValidation = true, $attributeNames = null)
 {
     if ($runValidation && !$this->validate($attributeNames)) {
         \Yii::info('Model not save due to validation error.', __METHOD__);
         return false;
     }
     $db = static::getDb();
     if ($this->isTransactional(self::OP_ALL)) {
         $transaction = $db->beginTransaction();
         try {
             $result = $this->saveInternal();
             if ($result === false) {
                 $transaction->rollBack();
             } else {
                 $transaction->commit();
             }
         } catch (\Exception $e) {
             $transaction->rollBack();
             throw $e;
         }
     } else {
         $result = $this->saveInternal();
     }
     return $result;
 }
Example #5
Show file File: ReportUtils.php Project: hxhxd/yii2-google-adwords-helpers
0
 public static function DownloadReportWithAwql($reportQuery, $path = NULL, \AdWordsUser $user, $reportFormat, array $options = NULL)
 {
     self::init();
     $lastIteration = 0;
     do {
         try {
             $throwException = true;
             \ReportUtils::DownloadReportWithAwql($reportQuery, $path, $user, $reportFormat, $options);
         } catch (\Exception $e) {
             //if errror 5xx or 0 or 8, waiting and trying else
             /* These exceptions are thrown with a random order. I can not keep track of them and support google says nothing.
              * 5xx - error on google server.
              * 0 - couldn't connect to host
              * 8 - this exception: Undefined property: stdClass::$ApiError
              *
              * */
             if ($e->getCode() >= 500 && $e->getCode() < 600 || $e->getCode() == 0 || $e->getCode() == 8) {
                 $lastIteration++;
                 if ($lastIteration < ReportUtils::ATTEMPS) {
                     $throwException = false;
                     \Yii::info($reportQuery, self::CATEGORY);
                     sleep(mt_rand(15, 45));
                 }
             }
             if ($throwException) {
                 $message = "Error with download report. Query:{$reportQuery} Error:{$e->getMessage()} CodeError:{$e->getCode()}";
                 throw new \yii\console\Exception($message);
             }
         }
     } while ($throwException === false);
     return true;
 }
Example #6
Show file File: Subscribe.php Project: dram1008/bogdan
0
 /**
  * Добавляет записи для рассылки в таблицу рассылки
  *
  * @param SiteContentInterface | \app\models\SubscribeItem $item тема письма
  */
 public static function add($item)
 {
     if ($item instanceof SiteContentInterface) {
         $subscribeItem = $item->getMailContent();
     } else {
         $subscribeItem = $item;
     }
     switch ($subscribeItem->type) {
         case self::TYPE_NEWS:
             $where = ['subscribe_is_news' => 1];
             break;
         case self::TYPE_SITE_UPDATE:
             $where = ['subscribe_is_site_update' => 1];
             break;
         case self::TYPE_MANUAL:
             $where = ['subscribe_is_tesla' => 1];
             //                $where = ['subscribe_is_test' => 1];
             break;
     }
     $emailList = User::query($where)->select('email')->andWhere(['not', ['email' => null]])->andWhere(['not', ['email' => '']])->andWhere(['is_active' => 1])->column();
     //        VarDumper::dump(count($emailList),3,false);exit;
     $rows = [];
     foreach ($emailList as $email) {
         $urlUnSubscribe = Url::to(['subscribe/unsubscribe', 'mail' => $email, 'type' => $subscribeItem->type, 'hash' => self::hashGenerate($email, $subscribeItem->type)], true);
         SubscribeMailItem::insert(['text' => str_replace('{linkUnsubscribe}', $urlUnSubscribe, $subscribeItem->text), 'html' => str_replace('{linkUnsubscribe}', $urlUnSubscribe, $subscribeItem->html), 'subject' => $subscribeItem->subject, 'mail' => $email, 'date_insert' => time()]);
         $rows[] = $email;
     }
     \Yii::info($rows, 'tg\\subscribe');
 }
Example #7
Show file File: I18N.php Project: smallmirror62/cms
0
 public static function handleMissingTranslation(MissingTranslationEvent $event)
 {
     \Yii::info("@MISSING: {$event->category}.{$event->message} FOR LANGUAGE {$event->language} @");
     if (!$event->category == 'app') {
         $event->translatedMessage = \Yii::t('app', $event->message);
     }
 }
Example #8
Show file File: Subscribe.php Project: CAPITALOV/capitalov
0
 /**
  * Добавляет записи для рассылки в таблицу рассылки
  *
  * @param SiteContentInterface | \app\models\SubscribeItem $item тема письма
  */
 public static function add($item)
 {
     if ($item instanceof SiteContentInterface) {
         $subscribeItem = $item->getMailContent();
     } else {
         $subscribeItem = $item;
     }
     switch ($subscribeItem->type) {
         case self::TYPE_NEWS:
             $where = ['subscribe_is_news' => 1];
             break;
         case self::TYPE_SITE_UPDATE:
             $where = ['subscribe_is_site_update' => 1];
             break;
         case self::TYPE_MANUAL:
             $where = ['subscribe_is_manual' => 1];
             break;
     }
     $emailList = User::query($where)->select('email')->andWhere(['not', ['email' => null]])->andWhere(['is_active' => 1, 'is_confirm' => 1])->column();
     $rows = [];
     foreach ($emailList as $email) {
         $urlUnSubscribe = Url::to(['subscribe/unsubscribe', 'mail' => $email, 'type' => $subscribeItem->type, 'hash' => self::hashGenerate($email, $subscribeItem->type)], true);
         $rows[] = [str_replace('{linkUnsubscribe}', $urlUnSubscribe, $subscribeItem->text), str_replace('{linkUnsubscribe}', $urlUnSubscribe, $subscribeItem->html), $subscribeItem->subject, $email, time()];
     }
     \Yii::info(ArrayHelper::getColumn($rows, 3), 'gs\\subscribe');
     if (count($rows) > 0) {
         SubscribeMailItem::batchInsert(['text', 'html', 'subject', 'mail', 'date_insert'], $rows);
     }
 }
Example #9
Show file File: TestMiddleware.php Project: trntv/yii2-command-bus
0
 public function execute($command, callable $next)
 {
     \Yii::info('middleware test 1 ok');
     $result = $next($command);
     \Yii::info('middleware test 2 ok');
     return $result;
 }
Example #10
Show file File: Router.php Project: filsh/yii2-wamp
0
 public function connect(\Closure $callback, array $options = [])
 {
     $options = array_merge(['logging' => $this->logging, 'loggingOutput' => $this->loggingOutput, 'connectionTimeout' => null, 'connectionOptions' => []], $options);
     if (!$options['logging']) {
         Logger::set(new NullLogger());
     }
     if (!$options['loggingOutput']) {
         ob_start();
     }
     $connection = $this->createConnection($options['connectionOptions']);
     $connection->once('open', function (ClientSession $session) use($connection, $callback) {
         call_user_func_array($callback, [$connection, $session]);
     });
     if ($options['connectionTimeout'] !== null) {
         $loop = $connection->getClient()->getLoop();
         $timer = $loop->addTimer($options['connectionTimeout'], function () use($loop) {
             $loop->stop();
         });
         $connection->once('close', function () use($timer) {
             $timer->cancel();
             \Yii::warning('WAMP connection closed by timeout.');
         });
     }
     $connection->open();
     if ($options['logging']) {
         \Yii::info(ob_get_contents());
     }
     if (!$options['loggingOutput']) {
         ob_clean();
     }
 }
Example #11
Show file File: BonusGameDiscount.php Project: just-leo/cardgame-serial
0
 /**
  * @inheritdoc
  */
 public function apply($model)
 {
     if ($this->isDue() && in_array($model->ClassID, [6, 12])) {
         $userID = $model->contractor->id;
         \Yii::info('Проверка и применение акции "' . self::$name . '"' . "({$this->getModel()->id})" . ' для пользователя ' . Html::a($userID, ['/user/admin/update', 'id' => $userID]), 'info');
         $settings = $this->getModel()->parseSettings();
         if (empty($settings['attributes'])) {
             return false;
         }
         ArrayHelper::multisort($settings['attributes'], 'payment', SORT_DESC);
         $account = $model->contractor->account;
         foreach ($settings['attributes'] as $attributes) {
             $discount = $this->getModel()->getDiscount();
             $discount->setAttributes($attributes);
             if ($model->CashSum >= $discount->payment) {
                 \Yii::info('Применение акции с атрибутами: ' . Json::encode($attributes), 'info');
                 $account->BonusGames = $account->BonusGames + $discount->bonusGamesCount;
                 if ($account->save(false, ['BonusGames'])) {
                     $finance = new FinanceRecord();
                     $finance->CashSum = 0;
                     $finance->ClassID = 21;
                     //Начисление бонусов
                     $finance->ContractorID = $model->ContractorID;
                     $finance->Comment = $this->getDescription();
                     $finance->save();
                     return true;
                 }
             }
         }
     } else {
         //            var_export(in_array($model->ClassID, [6, 12]));
     }
     return false;
 }
Example #12
Show file File: TinkoffController.php Project: skeeks-cms/cms-shop
0
 public function actionNotify()
 {
     \Yii::info("POST: " . Json::encode(\Yii::$app->request->post()), self::className());
     try {
         if (!\Yii::$app->request->post('OrderId')) {
             throw new Exception('Некорректны запрос от банка.');
         }
         /**
          * @var $shopOrder ShopOrder
          */
         if (!($shopOrder = ShopOrder::findOne(\Yii::$app->request->post('OrderId')))) {
             throw new Exception('Заказ не найден в базе.');
         }
         if ($shopOrder->id != \Yii::$app->request->post('OrderId')) {
             throw new Exception('Не совпадает номер заказа.');
         }
         if ($shopOrder->money->getAmount() != \Yii::$app->request->post('Amount')) {
             throw new Exception('Не совпадает сумма заказа.');
         }
         if (\Yii::$app->request->post('Status') == "CONFIRMED") {
             \Yii::info("Успешный платеж", self::className());
             $shopOrder->processNotePayment();
         }
     } catch (\Exception $e) {
         \Yii::error($e->getMessage(), self::className());
     }
     $this->layout = false;
     return "OK";
 }
Example #13
Show file File: SentinelsManager.php Project: AscendDai/yii2-redis-ha
0
 /**
  * Facade function for interraction with sentinel.
  * 
  * Connects to sentinels (iterrates them if ones fail) and asks for master server address.
  * 
  * @return array [host,port] address of redis master server or throws exception.
  **/
 function discoverMaster($sentinels, $masterName)
 {
     foreach ($sentinels as $sentinel) {
         if (is_scalar($sentinel)) {
             $sentinel = ['hostname' => $sentinel];
         }
         $connection = new SentinelConnection();
         $connection->hostname = isset($sentinel['hostname']) ? $sentinel['hostname'] : null;
         $connection->masterName = $masterName;
         if (isset($sentinel['port'])) {
             $connection->port = $sentinel['port'];
         }
         $connection->connectionTimeout = isset($sentinel['connectionTimeout']) ? $sentinel['connectionTimeout'] : null;
         $connection->unixSocket = isset($sentinel['unixSocket']) ? $sentinel['unixSocket'] : null;
         $r = $connection->getMaster();
         if (isset($sentinel['hostname'])) {
             $connectionName = "{$connection->hostname}:{$connection->port}";
         } else {
             $connectionName = $connection->unixSocket;
         }
         if ($r) {
             \Yii::info("Sentinel @{$connectionName} gave master addr: {$r[0]}:{$r[1]}", __METHOD__);
             return $r;
         } else {
             \Yii::info("Did not get any master from sentinel @{$connectionName}", __METHOD__);
         }
     }
     throw new \Exception("Master could not be discovered");
 }
Example #14
Show file File: I18N.php Project: skeeks-cms/cms
0
 public static function handleMissingTranslation(MissingTranslationEvent $event)
 {
     \Yii::info("@MISSING: {$event->category}.{$event->message} FOR LANGUAGE {$event->language} @", self::className());
     if ($event->category != 'skeeks/cms') {
         $event->translatedMessage = \Yii::t('skeeks/cms', $event->message);
     }
 }
Example #15
Show file File: Request.php Project: voenniy/yii2-jsonrpc
0
 public function setRequestMessage($message)
 {
     \Yii::info("Message: " . $message, "RPC");
     $this->_requestMessage = $message;
     $this->_data = json_decode($message, true);
     \Yii::info("Decode message: " . print_r($this->_data, 1), "RPC");
 }
Example #16
Show file File: User.php Project: sergeymakinen/yii2-jwt-user
0
 /**
  * @inheritDoc
  */
 protected function loginByCookie()
 {
     $claims = $this->getTokenClaims();
     if ($claims === false) {
         return;
     }
     /** @var IdentityInterface $class */
     $class = $this->identityClass;
     $identity = $class::findIdentity($claims['jti']);
     if (!isset($identity)) {
         return;
     } elseif (!$identity instanceof IdentityInterface) {
         throw new InvalidValueException("{$class}::findIdentity() must return an object implementing IdentityInterface.");
     }
     if (isset($claims['exp'])) {
         $duration = $claims['exp'] - $claims['nbf'];
     } else {
         $duration = 0;
     }
     if ($this->beforeLogin($identity, true, $duration)) {
         $this->switchIdentity($identity, $this->autoRenewCookie ? $duration : 0);
         $id = $claims['jti'];
         $ip = \Yii::$app->getRequest()->getUserIP();
         \Yii::info("User '{$id}' logged in from {$ip} via the JWT cookie.", __METHOD__);
         $this->afterLogin($identity, true, $duration);
     }
 }
Example #17
Show file File: SubscribeController.php Project: Makeyko/galaxysss
0
 /**
  * Делает рассылку писем из списка рассылки
  */
 public function actionSend()
 {
     $time = microtime(true);
     $list = SubscribeMailItem::query()->limit(10)->orderBy(['date_insert' => SORT_DESC])->all();
     if (count($list) > 0) {
         //            \Yii::info('Всего писем для рассылки: ' . count($list), 'gs\\app\\commands\\SubscribeController::actionSend');
         //            \Yii::info('Список писем: ' . VarDumper::dumpAsString(ArrayHelper::getColumn($list, 'mail')), 'gs\\app\\commands\\SubscribeController::actionSend');
         foreach ($list as $mailItem) {
             $mail = \Yii::$app->mailer->compose()->setFrom(\Yii::$app->params['mailer']['from'])->setTo($mailItem['mail'])->setSubject($mailItem['subject'])->setHtmlBody($mailItem['html']);
             if (isset($mailItem['text'])) {
                 if ($mailItem['text'] != '') {
                     $mail->setTextBody($mailItem['text']);
                 }
             }
             $result = $mail->send();
             if ($result == false) {
                 \Yii::info('Не удалось доствить: ' . VarDumper::dumpAsString($mailItem), 'gs\\app\\commands\\SubscribeController::actionSend');
             }
         }
         //            \Yii::info('Список писем для удаления: ' . VarDumper::dumpAsString(ArrayHelper::getColumn($list, 'id')), 'gs\\app\\commands\\SubscribeController::actionSend');
         SubscribeMailItem::deleteByCondition(['in', 'id', ArrayHelper::getColumn($list, 'id')]);
         //            \Yii::info('Осталось после рассылки: ' . SubscribeMailItem::query()->count(), 'gs\\app\\commands\\SubscribeController::actionSend');
         $time = microtime(true) - $time;
         //            \Yii::info('Затраченное время на расылку: ' . $time, 'gs\\app\\commands\\SubscribeController::actionSend');
     }
     \Yii::$app->end();
 }
Example #18
Show file File: I18NDb.php Project: smallmirror62/cms
0
 public static function handleMissingTranslation(MissingTranslationEvent $event)
 {
     \Yii::info("@DB: {$event->category}.{$event->message} FOR LANGUAGE {$event->language} @");
     $driver = \Yii::$app->getDb()->getDriverName();
     $caseInsensitivePrefix = $driver === 'mysql' ? 'binary' : '';
     $sourceMessage = SourceMessage::find()->where('category = :category and message = ' . $caseInsensitivePrefix . ' :message', [':category' => $event->category, ':message' => $event->message])->with('messages')->one();
     if (!$sourceMessage) {
         \Yii::info("@WRITE TO DB: {$event->category}.{$event->message} FOR LANGUAGE {$event->language} @");
         $sourceMessage = new SourceMessage();
         $sourceMessage->setAttributes(['category' => $event->category, 'message' => $event->message], false);
         $sourceMessage->save(false);
     }
     $sourceMessage->initMessages();
     $sourceMessage->saveMessages();
     $messages = $sourceMessage->messages;
     if (isset($messages[\Yii::$app->sourceLanguage])) {
         $message = $messages[\Yii::$app->sourceLanguage];
         $message->translation = $sourceMessage->message;
         $message->save(false);
     }
     /**
      * @var $message Message
      */
     $message = ArrayHelper::getValue($sourceMessage->messages, \Yii::$app->language);
     if ($message) {
         $event->translatedMessage = $message->translation;
     }
 }
Example #19
Show file File: queryPeerList.php Project: KKRainbow/ngpt_seed
0
function respond($arr)
{
    Yii::info("Response send");
    Yii::info($arr);
    $be = new BEncoder();
    $be->encode($arr);
    echo $be->encoded;
}
Example #20
Show file File: MyGlobals.php Project: dgomezda/portal
0
 static function cargarVariables()
 {
     $cache = Yii::$app->getCache();
     Yii::info("MyGlobals.cargarVariables" . "Se han cargado las tablas maestras correctamente", __METHOD__);
     $tablas = Multitabla::find();
     $cache->set("MULTITABLA", $tablas);
     return true;
 }
Example #21
Show file File: Permission.php Project: sam-it/abac
0
 private static function getCache($sourceModel, $sourceId, $targetModel, $targetId, $permission)
 {
     if (!isset($targetId)) {
         throw new \Exception('targetId is required');
     }
     \Yii::info("Checking from cache: {$sourceModel} [{$sourceId}] --> {$targetModel} [{$targetId}]");
     $key = md5($sourceModel . $sourceId . $targetModel . $targetId . $permission);
     return isset(self::$cache[$key]) ? self::$cache[$key] : (isset(self::$cache[$sourceModel . $sourceId]) ? false : null);
 }
Example #22
Show file File: RegistrationDispatcher.php Project: Makeyko/galaxysss
0
 public static function cron($isEcho = true)
 {
     $ids = (new Query())->select('parent_id')->from(static::TABLE)->where(['<', 'date_finish', gmdate('YmdHis')])->column();
     if (count($ids) > 0) {
         \Yii::info(\yii\helpers\VarDumper::dumpAsString($ids), 'gs\\app\\services\\RegistrationDispatcher::cron');
         \app\models\User::deleteByCondition(['in', 'id', $ids]);
     }
     parent::cron($isEcho);
 }
Example #23
Show file File: Auth.php Project: gtyd/jira
0
 /**
  * 根据字段名称获取中台用户信息
  * @param string $field
  * @param string $account_id
  * @return Ambigous <\yii\db\array, \yii\db\boolean>
  */
 private function getUserInfoBy($field, $account_id)
 {
     \Yii::trace('getUserInfoBy', __METHOD__);
     \Yii::info('field=' . $field, __METHOD__);
     \Yii::info('account_id=' . $account_id, __METHOD__);
     //根据$account_id,查询业务信息
     $sql = "SELECT p_user.openid,p_user.user_id,p_user.user_name,p_user.position,p_user.tel,p_user.email,p_user.avatar,p_user.sex,p_user.`status`,\n        erp_user.user_code AS erp_user_code,erp_user.user_guid,p_user.session_id,erp_user.user_kind\n        FROM p_user\n        left join p_user_to_erp on p_user.user_id = p_user_to_erp.user_id\n        left join erp_user on erp_user.user_guid = p_user_to_erp.user_guid\n        WHERE {$field} = :ACCOUNT_ID";
     $user = $this->getDb()->createCommand($sql, [":ACCOUNT_ID" => $account_id])->queryOne();
     return $user;
 }
Example #24
Show file File: Action.php Project: nizsheanez/yii2-json-rpc
0
 /**
  * @return mixed
  * @throws Exception
  */
 protected function tryToRunMethod()
 {
     $method = $this->getHandler();
     Yii::beginProfile('service.request.action');
     $output = $this->runMethod($method, $this->getParams($method));
     Yii::endProfile('service.request.action');
     Yii::info($method, 'service.output');
     Yii::info($output, 'service.output');
     return $output;
 }
Example #25
Show file File: MyCacheSession.php Project: gtyd/jira
0
 public function close()
 {
     \Yii::info(__METHOD__);
     if ($this->getIsActive()) {
         @session_write_close();
         $error = error_get_last();
         if ($error) {
             \Yii::error(json_encode($error), __METHOD__);
         }
     }
 }
Example #26
Show file File: EmailTaskController.php Project: highestgoodlikewater/yii2-mailqueue
0
 public function processEmail(AMQPMessage $msg)
 {
     echo ' [x] - ' . date('Y-m-d H:i:s') . " - Message received\n";
     Yii::info('Received message', __METHOD__);
     Yii::trace('Message: ' . $msg->body, __METHOD__);
     $this->composeAndSendEmail($msg);
     echo ' [x] Done' . "\n";
     /* @var AMQPChannel $channel */
     $channel = $msg->delivery_info['channel'];
     // tell the broker that we have processed the message
     $channel->basic_ack($msg->delivery_info['delivery_tag']);
 }
Example #27
Show file File: VKontakte.php Project: CAPITALOV/capitalov
0
 public function register($attributes)
 {
     $fields = ['vk_id' => $attributes['uid'], 'name_first' => $attributes['first_name'], 'name_last' => $attributes['last_name'], 'gender' => $attributes['sex'] == 0 ? null : ($attributes['sex'] == 1 ? 0 : 1), 'vk_link' => $attributes['screen_name'], 'datetime_reg' => gmdate('YmdHis'), 'datetime_activate' => gmdate('YmdHis'), 'is_active' => 1, 'is_confirm' => 0, 'birth_date' => $this->getBirthDate($attributes)];
     // добавляю поля для подписки
     foreach (\app\services\Subscribe::$userFieldList as $field) {
         $fields[$field] = 1;
     }
     $user = User::insert($fields);
     \Yii::info('$fields: ' . \yii\helpers\VarDumper::dumpAsString($fields), 'gs\\fb_registration');
     $user->setAvatarFromUrl($attributes['photo_200']);
     return $user;
 }
Example #28
Show file File: CardForm.php Project: just-leo/cardgame-serial
0
 public function create()
 {
     /** @var CardRecord $card */
     $card = \Yii::createObject(CardRecord::className());
     $card->HardID = $this->HardID;
     if ($card->save()) {
         \Yii::info('Зарегистрирована новая карта - ' . $card->HardID . ' ID:' . $card->id, 'info');
     } else {
         \Yii::error('Не удалось зарегистрировать новую карту: ' . $card->getFirstError('HardID'), 'info');
     }
     return $card;
 }
Example #29
Show file File: Profiler.php Project: sdgdsffdsfff/allin1
0
 public static function log($key)
 {
     if (isset(self::$_profileInfo[$key])) {
         $timeCost = self::time($key);
         $logKey = 'ProfilerLog';
         $logMsg = "[key:{$key}][time(ms):{$timeCost}]";
     } else {
         $logKey = 'Profile Key Not Exist';
         $logMsg = "[key:{$key}]";
     }
     \Yii::info($logMsg, $logKey);
 }
Example #30
Show file File: ActionTimerFilter.php Project: sdgdsffdsfff/allin1
0
 public function afterAction($action, $result)
 {
     $key = $this->_getKey($action);
     Profiler::end($key);
     $timeCost = Profiler::time($key);
     Profiler::free($key);
     list($prefix, $actionInfo) = explode("\$", $key);
     $logKey = "Action Time Cost";
     $logMsg = "[action:{$actionInfo}][time(ms):{$timeCost}]";
     \Yii::info($logMsg, $logKey);
     return $result;
 }