Posts

Let's Invest in Ourselves For 2017 Update

In my Let’s Invest in Ourselves For 2017 post I laid out the books I was planning on reading in 2017 but plans changed so we’re going to read PHP Objects, Patterns, and Practice instead.

Lessons Learned From "Working Effectively With Legacy Code"

As part of investing in myself I decided to read four different programming/management books in 2017 to improve myself. For the first quarter, I read Working Effectively with Legacy Code by Michael Feathers (even though I’m not getting this writeup out until the second quarter I swear I read it in Q1). This article is my way of keeping myself accountable for the actual reading. :-)

Read More

Fixing the "Error in configuration. Last filter is multi filter. Needs to be non-multi one. Stopping" error

Last week we ran into an interesting problem with our MySQL master/slave replication. During the week (when we’re working) the propagation delay from master to slave is less than a second but for some reason on Saturdays the delay jumps up for several minutes (still trying to figure this one out). This caused a problem where multiple records would try to be inserted for the same data (read fails to find the new row which causes it to assume there is a need for a new record).

Read More

Looping PHPUnit for Fun and Profit

PHP Logo

In Test Driven Development (TDD): By Example Kent Beck describes the process he uses to create new classes. As part of that process, he creates a list of all the things the class should do so he has a todo list of what’s been done and what hasn’t. This is an example from his book:

  • $5 + 10 CHF = $10 if rate is 2:1
  • $5 * 2 = $10
  • Make “amount” private
  • Dollar side-effects?
  • Money rounding?

As he completes an item he crosses it off so he can see what he has left to do.

  • $5 + 10 CHF = $10 if rate is 2:1
  • $5 * 2 = $10
  • Make “amount” private
  • Dollar side-effects?
  • Money rounding?

I’ve been fascinated with this concept after I read about it because of how it allows you to keep track of new things that come up while you’re working without pulling yourself out of your current work. I tried paper and pencil at first but that caused me to create a bunch of extra paper “waste”. To combat this, I looked for ways to create my list digitally within the PHPUnit.

Read More

Migrating Sessions in PHP

PHP Logo

We just finished migrating our PHP Sessions from the default PHP session save location (file) to a distributed system (Redis) and I wanted to share our experience.

Read More

Link Post and Podcast Roundup: April 2017 Edition

Link Post Logo

April’s links.

Read More

Using PHP Resque with Redis Sentinel

Redis Logo

We’re using Redis Sentinel to provide high availability for our Redis deployment. One of the struggles we had as we made this transition was finding a way to get php-resque to connect to Redis Sentinel as well.

Read More

Calculate Time Left Based on Percentage in PHP

PHP Logo

The other day I wrote a script that batched processed new records that took several seconds to process (each one could created hundreds of rows in a database and had to be compared against all other previous records). I really wanted to know how many records were left and how much more time it was going to take (so I can plan accordingly). Below is a modified version of the script so you can adapt it for your own uses.

Read More

Link Post and Podcast Roundup: March 2017 Edition

Link Post Logo

March’s links.

Read More

Finding Entities in Symfony 3 Using Doctrine

Header

The other day I ran into an interesting case trying to get data out of a Symfony project where the entities I was interested in were dependent on a second entity but I couldn’t find an easy way to find them without multiple queries. It took me a lot of reading through Stack Overflow questions to find the results but I wanted to document what I’ve found.

Please note I wrote this using Symfony 3.2.3. Last time I posted something about Symfony someone asked me to mention this.

Read More
RSS

Join Our Mailing List!

View previous campaigns.

Top Posts

  1. Working With Soft Deletes in Laravel (By Example)
  2. Fixing CMake was unable to find a build program corresponding to "Unix Makefiles"
  3. Upgrading to Laravel 8.x
  4. Get The Count of the Number of Users in an AD Group
  5. Multiple Vagrant VMs in One Vagrantfile
  6. Fixing the "this is larger than GitHub's recommended maximum file size of 50.00 MB" error
  7. Changing the Directory Vagrant Stores the VMs In
  8. Accepting Android SDK Licenses From The OSX Command Line
  9. Fixing the 'Target class [config] does not exist' Error
  10. Using Rectangle to Manage MacOS Windows

subscribe via RSS

All content copyright This Programming Thing 2012 - 2021
Blogging about PHP, MySQL, Zend Framework, MySQL, Server Administration and Programming in general