• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Facades\Log类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Illuminate\Support\Facades\Log的典型用法代码示例。如果您正苦于以下问题:PHP Log类的具体用法?PHP Log怎么用?PHP Log使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     Log::info('Iniciando proceso de actualizacion de referencia de ventas');
     $sales = Sales::where('transaction_id', '-1')->get();
     foreach ($sales as $sale) {
         $ventasPorAplicar = DB::table('contabilidad_sales')->select('*')->whereRaw('credit_debit = ? and reference = ? ', ['credit', $sale->reference])->where('transaction_id', '<>', '-1')->groupBy('reference')->get();
         if (count($ventasPorAplicar) > 0) {
             // se encontraron referencias de venta nuevas
             foreach ($ventasPorAplicar as $ventaPorAplicar) {
                 $depositoAplicacionAnterior = DepositoAplicacion::where('venta_id', $sale->id)->get();
                 foreach ($depositoAplicacionAnterior as $depositoAplicacion) {
                     echo $depositoAplicacion->cantidad . ' ' . $depositoAplicacion->deposito_id . ' -- ' . $ventaPorAplicar->ammount . '-- ' . $ventaPorAplicar->ammount_applied . '-------';
                     if ($depositoAplicacion->estatus == 1) {
                         $deposito = new DepositoAplicacion(['deposito_id' => $depositoAplicacion->deposito_id, 'venta_id' => $ventaPorAplicar->id, 'estatus' => $depositoAplicacion->estatus, 'usuario_id' => $depositoAplicacion->usuario_id, 'cantidad' => $depositoAplicacion->cantidad]);
                         $ventaPorAplicar->ammount_applied = $depositoAplicacion->cantidad + ($ventaPorAplicar->ammount - $ventaPorAplicar->ammount_applied);
                     } else {
                         if (abs($depositoAplicacion->cantidad) >= $ventaPorAplicar->ammount - $ventaPorAplicar->ammount_applied) {
                             $ventaPorAplicar->ammount_applied = $depositoAplicacion->ammount;
                             $depositoAplicacion->cantidad = $depositoAplicacion->cantidad - ($ventaPorAplicar->ammount - $ventaPorAplicar->ammount_applied);
                         } else {
                             $ventaPorAplicar->ammount_applied = $ventaPorAplicar->ammount - $ventaPorAplicar->ammount_applied - $depositoAplicacion->cantidad;
                             $depositoAplicacion->cantidad = 0;
                         }
                         $deposito = new DepositoAplicacion(['deposito_id' => $depositoAplicacion->deposito_id, 'venta_id' => $ventaPorAplicar->id, 'estatus' => $depositoAplicacion->estatus, 'usuario_id' => $depositoAplicacion->usuario_id, 'cantidad' => -1 * ($ventaPorAplicar->ammount_applied - $ventaPorAplicar->ammount)]);
                     }
                     $deposito->save();
                     ${$ventaPorAplicar}->update();
                     $depositoAplicacion->delete();
                 }
             }
         }
     }
     Log::info('Finalizando proceso de actualizacion de referencia de ventas');
 }
开发者ID:gitfreengers,项目名称:larus,代码行数:39,代码来源:UpdateSalesCommand.php


示例2: send

 /**
  * {@inheritdoc}
  */
 public function send(Swift_Mime_Message $message, &$failedRecipients = null)
 {
     try {
         $to = implode(', ', array_keys((array) $message->getTo()));
         $cc = implode(', ', array_keys((array) $message->getCc()));
         $bcc = implode(', ', array_keys((array) $message->getBcc()));
         $replyto = '';
         foreach ((array) $message->getReplyTo() as $address => $name) {
             $replyto = $address;
             break;
         }
         $mail_options = ["sender" => "admin@{$this->app->getGaeAppId()}.appspotmail.com", "to" => $to, "subject" => $message->getSubject(), "htmlBody" => $message->getBody()];
         if ($cc !== '') {
             $mail_options['cc'] = $cc;
         }
         if ($bcc !== '') {
             $mail_options['bcc'] = $bcc;
         }
         if ($replyto !== '') {
             $mail_options['replyto'] = $replyto;
         }
         $attachments = $this->getAttachmentsArray($message);
         if (count($attachments) > 0) {
             $mail_options['attachments'] = $attachments;
         }
         $gae_message = new GAEMessage($mail_options);
         $gae_message->send();
     } catch (InvalidArgumentException $ex) {
         Log::warning("Exception sending mail: " . $ex);
     }
 }
