Doctrine Repository Hydration, Part 2: Unit Tests

Last time, in the Doctrine ORM Repository Hydration article, we discussed how to use the Doctrine ORM to separate our SQL code into a repository layer. This enabled us to pass a strongly typed DTO to the UI layer as opposed to stringly-typed arrays.

This article will be focused on designing phpunit tests for the previous article. We will focus our efforts on these four repository implementations:

Continue reading →

Doctrine Repository Hydration, Part 1: Solution

With most web applications, there comes a time when your administrative users need reports. These statistics go beyond the typical domain entities and properties that you deal with day-to-day. They consist of aggregate functions (i.e. SUM and MAX) that return numeric scalar values. Lets look at a common MVC solution to expose this data in PHP, and explore how we might refactor that code into something that is maintainable. Our goal is to find the highest quality code that is simple and easy to test.

Continue reading →

Redis Sessions in PHP with Kohana

Writing software that scales with little effort can be a daunting task. The days of "throw hardware at the problem" are here, and managing a web farm with dozens of servers is a real problem for PHP developers. When moving from one to many web servers, the first task is managing PHP session consistency. We will discuss how to accomplish this using the Redis PHP Session Save Handler.

Continue reading →

Intro to Maxmind GeoLite2 with Kohana

Building scalable and secure e-commerce websites is a complex endeavor. There are enough problems to worry about when managing PCI compliance, firewalls, DDoS attacks, and malicious hackers. Today we are going to tackle the low-hanging fruit that can help you avert fraudulent credit card orders or cyber-attacks from outside your country of origin.

Continue reading →

Intro to Vagrant with Kohana and Zen Kommerce

If you work in web development you most likely have suffered through the pains of building your dev environment on more than one occasion. The chances of having dependency problems grow with the size of your team making it difficult to be productive. This is especially true for open source projects when lowering the barrier to entry can net you more contributors. In this post I will walk you through our development environment for Zen Kommerce, an open source e-commerce platform, built in the PHP Kohana framework.

Continue reading →

Waist-High Raised Cedar Garden Bed

This is a quick post on my waist-high raised bed garden project.

There was twenty feet of unused space on the South side of my house. This area gets full sun and was a perfect location for another raised bed garden.

Now a quick salad is only arms length from the back door.

Continue reading →

Volleyball Player Efficiency Rating, Part 3: Calculations

The following tables are examples of how to record the performance stats into a spreadsheet. The hyphen represents a separation between sets. This is not required and can be omitted, but it does tend to help with data entry. It can also be helpful for extending this spreadsheet at a future date to drill down into individual set statistics.

Continue reading →

Volleyball Player Efficiency Rating, Part 2: Our System

ViPER

The system we use at Concordia University Texas is based closely on Jim Coleman’s research and the computer system created by Rod Schall. We rate passing and digs on a (0-3) point scale to make the objective recording much easier. During pass and dig calculations the stats are adjusted to the (0-4) point scale by changing the 3’s to 4’s and the 2’s to 3’s… thus removing all 2’s. This is done to balance all skills on a 4 point scale and to enable the composite PER statistic to be valid. This is our rating system:

Continue reading →

Volleyball Player Efficiency Rating, Part 1: Introduction

Statistics: a formal science that applies numerical data to a group of individuals or experiments. Volleyball, like many other sports, has a severe disconnect between media stats and the actual performance level of the players in the game. As coaches we must find a way to bridge this gap if we want to effectively measure our players skills and help them stay focused to achieve their goals. Box scores alone will not give you the empirical information you need to measure the output from your players.

Continue reading →

Comet with Nginx and jQuery

This is an introduction into a basic Comet setup with Nginx and jQuery. You will have to recompile Nginx with NGiNX_HTTP_Push_Module to enable the HTTP Push/Comet functionality. “NHPM” is based on the Basic HTTP Push Relay Protocol and turns Nginx into a very efficient Comet server. This simple recipe will enable you to create live asynchronous web applications utilizing long polling without the complexity of the Bayeux protocol.

Continue reading →

Linux Pipe Viewer – MySQL

How long does it take to backup/restore a MySQL database?

This is a common question I used to ask myself at least once a month. It would always be crunch time, and a database table needed to be copied to another server. This is an easy task when the table only has 100 rows… but of course the one in question is 12GB on disk. How do we measure this? How long will this take?

Continue reading →

Linux Pipe Viewer – Network speed test

How fast is your network?

So you have that new gigabit switch and think you are going to achieve 1 Gbps? We all know that you are not going to get 100% throughput due to limitations I will not go into. There could also be a 10/100 patch panel involved that is not rated for gigabit… but, I digress.

I use pipe viewer and netcat to answer this question. To start you will need to install both of these programs and open an available port on the server firewall. I used tcp port 2222 in this example.

Continue reading →

All rights reserved