Adding a missing function definition Using the VS Code Intelephense Extension. You get a squiggly line under a function you know exists. When you hover over it the popup says "Undefined function ... " Go to Preferences and Settings [ Ctrl + , ], search for stubs and...
How to enable ZipArchive on PHP 7.4
yum install php-zip # restart Apache or php-fpm This is on CentOS Linux release 7.7.1908 (Core) You will know you have it installed properly when you run the following code and it returns true <?php // enter this in a file such as phpzip.php...
Using a git repo as a composer repository
In CakePHP variable visibility is generally defined using this standard: public $defaultConfig; protected $_defaultConfig; private $__defaultConfig; Just had a situation where I had extended a class and one variable from the base class was marked as public. My VSCode...
PHP Version Gotcha
Just copied some code from a PHP 7.3+ development environment to the server running PHP 7.2 On the server I am getting this On PHP 7.3 it runs fine Because the line number is not listed this is how I find the problem Find which controller is being called when you see...
Populating your Web App with Sample Data during Development
For years I have been using laboriously hand entered test data when developing. Perhaps because coding for me was a hobby and most of the things I was doing didn't need oodles of sample data But recently after doing a Laravel tutorial I was introduced to the Faker...
Netbeans Removes Indent from // Comments
Been using netbeans for PHP development and discovered that it will remove the leading whitespace from comments and then the comments inside a block of code are hard up against the left margin which looks weird. Not sure if there is a setting to stop this behaviour...
TCPDF KeyWords Doubled in Document Properties Description Tab – Acrobat Reader
This causes the keywords to double when viewed in File ==> Properties ==> Description Tab. $pdf->SetKeywords('CLAM, CLM, Schedule, Program, Meeting, Service Meeting'); This shows the keywords once only: $pdf->SetKeywords('CLAM CLM Schedule Program Meeting...
I have no idea what the problem is PHP CLI
Trying to do some PHP tutorials using vim and running php from the command line and I get.... nothing back. If it's a syntax error (e.g. a missing line ending ; ) then no reply at all. If the syntax is correct and it's something else then the error isn't displayed...
CakePHP 3 – Escape to the Global Namespace
This code in CakePHP 3: <?php $date = '31/01/1973'; $ymd = DateTime::createFromFormat('!d/m/Y', $date)->format('Y-m-d'); Causes this error Error: Class 'App\Controller\DateTime' not found This code fixes it: <?php $date = '31/01/1973'; $ymd =...