开发者ID:wasay,项目名称:GaeSupportL5,代码行数:34,代码来源:GaeTransport.php


示例3: testStoreUpdateAndDelete

    /**
     * Test store, update and delete.
     */
    public function testStoreUpdateAndDelete()
    {
        $requestBody = <<<EOT
        {
          "data" : {
            "type" : "pricelists",
            "attributes" : {
              "company_id"   : "1",
              "name": "pricelist_1"
            }
          }
        }
EOT;
        // Create
        $response = $this->callPost(self::API_URL, $requestBody);
        $this->assertEquals(Response::HTTP_CREATED, $response->getStatusCode());
        $this->assertNotNull($obj = json_decode($response->getContent())->data);
        $this->assertNotEmpty($obj->id);
        //$this->assertNotEmpty($obj->headers->get('Location'));
        // re-read and check
        $this->assertNotNull($obj = json_decode($this->callGet(self::API_URL . $obj->id)->getContent())->data);
        $this->assertEquals('pricelist_1', $obj->attributes->name);
        // Update
        $requestBody = "{\n          \"data\" : {\n            \"type\" : \"pricelists\",\n            \"id\"   : \"{$obj->id}\",\n            \"attributes\" : {\n              \"company_id\" : \"1\",\n              \"name\" : \"pricelist_2\"\n            }\n          }\n        }";
        Log::info($requestBody);
        $response = $this->callPatch(self::API_URL . $obj->id, $requestBody);
        Log::info($response);
        $this->assertEquals(Response::HTTP_NO_CONTENT, $response->getStatusCode());
        // re-read and check
        $this->assertNotNull($obj = json_decode($this->callGet(self::API_URL . $obj->id)->getContent())->data);
        $this->assertEquals('pricelist_2', $obj->attributes->name);
        // Delete
        $response = $this->callDelete(self::API_URL . $obj->id);
        $this->assertEquals(Response::HTTP_NO_CONTENT, $response->getStatusCode());
    }
开发者ID:guduchango,项目名称:limoncello,代码行数:38,代码来源:PricelistTest.php


示例4: verifyNotify

 /**
  * 针对notify_url验证消息是否是支付宝发出的合法消息
  * @return 验证结果
  */
 function verifyNotify()
 {
     if (empty($_POST)) {
         //判断POST来的数组是否为空
         return false;
     } else {
         //生成签名结果
         $isSign = $this->getSignVerify($_POST, $_POST["sign"], true);
         //获取支付宝远程服务器ATN结果(验证是否是支付宝发来的消息)
         $responseTxt = 'true';
         if (!empty($_POST["notify_id"])) {
             $responseTxt = $this->getResponse($_POST["notify_id"]);
         }
         //写日志记录
         if ($this->alipay_config['log'] || true) {
             if ($isSign) {
                 $isSignStr = 'true';
             } else {
                 $isSignStr = 'false';
             }
             $log_text = "[===AliPay Notify===]responseTxt=" . $responseTxt . "\n notify_url_log:isSign=" . $isSignStr . "\n";
             $log_text = $log_text . $this->createLinkString($_POST);
             Log::info($log_text);
         }
         //验证
         //$responseTxt的结果不是true,与服务器设置问题、合作身份者ID、notify_id一分钟失效有关
         //isSign的结果不是true,与安全校验码、请求时的参数格式(如:带自定义参数等)、编码格式有关
         if (preg_match("/true\$/i", $responseTxt) && $isSign) {
             return true;
         } else {
             return false;
         }
     }
 }
开发者ID:devsnippet,项目名称:alipay-1,代码行数:38,代码来源:WebPay.php


示例5: push

 public function push($token, $data, $params)
 {
     try {
         $url = 'https://' . $this->config['host'];
         $fields = array('registration_ids' => array($token), 'data' => array_merge($data, ['data' => $params]));
         $headers = array('Authorization: key=' . $this->config['key'], 'Content-Type: application/json');
         // Open connection
         $ch = curl_init();
         // Set the url, number of POST vars, POST data
         curl_setopt($ch, CURLOPT_URL, $url);
         curl_setopt($ch, CURLOPT_POST, true);
         curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
         // Disabling SSL Certificate support temporarly
         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
         curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
         // Execute post
         $result = curl_exec($ch);
         if ($result === FALSE) {
             Log::error('Curl failed: ' . curl_error($ch));
             return false;
         }
         // Close connection
         curl_close($ch);
         return true;
     } catch (Exception $e) {
         Log::error($e);
         return false;
     }
 }
