PhpStorm + Xdebug + CakePHP

I've coded a new project into PhpStorm using CakePHP framework. I've installed Xdebug following this gist but I'm not able to debug my code. If I run validation script into Run >> Web Server Debug Validation in PhpStorm, I get every time whic...
more »

2017-10-04 19:10 (0) Answers

CakePHP 3 Cache File Permissions

I have a CakePHP 3 app with shells that I run from crontab. When I run the shells through crontab, it creates cache files owned by the user running the crontab, which is not the user that runs apache... Sometimes when I run the crontab the cached ...
more »

2017-10-04 06:10 (0) Answers

unable to send mail with cakephp 2.x

I start in cakephp, my worry is that when I try to send a mail I have the following error: Network is unreachable Error: An Internal Error Has Occurred. Stack Trace CORE/Cake/Network/Email/SmtpTransport.php line 155 → CakeSocket->connect() CO...
more »

2017-10-03 11:10 (0) Answers

Error: Uncaught TypeError: Argument 1 passed to

Error: Uncaught TypeError: Argument 1 passed to ErrorHandler::handleException() must be an instance of Exception, instance of ParseError given in C:\xampp\htdocs\myuniv.co.in\lib\Cake\Error\ErrorHandler.php:116 Stack trace: #0 [internal function]: Er...
more »

2017-10-03 07:10 (0) Answers

query cakephp2 with date dynamic

how to do query in cakephp2, with a dynamic date from the form SELECT centro_id, (sum(timestampdiff(minute, hora_inicio, hora_fin)))/(720*(SELECT datediff(date_format(now(), '%Y-%m-%d'), '2013-07-01')))*100 FROM `sesions` where fecha BETWEEN '2013-0...
more »

2017-10-02 21:10 (0) Answers

cakephp find Model instead of read

I can't load my Model with 'find' but can load that with 'read'. I want to get Model attributes by order. But I think 'read' function doesn't have that. How can I use 'find' instead of 'read'? It works $itemfiles = $this->Item->read(null, $...
more »

2017-10-02 19:10 (1) Answers

subquery and sum in cakephp 2

I have this query, but it does not work for me, a similar one works on the controller $sesion_pagada = $this->Centro->find('all', array( array('fields' => 'Centro.nombre', SUM(IF('Paciente.sexo' = 'F', 'Zona.valor_mujer', 'Zona.v...
more »

2017-10-02 17:10 (0) Answers

query with if in cake php 2

I'm trying to get data with an if in Cakephp version 2 $this->Zona->find( 'list', array( 'fields' => array('nombre', 'IF(tiempo_hombre=0, tiempo_mujer, tiempo_hombre ') but I get an error ...
more »

2017-10-02 15:10 (0) Answers

Password Not Getting Updated CakePHP

I am trying to reset the password but it doesn't update. Can someone fix this? I am getting an error message saying I'm not submitting enough non-code so this is filler. This is reset.ctp: <?php echo $this->Form->create('User', array('acti...
more »

2017-10-02 13:10 (0) Answers

How to do join with 3 tables in CakePHP 2.x

I am new in cakephp and I would like to do join with cakephp version 2.x. I have 3 tables : users = id, username, pass, groupd_id, role projects = id, name, start_date, end_date, category assigns = id, project_id, user_id I would like to do like...
more »

2017-10-01 15:10 (0) Answers

cakephp 3 add default class to inputs

i'm trying to add a default class for each input in my cakephp 3 app. Example of what i want: Input: <echo $this->Form->control('email'); Output: <input class="form-control" class="is-invalid"/> Desired output: <input class="form...
more »

2017-09-30 19:09 (1) Answers

Integration Testing CakePHP 3

I am doing Integration testing in CakePHP 3 following is Unit Test Function. public function testlogin() { $this->post('/users/login', ['username' => 'test', 'password' => 'test']); $this->assertRedirect(['controller...
more »

2017-09-29 07:09 (0) Answers

CakePHP Bake PHP Version Error

I am using Hostgator for hosting to start, I have the file location of the website set to public_html\WebsiteName\Public (where public is the directory for the CakePHP. I am trying to run bin/Cake bake and I receive the following error: Minimum PH...
more »

2017-09-28 23:09 (0) Answers

Sorting on associated data

CakePHP 3.5.1 Hi, I have 2 tables, Users and Areas. When I'm in the areas controller I use contain to retrieve the relevant users details for that area. // Areas Controller public $paginate = [ 'sortWhitelist' => [ 'area_name', 'fir...
more »

2017-09-28 15:09 (0) Answers

Shopify with CakePhp

I am new to CakePHP and I have to use some Shopify's API[GET and POST methods] in existing CakePHP. I have gone through some Github's repository. But what is the best way of integrating Shopify with CakePHP? Should I use webhooks or is there any exis...
more »

2017-09-28 14:09 (0) Answers

While uploading large files session is timed out

I am working session topic using cakephp application in Nginx server: When I am uploading large files which takes more than an hour, Session is timed out and once the upload percentage reaches to 100% page is refreshing and showing the login page. ...
more »

2017-09-28 11:09 (1) Answers