Tuesday, March 30, 2021

Converting an Application From Yii2 to Yii3

Converting Yii2 to Yii3

A Minimalist Conversion Example

I’ll admit, I put off playing with Yii 3 for quite a while because I was daunted by the quick peeks into the code base and sample applications. The differences between configuring and bootstrapping a Yii 2 application vs a Yii 3 application are significant. At first glance, the two versions of a base application are completely different. But, once you start digging in, the similarities become apparent and you can start to draw the connections between the Yii 2 methodologies and the Yii 3 counterparts. These are my first impressions and the results of my own investigations thus far. I expect things to continue to evolve as the Yii 3 project advances.

PLEASE NOTE: Yii 3 is *not* yet ready for production release. This blog is an attempt to get more people playing with it and correspondingly, more people involved with providing feedback and assistance in developing and supporting the project. If you are not feeling adventurous, table this project for when there is a stable release and official documentation. Check the Release Cycle for production timelines and updates.

Sunday, February 9, 2020

Takeaways from SunshinePHP 2020


It's been a bit of a whirlwind year so far and it's only February!! I feel like just yesterday I was in Belgium for PHPBenelux (oh wait, it pretty much was ... will have to post on that later).

If you are here because you're looking for the slides from either the tutorial session or the general session from SunshinePHP, you can find them here:


Thursday, October 31, 2019

Setting up Docker Desktop on Windows 10

I was speaking with someone this morning that was attempting to get their stack running on Windows, but running into issues with volume paths. It emphasized for me that it's been a while since I attempted to work with Docker on Windows and I should probably refresh that, so I did!

This is a quick walk through of how to set up Docker Desktop on Windows 10 Pro, with some of the common pitfalls, and a demo stack you can use to verify that your Docker installation can properly access the volumes created on Windows drives.


Wednesday, September 25, 2019

Quick Thoughts from Cascadia PHP

Having just recently returned from Cascadia PHP, where I had the pleasure to be presenting on Docker and how to containerize your development environment, I wanted to take a moment and jot down some thoughts about the nature of the PHP Community and supporting your local conferences.

This was a smaller conference than I'd been to so far, but with that decreased size came an increased level of connectedness between all of the attendees, which really enhanced the sense of community. I had the pleasure of meeting many people from the local area and learning their stories, as well as many folks who flew in from around the country.  I was strongly reminded of what it was like to be just embarking on your development career - it's been a long time since I've worn those shoes - stick with it and keep pushing yourself. =)

As with every conference that I attend, I walked away with a list of "research homework" to do, which is wonderful - if we're not learning, we're not growing.

A couple of those homework/research points:
  • Using middleware when converting legacy applications
  • The PHP-FIG group - getting involved
For anyone curious, the slides to my presentation can be found on SlideShare.

If you happened to be at the conference, please send in your feedback via Joind.in - your constructive feedback is always valuable and appreciated!

If you haven't been to a conference (or just haven't been to one in a while), you really are missing out on a wonderful and supportive community of people. Everyone has something to teach someone else and something they can learn from someone else.  (This is a reminder to myself for when I get so bogged down with work that I wonder if I really have time to go to this event or write that blog ... yes -- make the time.)

Thursday, May 30, 2019

Yii2 Queue with Redis on Docker Swarm is a game changer

I don't know why I haven't utilized this before, but the yiisoft/yii2-queue is a fantastic way to quickly and easily split some of your application processing out to asynchronous workers.

Getting it set up with a redis storage engine on a docker stack is super simple -- we just add a persistent redis service to the docker stack, configure the application to include the queue component, and move our slow process(es) into a queue job.

Since we're using a Docker Swarm stack we don't need to worry about setting up a cron or systemd service, we set up the queue listener as it's own service in the stack, which also gives us the ability to scale the queue workers dynamically as the need arises.

Tuesday, May 7, 2019

DockerCon Hallway Track - Logging to a NFS mounted Docker Volume

Recently at DockerCon I decided to check out the whole 'Hallway Track' concept and share a sticky situation we ran into at work. If you've never been, the Hallway Track is a coordinated effort to get conference attendees talking to one another and sharing knowledge. You post your topic or peruse the posted topics and they facilitate connecting people together to discuss face to face. I was amazed at the number of people who requested to talk to me about our experiences with the complications of writing application logs to a NFS mounted docker volume. The official title was "Lessons learned: Why writing to flat file logs in an NFS mounted docker volume is unwise".

Wednesday, February 13, 2019

Code Analysis with Exakat on Docker

One of the neatest things I learned about last week at SunshinePHP, was how Exakat can be used to perform static analysis of a codebase to help formalize your code review processes.  It's a great tool for determining how consistent you and your team are being with your code, and has indicators to show you how closely your code base aligns to each of the major PHP versions -- an excellent way to check backward compatibility and/or whether you're ready for a PHP upgrade or not. 

With Docker, it's extremely easy to get things running!