开发者ID:papertank,项目名称:origami-push,代码行数:30,代码来源:Android.php


示例6: report

 /**
  * Report or log an exception.
  *
  * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
  *
  * @param  \Exception  $e
  * @return void
  */
 public function report(Exception $e)
 {
     if ($this->shouldReport($e)) {
         Log::error($e);
     }
     parent::report($e);
 }
开发者ID:webfactorybulgaria,项目名称:Base,代码行数:15,代码来源:Handler.php


示例7: login

 public function login()
 {
     $response = $this->steam->validate();
     Log::alert(json_encode($this->steam));
     Log::alert(json_encode(\Config::get('steam-auth.api_key')));
     if ($response) {
         $info = $this->steam->getUserInfo();
         if (!is_null($info)) {
             $user = User::where('steam_id', $info->getSteamID64())->first();
             if (!is_null($user)) {
                 Auth::login($user, true);
                 return redirect('/');
                 // redirect to site
             } else {
                 $data = ['name' => $info->getNick(), 'steam_id' => $info->getSteamID64(), 'avatar' => $info->getProfilePictureFull()];
                 $user = User::create($data);
                 Auth::login($user, true);
                 return redirect('/');
                 // redirect to site
             }
         }
     } else {
         return $this->steam->redirect();
         // redirect to Steam login page
     }
 }
开发者ID:enizunic93,项目名称:SteamLotterry,代码行数:26,代码来源:AuthController.php


示例8: create

 /**
  * Create a user and return response
  *
  * @param array $data
  * @param CreatorListenerInterface $listener
  * @return mixed
  */
 public function create(array $data, CreatorListenerInterface $listener)
 {
     $valid = $this->userValidator->isValid($data);
     if (!$valid) {
         return $listener->onCreateFail($this->userValidator->getMessages());
     }
     $groups = empty($data['roles']) ? [] : $data['roles'];
     $data = $this->filterData($data);
     if ($this->auth->check()) {
         $user = $this->auth->user();
         $data['creator_id'] = $user->id;
     }
     try {
         $data['activated'] = true;
         $user = $this->userRepo->create($data);
         $this->events->fire('user.created', array($user));
         if (Sentry::getUser()->hasAnyAccess(['user.change_groups'])) {
             $this->groupRepo->addGroupsToUser($user, $groups);
         }
         return $listener->onCreateSuccess();
     } catch (InvalidArgumentException $e) {
         Log::error($e->getMessage());
         return $listener->onCreateFail([Lang::get('messages.operation_error')]);
     }
 }
开发者ID:Ajaxman,项目名称:SaleBoss,代码行数:32,代码来源:Creator.php


示例9: handle

 public function handle()
 {
     $users = User::all();
     foreach ($users as $user) {
         if ($user->message) {
             $client = new Client(['base_uri' => 'https://app.asana.com/api/1.0/', 'headers' => ['Authorization' => 'Bearer ' . $user->access_token]]);
             $response = $client->get('workspaces/8231054812149/tasks', ['query' => ['assignee' => $user->asana_id, 'completed_since' => 'now']]);
             $tasks = json_decode($response->getBody());
             $latestTaskId = $user->getLatestTask($tasks->data);
             if (!$user->latest_task_id) {
                 $user->latest_task_id = $latestTaskId;
                 $user->save();
                 continue;
             }
             $newTasks = $user->getNewTasks($tasks->data);
             if (!$newTasks) {
                 continue;
             }
             foreach ($newTasks as $newTask) {
                 $client->post('tasks/' . $newTask->id . '/stories', ['form_params' => ['text' => $user->message]]);
             }
             $user->latest_task_id = $latestTaskId;
             $user->save();
             Log::info('Message posted successfully', ['user' => $user->name, 'message' => $user->message, 'tasks' => $newTasks]);
         }
     }
 }
开发者ID:jahvi,项目名称:asana-responder,代码行数:27,代码来源:PostNewMessages.php


