Questions tagged [cakephp-3.5]

Questions about the 3.5.x branch of the CakePHP MVC framework. Use this tag in combination with the general [cakephp] tag. If your question applies to CakePHP more generally, use only the [cakephp] tag.

CakePHP 3.5

CackePHP is a PHP development framework using Associative Data Mapping, Front Controller and MVC design patterns.

Version 3.5.0 was released in August 2017.

Resources

18 questions
4
votes
1 answer

PHP Garbage Collector Keeps Removing My Sessions

The Problem: I have a website that uses PHP sessions to allow users to log in. It works fine. But the session expires too soon that 1 minute of inactivity will log out the user. My Environment: Php version: 7.1 Server: NGINX Framework: CakePHP…
Peshraw H. Ahmed
  • 439
  • 3
  • 22
2
votes
1 answer

Using IFNULL ... GROUP_CONCAT() in CakePHP 3

I have a vanilla MySQL query as follows which works fine: SELECT d.*, IFNULL( (SELECT GROUP_CONCAT(value) FROM display_substances `ds` WHERE `ds`.`display_id` = `d`.`id` AND ds.substance_id = 2 GROUP BY…
Andy
  • 5,142
  • 11
  • 58
  • 131
1
vote
0 answers

CakePHP Upgrade via Rector, functions with input type array declaration

I'm trying to use rector (https://github.com/rectorphp/rector) for the first time to upgrade my CakePHP application. I'm working in a local development environment first. I've hit a bit of a headache. For example purposes I created the following…
jtesta
  • 183
  • 3
  • 15
1
vote
3 answers

Infinite Login Loop after CakePHP 3.6 update

in my application, based on CakePHP, I'm using. When I'm logging in using the URL /manager/login (corresponding to LoginController, Managerr prefix) everything is OK. When I logout or I use /manager the result is the…
0
votes
1 answer

Timezone Missing In i18nFormat

I'm having an odd problem getting timezones to show in the JSON results of Time/FrozenTime objects in CakePHP 3.5 after migrating our application to PHP 7.2 and to a new server environment. A simplified example occurs when formatting a new…
Andy Hoffner
  • 3,267
  • 2
  • 21
  • 22
0
votes
0 answers

Cakephp 3.5 : How to test login functionality without using Fixture for unit testing in phpunit?

I am using Cakephp-3.5 Auth Component in my application to verify user's credential. Now I have to write down unit test cases for login form. I have to write test cases not using Fixtures but only just in phpunit. I am unable to figure out how to…
Sarthak Shah
  • 137
  • 1
  • 15
0
votes
1 answer

Class 'MongoClient' not found in file Controller\AppController.php

Hi there I'm try to connect mongo DB(Version 3.4.18) using CakePHP (version 3.5.1) with Apache server on PHP (7.2.4) and facing below error 2019-07-01 10:41:09 Error: [Error] Class 'MongoClient' not found in…
Omkar
  • 3,040
  • 1
  • 22
  • 42
0
votes
1 answer

Getting error "Call to a member function format() on array" while querying to find records between two date in CakePHP 3

I want to find records between two dates so I have written this code: $this->paginate['conditions']['OR']['Clients.date_registered BETWEEN ? and ?'] = [$dateRegFrom, $dateRegTo]; date_registered is a datetime column so I have tried both the formats…
bikash.bilz
  • 821
  • 1
  • 13
  • 33
0
votes
0 answers

Visualisation of HABTM

I am looking for a way to make HABTM relations on the website more beautiful. By default, these are displayed in a long list. To select several at once, one has to hold Ctrl. I could imagine something like a drag and drop system with two tables next…
Carsten
  • 45
  • 9
0
votes
1 answer

Fake URL Shortener

I want to redirect www.myhost.com/g/:id to www.myhost.com/jobs/view/:id. Currently the following code does that fine: $routes->connect( '/g/:id', ['controller' => 'Jobs', 'action' => 'view'], ['pass' => ['id'], 'status' => 301, 'persist'…
Bird87 ZA
  • 2,313
  • 8
  • 36
  • 69
0
votes
0 answers

CakePHP 3.5 encrypting cookies with dynamic names

My application has some encrypted cookies with dynamic names. I have implemented the middleware for encryption and it is working fine for those cookies with static names such as xxx, yyy and zzz. $cookiesEncrypted = new…
EssEss
  • 73
  • 10
0
votes
1 answer

CakePHP 3.5 Writing & Encrypting Cookie

Background: I have just upgraded to CakePHP 3.5.17. I had a code that write cookie. However, it seems that I am missing a few steps to encrypt it. Can somebody shed some lights where are the missing steps? At the moment, the web browser is getting…
EssEss
  • 73
  • 10
0
votes
1 answer

CakePHP 3.5 Writing and Reading Cookie

First of all, I've tried these two solutions provided in these two links How to set and get Cookies in Cakephp 3.5 How to create cookies at controller level in CakePHP 3.5? But, it just doesn't work somehow. I've provided an example of how I tried…
EssEss
  • 73
  • 10
0
votes
1 answer

CakePHP 3.6 Query Builder complex OR conditions issue

I am trying to build a query using query builder with complex nested AND and OR conditions. Here is what I have written so far. $cond_arr = array(); $cond_arr['VehicleBrandModels.status'] = 1; $query =…
0
votes
1 answer

How to filter by translations of a belongsToMany association?

I would like to query translations in an associated belongsToMany relationship. According to the docs and this question it should be possible to query in translations for associations. I tried the following (simplified) code: $result =…
1
2