CakePHP 2 Form and trying to POST to it using curl This is what I am trying to duplicate with curl -----------------------------1993502965129257581246610166 Content-Disposition: form-data; name="_method" POST -----------------------------1993502965129257581246610166...
CakePHP/Queue WorkerListener Example Class
This is an example of implementing a WorkerListener class for the new CakePHP/Queue plugin as mentioned here => https://book.cakephp.org/queue/1/en/index.html#worker-events Config array // ... 'Queue' => [ 'default' => [ // A DSN for your configured backend. default:...
Encrypt / Decrypt the columns of your CakePHP 4 DB
https://stackoverflow.com/a/32261210/9230077 The above is a good solution, but it needed updating to work with CakePHP 4 I have updated the above as below to encrypt a database field with a base64 encoded encrypted string The base64 encoding is so it can save in a...
CakePHP 4 Time Zones
CakePHP 4 incorrect test table names created from Fixtures
Leaving this here as I just spent an annoying hour trying to figure out why my tests were failing. CakePHP Version: 4.2.5 Platform and Target: Ubuntu 20.04, Apache/2.4.41 (Ubuntu), Mysql 8.0.23-0ubuntu0.20.04.1, PHPUnit 8.5.15 What I was doing I was running CakePHP 4...
How to copy values from one column to another using CakePHP 4 Query Builder
I want to change the name of a column in my database and to do that I have to create a migration and drop a table The query I want to run is UPDATE pallets SET production_date = print_date; Seem so simple in SQL but to do it in CakePHP 4 took some finding Copy data...
CakePHP 4 has Deprecated File & Folder
So recently my code editor has been putting a line through File because it is going to removed in CakePHP 5 So here is an example of code that uses the deprecated methods and the suggested SplFileObject Using File public function createTempFile($print_content,...
CakePHP 4 $this->request->referer() not working in production
Just had a situation where I couldn't get a redirect to work. My CakePHP app is in an Apache enabled docker container behind an nginx reverse proxy $this->redirect($this->request->referer()); The above simply refused to work in my development environment it worked...
Getting multiple duplicate Modelless Forms on the same page working with CakePHP 4
I have the need of creating a page with multiple forms on it that have 'copies' and 'printer_id' fields on them. Each form has, or might need separate validation values. My first attempts ended up with the other form with the same field names getting the values from...
Format validationsErrors
A recursive function that takes a validation error array and return a string with all the different errors concatenated into a formatted string Further to my previous posting https://toggen.com.au/it-tips/cakephp-2-displaying-validation-errors This function will walk...