示例10: address

 public function address(Request $request)
 {
     $user = $this->getUserFromCookies($request);
     $cart = $this->getCartOrNewCart($user);
     $user->email = $request->get('email');
     $user->save();
     $address = null;
     if ($request->input('type') == Address::TYPE_SHIPPING) {
         $address = $cart->shippingAddress();
     } else {
         if ($request->input('type') == Address::TYPE_BILLING) {
             $address = $cart->billingAddress();
         }
     }
     if (!$address) {
         $address = new Address();
         $cart->addresses()->save($address);
     }
     $address->fill($request->all());
     $address->save();
     if ($address->type == Address::TYPE_SHIPPING) {
         $price = $cart->getTotalPrice();
         $util = new PaylineUtility();
         $response = $util->stepOne($address, $price);
         $xml = simplexml_load_string($response->getBody()->__toString());
         Log::Info($xml->{"form-url"});
         return $this->success(array("url" => $xml->{"form-url"}->__toString()));
     }
     return $this->success();
 }
开发者ID:hogggy,项目名称:infinite-wonder,代码行数:30,代码来源:AddressController.php


示例11: getOAuth2AccessToken

 /**
  * 通过code换取网页授权access_token
  * {
  *  "access_token": "OezXcEiiBSKSxW0eoylIeLbTirX__QgA7uW8WJE0Z2izAbnXV7DHbdHni-j9OoCq2Xqh5gLlPt0uAHtfYByOH80h1dwMrq74iALd_K359JYEN5KWKB7_sEz3T19V86sP9lSO5ZGbc-qoXUD3XZjEPw",
  *  "expires_in": 7200,
  *  "refresh_token": "OezXcEiiBSKSxW0eoylIeLbTirX__QgA7uW8WJE0Z2izAbnXV7DHbdHni-j9OoCqgBFR_ApctbH4Tk5buv8Rr3zb7T3_27zZXWIdJrmbGFoFzGUfOvnwX249iPoeNJ2HYDbzW5sEfZHkC5zS4Qr8ug",
  *  "openid": "oMzBIuI7ctx3n-kZZiixjchzBKLw",
  *  "scope": "snsapi_base"
  * }
  **/
 public function getOAuth2AccessToken(Request $request)
 {
     $code = $request->input('code');
     $res = AccessTokenService::getOAuth2AccessToken($code);
     Log::info($res);
     return response($res)->header('Content-Type', 'JSON');
 }
开发者ID:guoshijie,项目名称:weixin_php,代码行数:17,代码来源:AccessController.php


示例12: update

 public function update($data)
 {
     $response = new ApiResponse();
     $status = 200;
     $mission = Mission::find(\Request::get('id'));
     if ($mission == null) {
         $response->status = 'error';
         $response->message = ['id' => '', 'code' => 'mission_not_found', 'description' => 'The mission was not found'];
         $status = 400;
     } else {
         $mission = $this->sanitize($data, $mission);
         try {
             $this->radicalIntegrationManager->updateMission($mission);
         } catch (RadicalApiException $e) {
             Log::error($e);
             //For now ingore, see [CIT-380]
             //                $response->status = 'error';
             //                $response->message = $e->getMessage();
             //                $status = 500;
         }
         $mission->save();
         $response->status = 'success';
         $response->message = $mission->id;
     }
     return \Response::json($response, $status);
 }
开发者ID:scify,项目名称:city-r-us-service,代码行数:26,代码来源:MissionService.php


示例13: update

 /**
  * Update the profile based on the form submission
  * @param ProfileUpdateRequest $request
  * @return \Illuminate\Http\RedirectResponse
  */
 public function update(ProfileUpdateRequest $request)
 {
     $contact = $this->getContact();
     $contact->setName($request->input('name'));
     $contact->setRole($request->input('role'));
     $contact->setEmailAddress($request->input('email_address'));
     try {
         $work = $contact->getPhoneNumber(PhoneNumber::WORK);
         $work->setNumber(preg_replace("/[^0-9]/", "", $request->input('work_phone')));
         $contact->setPhoneNumber($work);
         $mobile = $contact->getPhoneNumber(PhoneNumber::MOBILE);
         $mobile->setNumber(preg_replace("/[^0-9]/", "", $request->input('mobile_phone')));
         $contact->setPhoneNumber($mobile);
         $home = $contact->getPhoneNumber(PhoneNumber::HOME);
         $home->setNumber(preg_replace("/[^0-9]/", "", $request->input('home_phone')));
         $contact->setPhoneNumber($home);
         $fax = $contact->getPhoneNumber(PhoneNumber::FAX);
         $fax->setNumber(preg_replace("/[^0-9]/", "", $request->input('fax')));
         $contact->setPhoneNumber($fax);
     } catch (Exception $e) {
         return redirect()->back()->withErrors($e->getMessage());
     }
     $contactController = new ContactController();
     try {
         $contactController->updateContact($contact);
     } catch (Exception $e) {
         Log::error($e->getMessage());
         return redirect()->back()->withErrors(trans("errors.failedToUpdateProfile"));
     }
     $this->clearProfileCache();
     return redirect()->action("ProfileController@show")->with('success', trans("profile.profileUpdated"));
 }
开发者ID:sonarsoftware,项目名称:customer_portal,代码行数:37,代码来源:ProfileController.php


示例14: ctlStore

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function ctlStore(Request $request)
 {
     Log::info('Received CTL Erase request for: ' . $request->input('macAddress'));
     $this->dispatch(new EraseTrustList($request->input('macAddress'), 'ctl'));
     Flash::success('Processed Request.  Check table below for status.');
     return redirect('ctl');
 }
开发者ID:shibahr,项目名称:uc-toolkit,代码行数:12,代码来源:EraserController.php


示例15: fire

 public function fire($job, $data)
 {
     // build the event data
     $event_data = $this->event_builder->buildBlockEventData($data['hash']);
     // fire an event
     try {
         Log::debug("Begin xchain.block.received {$event_data['height']} ({$event_data['hash']})");
         Event::fire('xchain.block.received', [$event_data]);
         Log::debug("End xchain.block.received {$event_data['height']} ({$event_data['hash']})");
         // job successfully handled
         $job->delete();
     } catch (Exception $e) {
         EventLog::logError('BTCBlockJob.failed', $e, $data);
         // this block had a problem
         //   but it might be found if we try a few more times
         $attempts = $job->attempts();
         if ($attempts > self::MAX_ATTEMPTS) {
             // we've already tried MAX_ATTEMPTS times - give up
             Log::debug("Block {$data['hash']} event failed after attempt " . $attempts . ". Giving up.");
             $job->delete();
         } else {
             $release_time = 2;
             Log::debug("Block {$data['hash']} event failed after attempt " . $attempts . ". Trying again in " . self::RETRY_DELAY . " seconds.");
             $job->release(self::RETRY_DELAY);
         }
     }
 }
开发者ID:CryptArc,项目名称:xchain,代码行数:27,代码来源:BTCBlockJob.php


示例16: listenToUpload

 /**
  * Listen to Upload
  *
  * Observe Uploadable models for changes. Should be called from the boot() method.
  * @return void
  */
 protected function listenToUpload()
 {
     if (!($model = $this->getModelClass())) {
         return;
     }
     if (Config::get('app.debug')) {
         Log::debug('Binding upload relationship caches', ['uploadable' => $model]);
     }
     $flush_uploadable = function ($uploadable) {
         $repository = $this->make($uploadable);
         $tags = $repository->getTags('uploads');
         if (Config::get('app.debug')) {
             Log::debug('Flushing uploadable relationship caches', ['uploadable' => $repository->id, 'tags' => $tags]);
         }
         Cache::tags($tags)->flush();
     };
     $model::updated($flush_uploadable);
     $model::deleted($flush_uploadable);
     $flush_upload = function ($upload) use($model) {
         $repository = Upload::make($upload);
         $tags = $repository->getTags($model);
         if (Config::get('app.debug')) {
             Log::debug('Flushing upload relationship caches', ['model' => $model, 'tags' => $tags]);
         }
         Cache::tags($tags)->flush();
         foreach ($this->withUpload($repository) as $uploadable) {
             $uploadable->getModel()->touch();
         }
     };
     $upload_model = Upload::getModelClass();
     $upload_model::updated($flush_upload);
     $upload_model::deleted($flush_upload);
 }
开发者ID:C4Tech,项目名称:laravel-upload,代码行数:39,代码来源:RepositoryTrait.php


