Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Kevin Schroeder's Blog:
ZF2 Dependency Injection: Managing Configuration - Part 2
Apr 27, 2012 @ 13:20:49

Kevin Schroeder has posted the second part of his ZF2 dependency injection series (part one here) talking about their configuration.

In my previous post about Dependency Injection Container (DiC) configuration I made mention of some more complicated scenarios that you can use to configure your objects. Not that you need help to make it more complicated. [...] That’s why I think this series of blog posts are good. They show you how to get started small which is really the only way to get started if you aren’t intimately familiar with a DiC.

He expands on the previous example by adding another method that lets you set up some testing data (injected into the Test class object) and feed in the data via the "parameters" DI container configuration.

tagged: zendframework2 dependency injection configuration tutorial initialize data

Link:

Derick Rethans' Blog:
To GMT or not to GMT
Mar 01, 2012 @ 17:39:45

In this new post to his site, Derick Rethans shows an instance of "GMT being tricky" when it comes to "UTC" versus "GMT" output from PHP's DateTime object.

Earlier today, on twitter, @skoop asked: "dear #lazyweb, when I use DateTimeZone('GMT'), why does format('e') output UTC?" [...] As you can see [the example with a format of "e" on a DateTimeZone('GMT')] has UTC and not GMT as you might expect.

Derick mentions that sometimes, systems require "GMT" instead of "UTC" in the output they're given. To work around this issue, he shows how to add a "type 2" timezone to the DateTime object by including it when you initialize the object (code samples included). Using alternative methods, you can add these "type 2" timezones in three ways - an offset in the initial string, using the abbreviation (like "EST" or "PST") and specifying the long version of the timezone (like "America/Montreal").

tagged: datetime handling timezone gmt utc type2 initialize offset

Link:

Tom Jowitt's Blog:
Streamlined PHP Development - Part III
Aug 10, 2011 @ 16:09:04

Tom Jowitt has posted his third part in his "streamlined PHP development" series today focusing on working with databases and setting it up with your automated deployment system (parts one and two).

In the first two parts of this series we covered setting up the server and an introduction to Phing. This post will cover managing our database code with dbdeploy and Phing.

He points out that there's no "silver bullet" when it comes to automated database management but he's found dbdeploy as a good tool for his needs. He includes the configuration changes to get the database login information into Phing and a few new targets/tasks to add to the Phing configuration for initializing the database and applying patches.

tagged: development tutorial install configure environment phing dbdeploy initialize update

Link:

Tibo Beijen's Blog:
Controlled initialization of domain objects
Jul 09, 2009 @ 15:06:02

Tibo Beijen takes a look at domain objects in this new post to his blog and how they have them working in a project he's been developing.

In a recent project I've been working on, we have used the 'Domain Model' to describe and design our application. Doing so we decouple persistency logic from the objects that are being passed around and modified throughout our application: The Domain objects.

He talks about challenges associated with the development (issues separating out the business logic) and how they solved it in two ways - reflection and a pattern where the domain object uses itself. Code is also included to help illustrate the problem and these two methods of resolving it.

tagged: businesslogic control initialize object domain

Link:


Trending Topics: