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

PHP Log\Log类代码示例

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

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



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

示例1: setUp

 /**
  * setup, create mocks
  *
  * @return Mock object
  */
 public function setUp()
 {
     parent::setUp();
     $this->stderr = $this->getMock('Cake\\Console\\ConsoleOutput', [], [], '', false);
     $this->Error = $this->getMock('Cake\\Console\\ConsoleErrorHandler', ['_stop'], [['stderr' => $this->stderr]]);
     Log::drop('stderr');
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:12,代码来源:ConsoleErrorHandlerTest.php


示例2: onControllerInit

 public function onControllerInit($event)
 {
     $controller = $event->subject();
     if (isset($controller->request->params['prefix'])) {
         $menuFile = $controller->request->params['prefix'] . '_menus';
         if ($theme = Configure::read('App.admin.theme')) {
             if ($theme != '' && $theme != 'RearEngine' && Plugin::loaded($theme)) {
                 $controller->viewBuilder()->theme($theme);
             }
         }
         foreach (Plugin::loaded() as $plugin) {
             try {
                 Configure::load($plugin . '.' . $menuFile, 'default', true);
             } catch (\Exception $e) {
                 if (Configure::read('debug')) {
                     Log::warning('Unable to load app ' . $plugin . '/Config/' . $menuFile . ' config file', ['scope' => 'RearEngine plugin']);
                 }
             }
         }
         try {
             Configure::load($menuFile, 'default', true);
         } catch (\Exception $e) {
             if (Configure::read('debug')) {
                 Log::warning('Unable to load App/Config/' . $menuFile . ' config file.', ['scope' => 'RearEngine plugin']);
             }
         }
     }
 }
开发者ID:mindforce,项目名称:cakephp-rear-engine,代码行数:28,代码来源:CoreEvent.php


示例3: customerVisitReport

 public function customerVisitReport()
 {
     $this->autoRender = false;
     $restaurantId = $this->request->query('id');
     \Cake\Log\Log::debug('Ajax request visited with RestaurantId :-' . $restaurantId);
     $customerVisitReportData = $this->getTableObj()->getdata($restaurantId);
     if (is_null($customerVisitReportData)) {
         $this->response->body(0);
         return;
     }
     $intermediate = [];
     foreach ($this->objKey as $key => $value) {
         $intermediate[$value] = 0;
     }
     foreach ($customerVisitReportData as $reportData) {
         for ($i = 0; $i < count($this->timeSlot); $i++) {
             $index = $this->objKey[$i];
             $intermediate[$index] = $intermediate[$index] + $reportData->{$index};
         }
     }
     $data[] = null;
     $ind = 0;
     foreach ($intermediate as $key => $value) {
         $data[$ind++] = new DownloadDTO\RushHourReportDto($value, $this->timeSlot[$key], $this->timeSlot[$key]);
     }
     $chartData = json_encode($data);
     $this->response->body($chartData);
 }
开发者ID:Vibeosys,项目名称:RorderWeb,代码行数:28,代码来源:CustomerVisitController.php


示例4: main

 /**
  * Start the shell and interactive console.
  *
  * @return int|void
  */
 public function main()
 {
     if (!class_exists('Psy\\Shell')) {
         $this->err('<error>Unable to load Psy\\Shell.</error>');
         $this->err('');
         $this->err('Make sure you have installed psysh as a dependency,');
         $this->err('and that Psy\\Shell is registered in your autoloader.');
         $this->err('');
         $this->err('If you are using composer run');
         $this->err('');
         $this->err('<info>$ php composer.phar require --dev psy/psysh</info>');
         $this->err('');
         return 1;
     }
     $this->out("You can exit with <info>`CTRL-C`</info> or <info>`exit`</info>");
     $this->out('');
     Log::drop('debug');
     Log::drop('error');
     $this->_io->setLoggers(false);
     restore_error_handler();
     restore_exception_handler();
     $psy = new PsyShell();
     $psy->run();
     return 0;
 }
开发者ID:bostontrader,项目名称:acctwerx,代码行数:30,代码来源:ConsoleShell.php


示例5: saveNetworkDeviceInfo

 public function saveNetworkDeviceInfo(DTO\ClsNetworkDeviceInfoDto $infoDto)
 {
     if ($infoDto and !$this->isPresent($infoDto->userId)) {
         $entity = $this->connect()->newEntity();
         $entity->UserId = $infoDto->userId;
         $entity->Board = $infoDto->board;
         $entity->Brand = $infoDto->brand;
         $entity->Manufacturer = $infoDto->manufacturer;
         $entity->Model = $infoDto->model;
         $entity->Product = $infoDto->product;
         $entity->FmVersion = $infoDto->fmVersion;
         $entity->IpAddress = $infoDto->ip;
         $entity->City = $infoDto->city;
         $entity->Region = $infoDto->region;
         $entity->Country = $infoDto->country;
         if ($this->connect()->save($entity)) {
             \Cake\Log\Log::debug("User Network Device Info save in database for userid : " . $infoDto->userId);
             return SUCCESS;
         }
         \Cake\Log\Log::error("User Network Device Info not save in database for userid : " . $infoDto->userId);
         return FAIL;
     }
     \Cake\Log\Log::error(" userid : " . $infoDto->userId . " record exist in database");
     return FAIL;
 }
开发者ID:Vibeosys,项目名称:NewTravelWebAppRepo,代码行数:25,代码来源:NetworkDeviceInfoTable.php


示例6: index

 public function index()
 {
     $this->autoRender = false;
     $restaurantId = $this->request->query('restaurantId');
     $imei = $this->request->query('imei');
     $macAddress = $this->isNull($this->request->query('macId'));
     $info = base64_decode($this->request->query('info'));
     $ipAddress = $this->request->clientIp();
     $restaurantIMEIController = new RestaurantImeiController();
     if (!$restaurantIMEIController->isPresent($restaurantId, $imei, $macAddress)) {
         $this->response->body(DTO\ErrorDto::prepareError(116));
         \Cake\Log\Log::error("request with incorrect restaurantId :- " . $restaurantId);
         return;
     }
     $restaurantController = new RestaurantController();
     \Cake\Log\Log::info('Request is in Download Controller');
     if ($restaurantController->isValidate($restaurantId) and !empty($info)) {
         $networkDeviceDto = UploadDTO\NetworkDeviceInfoDto::Deserialize($info);
         $ipInfo = new Component\Ipinfo();
         $ipDetails = $ipInfo->getFullIpDetails($imei, $networkDeviceDto, $ipAddress);
         $networkDeviceController = new NetworkDeviceController();
         $addNetworkDeviceInfo = $networkDeviceController->addNetworkDeviceInfo($ipDetails, $restaurantId, $macAddress);
         $sqliteController = new SqliteController();
         $sqliteController->getDB($restaurantId);
     } else {
         $this->response->body(DTO\ErrorDto::prepareError(100));
     }
 }
开发者ID:Vibeosys,项目名称:RorderWeb,代码行数:28,代码来源:DownloadDbController.php


示例7: main

 /**
  * Override main() to handle action
  * Starts a Queuesadilla worker
  *
  * @return void
  */
 public function main()
 {
     $logger = Log::engine($this->getLoggerName('stdout'));
     $engine = $this->getEngine($logger);
     $worker = $this->getWorker($engine, $logger);
     $worker->work();
 }
开发者ID:josegonzalez,项目名称:cakephp-queuesadilla,代码行数:13,代码来源:QueuesadillaShell.php


示例8: fetchStudentOrganizations

 /**
  * @author team_syzzygy
  * @param Connection $dbConnection
  * @param unknown $studentId
  * Fetch student organizations based on the studentId provided
  */
 public function fetchStudentOrganizations(Connection $dbConnection, $studentId)
 {
     $studentTable = $this->getStudentReference();
     Log::write('debug', "Student Id passed into fetchStudentOrganizations method is " . $studentId);
     $temp = $studentTable->find()->where(['Student_ID' => $studentId])->contain(['StudentOrganizationTypeT'])->first();
     return $temp;
 }
开发者ID:KarimaLadhani,项目名称:cakephp,代码行数:13,代码来源:StudentTTable.php


示例9: write

 public static function write($type, $message, $params = [], $trace_level = 0, $log_options = [])
 {
     $trace_level += 1;
     $trace = self::traceMessage($trace_level);
     $output = call_user_func_array('sprintf', array_merge([$message], $params));
     CakeLog::write($type, $trace . ' - ' . $output, $log_options);
 }
开发者ID:dehare,项目名称:cake-tracelog,代码行数:7,代码来源:TraceLog.php


示例10: testValidKeyName

 /**
  * test config() with valid key name
  *
  * @return void
  */
 public function testValidKeyName()
 {
     Log::config('stdout', ['engine' => 'File']);
     Queue::config('valid', ['url' => 'mysql://username:password@localhost:80/database']);
     $engine = Queue::engine('valid');
     $this->assertInstanceOf('josegonzalez\\Queuesadilla\\Engine\\MysqlEngine', $engine);
 }
开发者ID:cleptric,项目名称:cakephp-queuesadilla,代码行数:12,代码来源:QueueTest.php


示例11: main

 /**
  * Start the shell and interactive console.
  *
  * @return void
  */
 public function main()
 {
     if (!class_exists('Boris\\Boris')) {
         $this->err('<error>Unable to load Boris\\Boris.</error>');
         $this->err('');
         $this->err('Make sure you have installed boris as a dependency,');
         $this->err('and that Boris\\Boris is registered in your autoloader.');
         $this->err('');
         $this->err('If you are using composer run');
         $this->err('');
         $this->err('<info>$ php composer.phar require d11wtq/boris</info>');
         $this->err('');
         return 1;
     }
     if (!function_exists('pcntl_signal')) {
         $this->err('<error>No process control functions.</error>');
         $this->err('');
         $this->err('You are missing the pcntl extension, the interactive console requires this extension.');
         return 2;
     }
     $this->out('You can exit with <info>CTRL-D</info>');
     Log::drop('debug');
     Log::drop('error');
     $this->_io->setLoggers(false);
     restore_error_handler();
     restore_exception_handler();
     $boris = new Boris('app > ');
     $boris->start();
 }
开发者ID:franky0930,项目名称:MarketingConnex,代码行数:34,代码来源:ConsoleShell.php


示例12: takeawayInsert

 public function takeawayInsert(UploadDTO\TakeawayUploadDto $takeawayRequest, $restaurantId)
 {
     try {
         $tableObj = $this->connect();
         $newEntity = $tableObj->newEntity();
         $newEntity->TakeawayId = $takeawayRequest->takeawayId;
         $newEntity->TakeawayNo = $takeawayRequest->takeawayNo;
         $newEntity->Discount = $takeawayRequest->discount;
         $newEntity->DeliveryCharges = $takeawayRequest->deliveryCharges;
         $newEntity->CustId = $takeawayRequest->custId;
         $newEntity->RestaurantId = $restaurantId;
         $newEntity->UserId = $takeawayRequest->userId;
         $newEntity->SourceId = $takeawayRequest->sourceId;
         $newEntity->CreatedDate = date(VB_DATE_TIME_FORMAT);
         $newEntity->UpdatedDate = date(VB_DATE_TIME_FORMAT);
         if ($tableObj->save($newEntity)) {
             Log::debug('Takeaway entry stored for custId :- ' . $takeawayRequest->custId);
             return $takeawayRequest->takeawayNo;
         }
         Log::error('Takeaway entry stored for custId :- ' . $takeawayRequest->custId);
         return FALSE;
     } catch (Exception $ex) {
         return FALSE;
     }
 }
开发者ID:Vibeosys,项目名称:RorderWeb,代码行数:25,代码来源:TakeawayTable.php


示例13: ajustabase

 public function ajustabase()
 {
     $Usuario = TableRegistry::get("usuario");
     $Categoria = TableRegistry::get("categoria");
     $usuarios = $Usuario->find()->where(['usuario.historico' => 0, 'usuario.pendente' => 0, 'usuario.idUsuario is not' => 0]);
     $ldap = new LDAP(3);
     $res = array();
     $res_ldap = array();
     $cats = array();
     foreach ($usuarios as $usuario) {
         $obj = $ldap->getUsers("(uid=*{$usuario->login}*)");
         Log::debug($obj);
         $usuario->nomeUsuario = $obj[0]["cn"][0];
         $usuario->dre = isset($obj[0]["smtdre"][0]) ? $obj[0]["smtdre"][0] : '';
         $usuario->logradouro = isset($obj[0]["street"][0]) ? $obj[0]["street"][0] : '';
         $usuario->complemento = isset($obj[0]["smtcomplemento"][0]) ? $obj[0]["smtcomplemento"][0] : '';
         $usuario->cidade = isset($obj[0]["smtcidade"][0]) ? $obj[0]["smtcidade"][0] : '';
         $usuario->bairro = isset($obj[0]["smtbairro"][0]) ? $obj[0]["smtbairro"][0] : '';
         $usuario->pais = isset($obj[0]["smtpais"][0]) ? $obj[0]["smtpais"][0] : '';
         $usuario->estado = isset($obj[0]["smtuf"][0]) ? $obj[0]["smtuf"][0] : '';
         $usuario->codigoPostal = isset($obj[0]["homepostaladdress"][0]) ? $obj[0]["homepostaladdress"][0] : '';
         $usuario->rg = isset($obj[0]['smtrg'][0]) ? $obj[0]['smtrg'][0] : '';
         $usuario->cpf = isset($obj[0]['smtcpf'][0]) ? $this->formataCpf($obj[0]['smtcpf'][0]) : '';
         $usuario->email = isset($obj[0]['mail'][0]) ? $obj[0]['mail'][0] : '';
         $usuario->tel_fixo = isset($obj[0]['telephonenumber'][0]) ? $obj[0]['telephonenumber'][0] : '';
         $usuario->tel_cel = isset($obj[0]['mobile'][0]) ? $obj[0]['mobile'][0] : '';
         $nascimento = isset($obj[0]['smtnascimento'][0]) ? $obj[0]['smtnascimento'][0] : '19000101';
         $usuario->data_nascimento = substr($nascimento, 6, 2) . '/' . substr($nascimento, 4, 2) . '/' . substr($nascimento, 0, 4);
         $usuario->data_exp = isset($obj[0]['smtdataexpiracao'][0]) ? $obj[0]['smtdataexpiracao'][0] : '';
         $usuario->cadastro = isset($obj[0]['smtdatacadastro'][0]) ? $obj[0]['smtdatacadastro'][0] : '';
         //$usuario->ativo = (isset($obj[0]['smtbool'][0])) ? ($obj[0]['smtbool'][0] == 'FALSE') ? false :  true : '';
         $loginResp = str_replace('uid=', '', explode(',', $obj[0]['smtprofresp'][0])[0]);
         $id = $Usuario->find()->where(['login' => $loginResp, 'idTipoUsuario' => 2]);
         if ($id->count() > 0) {
             $usuario->profResponsavel = $id->first()->idUsuario;
         }
         if (isset($obj[0]['smtgroups'])) {
             foreach ($obj[0]['smtgroups'] as $grupo) {
                 $busca = $Usuario->Projeto->find('all', ['conditions' => ['grupo' => "{$grupo}"]]);
                 $number = $busca->count();
                 if ($number > 0) {
                     $proj = $Usuario->Projeto->find()->where(['grupo' => "{$grupo}"])->first();
                     $usuario->idProjeto = $proj->idprojeto;
                     break;
                 }
             }
         }
         if (isset($obj[0]['smtcategoria'])) {
             $cat = $Categoria->find('all')->where(['upper(nomeCategoria)' => strtoupper($obj[0]['smtcategoria'][0])])->first();
             $usuario->idCategoria = $cat->idCategoria;
         }
         array_push($res_ldap, $obj);
         array_push($res, $usuario);
         array_push($cats, $cat);
         $Usuario->save($usuario);
     }
     $aviso = new Email('gmail');
     $aviso->from(['[email protected]' => 'Controle de Usuarios'])->emailFormat('html')->to('[email protected]')->subject('JOB Realizado')->send('Job Ajuste Base executado com sucesso.');
     $this->set(compact('res', 'res_ldap', 'cats'));
 }
开发者ID:gbauso,项目名称:asirb,代码行数:60,代码来源:JobController.php


示例14: auth

 /**
  * Auth method
  *
  * @return void Redirects on successful add, renders view otherwise.
  */
 public function auth()
 {
     //ログイン処理
     // パラメータの受取
     $name = $this->request->data['userId'];
     $pass = $this->request->data['pass'];
     //Usersテーブルを検索
     $tableUsers = TableRegistry::get('Users');
     $queryStr = "select name from users where name='" . $name . "' and password = '" . $pass . "'";
     // パスワード入力値 or 1=1;--
     //$queryStr = "select name from users where name='" . $name . "' and password = '" . $pass . "' or 1=1";
     Log::write('debug', $queryStr);
     //SQL発行
     $data = $tableUsers->connection()->query($queryStr);
     //配列のサイズで判定する
     $cnt = sizeof($data);
     if ($cnt == 0) {
         //レコードなし認証NGとする
         Log::write('debug', '認証エラー');
         $this->Flash->error('Auth Error: id or password is incorrect');
         // ログイン画面に戻る
         return $this->redirect(['action' => '../Login/index']);
     }
     Log::write('debug', '認証OK');
     foreach ($data as $key => $value) {
         Log::write('debug', 'userName is :' . $value['name']);
         $this->request->session()->write('loginUser', $value['name']);
     }
     // 成功した場合は記事一覧へ
     return $this->redirect(['action' => '../Articles/index']);
 }
开发者ID:kikituki,项目名称:cakephp3,代码行数:36,代码来源:LoginController.php


示例15: index

 public function index()
 {
     $this->autoRender = false;
     $userId = $this->request->query("userId");
     $restaurantId = $this->request->query("restaurantId");
     \Cake\Log\Log::debug("Download request come with userId  :- " . $userId . ' restaurantId :- ' . $restaurantId);
     if (empty($userId) or empty($restaurantId)) {
         $this->response->body(DTO\ErrorDto::prepareError(101));
         \Cake\Log\Log::error("userId or restaurantID is blank ");
         return;
     }
     $restaurantController = new RestaurantController();
     if (!$restaurantController->isValidate($restaurantId)) {
         $this->response->body(DTO\ErrorDto::prepareError(100));
         \Cake\Log\Log::error("request with incorrect restaurantId :- " . $restaurantId);
         return;
     }
     $userController = new UserController();
     if (!$userController->isUserValid($userId, $restaurantId)) {
         $this->response->body(DTO\ErrorDto::prepareError(102));
         \Cake\Log\Log::error("request with incorrect  userId :- " . $userId);
         return;
     }
     \Cake\Log\Log::debug('Download request is validate successfully ');
     $syncController = new SyncController();
     $syncController->download($userId, $restaurantId);
 }
开发者ID:Vibeosys,项目名称:RorderWeb,代码行数:27,代码来源:DownloadController.php


示例16: setUp

 /**
  * setup, create mocks
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->stderr = $this->getMockBuilder('Cake\\Console\\ConsoleOutput')->disableOriginalConstructor()->getMock();
     $this->Error = $this->getMockBuilder('Cake\\Console\\ConsoleErrorHandler')->setMethods(['_stop'])->setConstructorArgs([['stderr' => $this->stderr]])->getMock();
     Log::drop('stderr');
 }
开发者ID:rashmi,项目名称:newrepo,代码行数:12,代码来源:ConsoleErrorHandlerTest.php


示例17: testSummary

 /**
  * Test that the log panel outputs a summary.
  *
  * @return void
  */
 public function testSummary()
 {
     Log::write('error', 'Test');
     $this->assertEquals(1, $this->panel->summary());
     Log::write('error', 'Test 2');
     Log::write('notice', 'A thing');
     $this->assertEquals(3, $this->panel->summary());
 }
开发者ID:meotimdihia,项目名称:cakephp-test-elasticsearch,代码行数:13,代码来源:LogPanelTest.php


示例18: tearDown

 /**
  * tearDown method
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
     Log::drop('email');
     Email::drop('test');
     Email::dropTransport('debug');
     Email::dropTransport('test_smtp');
 }
开发者ID:dereuromark,项目名称:cakephp-tools,代码行数:13,代码来源:EmailTest.php


示例19: toArray

 /**
  * 	
  * @return array Um array com os dados da resposta.
  */
 public function toArray()
 {
     if (is_null($this->_response->json)) {
         Log::write('debug', print_r($this->_response->body));
         return ['success' => false, 'message' => 'Erro na resposta recebida do servidor.'];
     }
     return $this->_response->json;
 }
开发者ID:mswagencia,项目名称:msw-appcore,代码行数:12,代码来源:ApiResponse.php


示例20: userSignUp

 public function userSignUp($userId)
 {
     if ($this->getTableObj()->insertUser($userId)) {
         \Cake\Log\Log::debug('temp Userid inserted');
         return SUCCESS;
     }
     return FAIL;
 }
开发者ID:Vibeosys,项目名称:NewTravelWebAppRepo,代码行数:8,代码来源:UserController.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP Mailer\Email类代码示例发布时间:2022-05-23
下一篇:
PHP I18n\Time类代码示例发布时间: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