本文整理汇总了PHP中Cake\Log\Log::debug方法的典型用法代码示例。如果您正苦于以下问题:PHP Log::debug方法的具体用法?PHP Log::debug怎么用?PHP Log::debug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\Log\Log
的用法示例。
在下文中一共展示了Log::debug方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
}
示例2: 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);
}
示例3: 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;
}
示例4: 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);
}
示例5: 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(['netadmin@smt.ufrj.br' => 'Controle de Usuarios'])->emailFormat('html')->to('suporte.intranetsmt@gmail.com')->subject('JOB Realizado')->send('Job Ajuste Base executado com sucesso.');
$this->set(compact('res', 'res_ldap', 'cats'));
}
示例6: userSignUp
public function userSignUp($userId)
{
if ($this->getTableObj()->insertUser($userId)) {
\Cake\Log\Log::debug('temp Userid inserted');
return SUCCESS;
}
return FAIL;
}
示例7: check
public function check($restaurantId)
{
$conditions = ['RestaurantId =' => $restaurantId, 'Active =' => ACTIVE];
$result = $this->connect()->find()->where($conditions);
if ($result->count()) {
\Cake\Log\Log::debug('restaurant checking result = ' . $result->count());
return true;
}
return false;
}
示例8: authorize
/**
* Hands authorization over to the AnnAuthorize class.
* @param array $user
* An array containing information about the user to authorize.
* @param Request $request
* Describes the request to authorize.
*/
public function authorize($user, Request $request)
{
$controller = $this->_registry->getController();
$action = $request->param('action');
$pass = $request->param('pass');
Log::debug(sprintf('Trying to authorize user %s for request %s/%s and parameters %s.', $user['username'], $controller->name, $action, json_encode($pass)));
$annAuthorization = AnnAuthorization::getInstance();
$authorized = $annAuthorization->authorizeRequest($user['id'], $controller, $action, $pass, $request);
Log::debug(sprintf('Authorization %s', $authorized ? 'was successful.' : 'failed.'));
return $authorized;
}
示例9: getData
/**
* @param $method
* @param array $data
* @return \Cake\Network\Http\Response
*/
protected function getData($method = '', $data = [])
{
$query = ['version' => 1.3, 'key' => $this->_API_KEY];
foreach ($data as $key => $value) {
$query[$key] = $value;
}
Log::debug($query);
$response = $this->http->get($this->_SERVER . $method, $query);
Log::debug($response->body);
return $response->json;
}
示例10: isLogin
public function isLogin()
{
$userName = $this->readCookie('un');
$password = $this->readCookie('pw');
$restaurantId = $this->readCookie('cri');
\Cake\Log\Log::debug('request come to check login');
if (isset($userName) and isset($password) and isset($restaurantId)) {
return TRUE;
}
return FALSE;
}
示例11: getPaymentOptions
public function getPaymentOptions()
{
$this->autoRender = FALSE;
if ($this->request->is('post')) {
$data = $this->getPaymetModes();
Log::debug(json_encode($data));
$this->response->body(json_encode($data));
} else {
$this->response->body(0);
}
}
示例12: getOrderDetails
public function getOrderDetails($orderDetailsId)
{
$conditions = ['OrderDetailsId =' => $orderDetailsId];
$orderDetails = $this->connect()->find()->where($conditions);
if ($orderDetails->count()) {
foreach ($orderDetails as $orderDetail) {
$orderDetailDto = new DownloadDTO\OrderDetailsDownloadDto($orderDetail->OrderDetailsId, $orderDetail->OrderPrice, $orderDetail->OrderQuantity, $orderDetail->OrderId, $orderDetail->MenuId, $orderDetail->SubMenuId, $orderDetail->MenuTitle, $orderDetail->Note);
Log::debug('OrderDetails goes in sync Table : Id -> ' . $orderDetailDto->orderDetailsId);
}
return $orderDetailDto;
}
}
示例13: editWhenAlways
public function editWhenAlways($id)
{
$entity = $this->Ips->get($id);
/** @var IpBehavior $behavior */
$this->Ips->removeBehavior('Ip');
Log::debug($this->Ips->behaviors()->loaded());
$this->Ips->addBehavior('IpBehavior.Ip', ['fields' => ['ip' => 'always']]);
if ($this->request->is(['post', 'put'])) {
$entity = $this->Ips->patchEntity($entity, $this->request->data());
$this->Ips->save($entity);
}
}
示例14: takeawayView
public function takeawayView()
{
$data = explode('/', $this->request->url);
Log::debug($data);
$set = ['option' => $data[1]];
if (in_array('placeorder', $data)) {
$takeawaySourceController = new TakeawaySourceController();
$set['source'] = $takeawaySourceController->getTakeawaySource();
$set['addNew'] = true;
}
$this->set($set);
}
示例15: getSingleCategory
public function getSingleCategory($categoryId)
{
$condition = ['TableCategoryId' => $categoryId];
$tableCategories = $this->connect()->find()->where($condition);
if (!$tableCategories->count()) {
Log::debug('Table Categories are not found');
return false;
}
foreach ($tableCategories as $category) {
$tableCategoryDto = new DownloadDTO\TableCategoryDownloadDto($category->TableCategoryId, $category->CategoryTitle, $category->Image);
}
return $tableCategoryDto;
}