A while back I had to research CMS options to compliment our work with WordPress. At the time I was looking at the two main competitors to WordPress in the PHP CMS category, Joomla and Drupal. Both of these choices are solid, established and flexible options. There isn’t a clear ‘winner’ between them, however I figured this summary might be helpful for others.
Continue reading “Drupal vs Joomla Research & Comparison”Category: PHP
Honeybadger With Monolog in Symfony
I have a project in which I need to use Honeybadger to log errors. It’s a Symfony 6.2 application and I’m already using Monolog for logging. Extensive searching for info about Monolog, Symfony and Honeybadger turned up almost nothing. So, here’s some quick notes on how I set it up.
Continue reading “Honeybadger With Monolog in Symfony”Convert Symfony Auth Scaffolding Login to use Form Builder
If you follow various tutorials (like this one) to set up some basic user authentication steps like a login form, logout route, user registration form… you’ll use commands like php bin/console make:registration
and php bin/console make:registration
which will generate login and registration forms for you. When I did this in Symfony 6, I ended up with a registration form created with Symfony’s Form Builder method and a login form created with a typical html form in the twig templates. Later when adding the symfonycasts/reset-password-bundle flow to add a ‘forgot my password’ step, this created another form using Form Builder. Eventually I ended up with all of my auth steps using Form Builder except the login form. Inconsistency- yuck!
I’m using Symfony 6.2 as of this writing.
Here’s how to switch the login form so it works like the rest.
Continue reading “Convert Symfony Auth Scaffolding Login to use Form Builder”Disable Doctrine Migrations Check in Symfony
I wanted to set up my own Symfony Skeleton project and get all my favourite packages and configuration set up. One need I have is to have Doctrine and Doctrine Migrations packages installed but I don’t want them to be used (yet). The problem is that I was finding a lot of errors in my logs like this:
app.ERROR: error while trying to collect executed migrations {...} (File: /vendor/doctrine/doctrine-migrations-bundle/Collector/MigrationsCollector.php | Line: 41)
doctrine.INFO: Connecting with parameters array{...} (File: /vendor/doctrine/dbal/src/Logging/Driver.php | Line: 31)
RunCloud, PHP 8, And WordPress Update Errors
If you are provisioning servers using Runcloud.io, you may encounter an error with WordPress updates of core or plugins due to the following error:
Fatal error: Uncaught Error: Call to undefined function set_time_limit()
This error occurs in the WordPress file wp-admin/includes/class-core-upgrader.php
and for me it only occurred when the web app was set to use PHP 8.0, yet worked fine on PHP 7.4.
Keeping Symfony Projects Up To Date
Keeping any project which uses a framework or a collection of 3rd party libraries up to date is an exercise in continuous upgrades. In my situation, I have dozens of projects on a variety of internal and 3rd party frameworks, so keeping everything updated – from the PHP version to the framework and library versions – is an important and time consuming process. Here are some strategies and techniques.
Continue reading “Keeping Symfony Projects Up To Date”Custom Error Pages in Symfony Framework
As I make my way through some tutorials on SymfonyCasts and begin a re-write of my SyntaxSeed website from CodeIgniter to Symfony… I occasionally encounter something that took a bit more struggle than a simple web search. This is one of those tasks.
Symfony gives you some generic built in error pages, for example when you get a 404 missing resource error or a 500 error. When working in your dev environment you don’t see these, you instead get the nice Whoops error pages with extra details. Customizing the error pages requires a few steps.
Continue reading “Custom Error Pages in Symfony Framework”Learn PHP For Experienced Developers
In my efforts to help a colleague, I discovered that there are few resources for people who are already programmers in other languages to learn PHP. Something that isn’t beginner level, doesn’t explain basic programming concepts… just get to the heart of what makes PHP unique, and some suggested quality resources to learn more.
This is what I’ve written here. It’s a high-level overview of the language, and some vetted resources to get set up and learn more.
Let’s get started…
Continue reading “Learn PHP For Experienced Developers”Apache Wild-Card Development Sites
I work on a Ubuntu machine and the easiest way to get a LAMP development environment working was for me to just install Apache, PHP and MySQL. I want my sites to be testable locally with a *.dev.test
domain.
So if I visit sherriw.dev.test
I want it to resolve to a sherriw/
directory in one place (for example /home/dev/projects/
).
Legacy PHP Application: PHP Code Sniffer Compatibility Standard
Part 1 of this series covers a tour of my 14+ year old legacy CMS called LampLight and it continues with my use of command line code analysis tools to migrate it from PHP v 5.6 to 7.3. In this part I’ll use PHP_CodeSniffer to check my applications compatibility with PHP v 7.3 and beyond.
Let’s not fuss around, and instead dive right into the meat of this post. At the root of my project I run:
phpcs --standard=PHPCompatibility --extensions=php,inc,lib -s --runtime-set testVersion 7.3- .