Archive for 'php'

PHP Application Configuration with YAML

Posted by:

I have always disliked creating configuration data by reading from various formats into global arrays, so I needed to build or borrow a configuration class for my own projects that I could standardize on.

I wanted the following functionality.

  • Use the YAML format
  • Minimize load time by caching configuration data
  • Use object notation instead of array access notation.

I discovered various configuration classes but none of them quite had everything I was looking for so I put together the best code and ideas (for ...

Continue Reading ?
5

When Pligg's Fly – Test flight

Posted by:

I was recently asked by a friend on a tight budget to help set up a small site similar to digg or some of the other social news and link aggregators. I thought it would be easy to find an open source project or three to choose from and adapt to their needs, but I only found one that was active and stable — Pligg. Since I am going to be working on this mini-project ...

Continue Reading ?
8

Url Routing with PHP – Part Three

Posted by:

In the final part of this series, I will build a functional modular front controller that can be easily adapted to small projects. It is basically the “C” in MVC for a simple MVC framework. If you haven’t read the first two articles I recommend that you read over them first. Url Routing with PHP – Part One and Url Routing with PHP – Part Two.

Requirements

  • Apache with mod_rewrite enabled
  • PHP

A few changes

If you have followed along ...

Continue Reading ?
22

Url Routing with PHP – Part Two

Posted by:

This is the second part of a series, I assume you have read Url Routing with PHP – Part One as it covers the basics that I’ll build on in Part Two.

Requirements

  • Apache with mod_rewrite enabled
  • PHP

Assign Responsibilities

The first problem I want to address is that there are two different things going on with the script in part one. 1. The parsing of the URL to obtain a command array and 2. The actual dispatch of the command ...

Continue Reading ?
14

Url Routing with PHP – Part One

Posted by:

Most PHP frameworks use some variation of the front controller pattern to centralize common code and logic. There are advantages and disadvantages to this. I am going to ignore those for now. In fact the first part of this series will explore a simple procedural URL routing method that contains many of the disadvantages. In later articles we will build upon this basis and address the disadvantages.
Continue Reading ?

46
Page 2 of 2 12