示例17: downloadFileInWindowsNT

 protected function downloadFileInWindowsNT(TFFile $file)
 {
     $client = new Client();
     try {
         $response = $client->get($file->source, ['verify' => false]);
     } catch (\Exception $e) {
         $error = 'TFDownloader: Downloading file failed, url is %s, msg is %s.';
         $error = sprintf($error, $file->source, $e->getMessage());
         Log::error($error);
         $file->state = 'error';
         $file->error = $error;
         $file->save();
         return;
     }
     if ($response->getStatusCode() == 200) {
         $location = 'file/' . $file->name;
         Storage::put($location, $response->getBody());
         $file->state = 'downloaded';
         $file->location = $location;
         $file->save();
         return;
     } else {
         $error = 'TFDownloader: Bad HTTP response code in downloading videos, url is %s, status code is %d.';
         $error = sprintf($error, $file->source, $response->getStatusCode());
         Log::error($error);
         $file->state = 'error';
         $file->error = $error;
         $file->save();
         return;
     }
 }
开发者ID:roslairy,项目名称:tumfetch,代码行数:31,代码来源:TFDownloader.php


示例18: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     try {
         $response = $next($request);
         // always render exceptions ourselves
         if (isset($response->exception) and $response->exception) {
             throw $response->exception;
         }
         return $response;
     } catch (HttpResponseException $e) {
         // HttpResponseException can pass through
         throw $e;
     } catch (ValidationException $e) {
         $validator = $e->validator;
         $flat_errors = [];
         foreach ($validator->errors()->getMessages() as $errors) {
             $flat_errors = array_merge($flat_errors, array_values($errors));
         }
         $response = new JsonResponse(['message' => "The request was not processed successfully. " . implode(" ", $flat_errors), 'errors' => $flat_errors], 422);
         return $response;
     } catch (Exception $e) {
         \Illuminate\Support\Facades\Log::debug("HandleAPIErrors caught " . get_class($e) . " " . $e->getMessage());
         try {
             $error_trace = $this->getExceptionTraceAsString($e);
         } catch (Exception $other_e) {
             $error_trace = "FAILED getExceptionTraceAsString: " . $other_e->getMessage() . "\n\n" . $e->getTraceAsString();
         }
         $this->event_log->logError('error.api.uncaught', $e, ['errorTrace' => $error_trace]);
         // catch any uncaught exceptions
         //   and return a 500 response
         $response = new JsonResponse(['message' => 'Unable to process this request', 'errors' => ['Unexpected error']], 500);
         return $response;
     }
 }
开发者ID:tokenly,项目名称:laravel-api-provider,代码行数:41,代码来源:HandleAPIErrors.php


示例19: updateCommand

 function updateCommand($git, $branch, $location, $domainId)
 {
     return Remote::run(['cd ' . base_path() . '; ~/.composer/vendor/bin/envoy run update --git=' . $git . ' --branch=' . $branch . ' --location=' . $location], function ($line) {
         Log::info($line);
         echo $line . '<br />';
     });
 }
开发者ID:codeboard,项目名称:gitmanagement,代码行数:7,代码来源:TaskRunner.php


示例20: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $keyword = $this->argument('keyword');
     $channel = Yt::getChannelByName('allocine');
     if (!empty($channel)) {
         $manager = new \MongoDB\Driver\Manager('mongodb://localhost:27017');
         $collection = new \MongoDB\Collection($manager, 'laravel.stats');
         $collection->deleteMany([]);
         $collection = new \MongoDB\Collection($manager, 'laravel.stats');
         $stat = ['origin' => 'Youtube', 'type' => 'search', 'data' => $channel, 'created' => new \MongoDB\BSON\UTCDatetime(time())];
         $collection->insertOne($stat);
     }
     $params = ['q' => $keyword, 'type' => 'video', 'part' => 'id, snippet', 'maxResults' => 30];
     $videos = Yt::searchAdvanced($params, true)['results'];
     if (!empty($videos)) {
         $collection = new \MongoDB\Collection($manager, 'laravel.videos');
         $collection->deleteMany([]);
         foreach ($videos as $video) {
             $collection = new \MongoDB\Collection($manager, 'laravel.videos');
             $stat = ['data' => $video, 'created' => new \MongoDB\BSON\UTCDatetime(time())];
             $collection->insertOne($stat);
         }
     }
     Log::info("Import de l'API Youtube video done! ");
 }
开发者ID:Symfomany,项目名称:laravelcinema,代码行数:30,代码来源:Youtube.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Facades\Mail类代码示例发布时间:2022-05-23
下一篇:
PHP Facades\Lang类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap