News Feed
Sections




News Archive
feed this:

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

Rob Allen's Blog:
Module specific bootstrapping in ZF2
March 08, 2012 @ 10:04:20

Rob Allen has a new post to his blog today looking at bootstrapping specific modules in a Zend Framework 2-based application without having to do the entire set.

Following on from the discussion on modules, we can hook into the event system to do module specific bootstrapping. By this, I mean, if you have some code that you want to run only if the action to be called is within this module, you can hook into the Application's dispatch event to achieve this.

He starts with an example of a basic module (Simple/Module.php) and shows how to define an "onBootstrap" method that calls the "onDispatch" method (when hooked to the event manager) to do some module-specific bootstrap operations. The RouteMatch feature is used to ensure that you're in the right controller/namespace combo to use the module.

0 comments voice your opinion now!
module bootstrap zendframework2 tutorial specific router dispatch


Mike Purcell's Blog:
PHPUnit - How to Run PHPUnit Against a Specific Test
February 01, 2012 @ 08:37:03

Mike Purcell has a quick new post to his blog showing how you can run PHPUnit on one specific test using handy grouping functionality already built into the tool.

The other day I was debugging an error in one of my unit tests, and found it hard to track down because when I ran PHPUnit, it ran all the tests contained in the file where my problem unit test was located. After some Googling and reading the PHPUnit Api Docs, I found that you can specify a test, among other tests, by adding a comment with the @group annotation.

Using this "@group" annotation tells PHPUnit to combine these tests and allows you you specify a "--group" setting on the command line to only run those. He includes some sample code showing how it can be used. This can be very useful for combining results for certain kinds of tests (say, all related to bugfixes) without having to run everything all over again.

0 comments voice your opinion now!
phpunit specific test group annotation


Cal Evans' Blog:
Six ways to be a better client for your developer - Point 6
January 26, 2011 @ 12:51:31

Cal Evans has posted the final point in his "Six Ways to be a Better Client for your Developer" series seeking to make the client/developer relationship more stable and enjoyable for both sides. This latest tip involves the paperwork part of the relationship.

Good fences make good neighbors just as good contracts make for good developer/client relations. At the very least your agreement with your developer should contain a complete description - in non-vague terms - of each feature to be built as well as a paragraph description of the overall project.

He emphasizes that, if the feature or change is not included in the documentation from the start, it's not a part of the project. Making assumptions on vague definitions will only cause problems down the road, so be specific in what you want.

If negotiating the contract with your developer is a hassle, consider it your last opportunity to walk away and find another developer.
1 comment voice your opinion now!
client developer opinion paperwork contract specific


Cal Evans' Blog:
Software development DSL
August 23, 2010 @ 11:41:04

Cal Evans has posted a sort of lighthearted beginners guide to some of the terms that those outside the software development industry might not know - five terms with their explanations.

When I venture out into the real world, the one not populated with developers, I get a lot of strange looks and odd stares when I talk. Apparently there are a lot of people out there who don't grok grep, have never been slashdotted, and can't tell a brown number from a WAG. [...] Today I am going to share five of our more colorful terms from the software development DSL.

Some of the terms are well-known outside of the software development world like "yak shaving", "bike shedding" and "dogfooding" but there's one unique to the PHP community - being "Rasmused"...having less people in your talk's crowd because of a talk from someone more popular at the same time (Cal explains it better).

0 comments voice your opinion now!
software development domain specific language


Paul Gregg's Blog:
PHP algorithms Determining if an IP is within a specific range.
April 28, 2009 @ 09:25:39

Paul Gregg has shared a method he's come up with to determine if a given IP is within a selected range.

Unfortunately although people usually understand that an IP address is simply an unsigned 32 bit integer, and is easily determined, usually with $_SERVER['REMOTE_ADDR'], where the real challenge is - is in specifying the range within which they wish to check that IP address. IP ranges are usually specified in three common ways (in increasing complexity): wildcard, start-end range, classless inter-domain routing.

He looks at each method and includes descriptions and code examples as well as a link to the source code and a live demo of it in action.

0 comments voice your opinion now!
algorithms ip address specific range three method wildcard cidr startend


Kae Verens' Blog:
Hosting multiple sites from the same CMS engine
January 21, 2009 @ 10:21:33

Kae Verens has a few tips to help simplify your life with your current content management system by using one code base to run multiple sites.

I haven't studied how other engines do it, but here's how I do it. First off, some benefits to sharing the CMS across separate sites: reduced resource usage, easier upgrades, easier bug-fixing. Convinced yet? Of course you are. Here's how you do it.

There's four steps to his process:

  • Separate out the site-specific files from one another
  • Serve all site-specific files out through a "proxy" script that can intelligently grab the needed ones based on the site
  • Override the default configuration at request time (forcing it to use that "proxy" script)
  • Create that proxy file that the web server can funnel the requests through (his example is included).
0 comments voice your opinion now!
host multiple website cms engine site specific configure proxy


Padraic Brady's Blog:
A Domain Specific Language for Behaviour Driven Development (BDD) in PHP
July 21, 2008 @ 11:13:35

Padraic Brady has posted about a part of his PHPSpec library, the domain specific language.

PHPSpec implements a domain specific language (DSL) in PHP for specifying the behaviour of functional units such as methods and objects. The purpose of a DSL was to move away from the xUnit style declaration of tests towards a specification language centred on describing behaviour.

He illustrates with a bowling example - described with a sample class (with a itShouldScore0ForGutterGame test) and how to use it to fit his proposal:

My proposal therefore is to re-implement the current programming language DSL as a specification language - i.e. a new (extremely limited and narrow!) language capable of being parsed by PHPSpec into its PHP equivalent. [...] Using a specification DSL, we can simply ignore the existence of classes in PHP (well, the pretense is nice). Instead the DSL would incorporate a syntax for denoting shared behaviours.
0 comments voice your opinion now!
behaviour driven development phpspec domain specific language


Richard Heyes' Blog:
Reading a specific line in a file
April 07, 2008 @ 12:56:08

Richard Heyes has thrown together some code for a simple thing that he's seen developers request over and over again - moving to/reading from a specific line in a file.

After reading something on the php-general list I decided that a) I'm bored, and b) I'll write something which handles it. So here it is.

His code is simple - looping through the lines of the file until it locates your desired target (with some error checking along the way). Plus, if it's already fetched, it keeps it in a cached array for future retrieval.

1 comment voice your opinion now!
reading specific file line example class



Community Events





Don't see your event here?
Let us know!


opinion library conference laravel list symfony language podcast bugfix zendserver api introduction interview deployment community framework tips developer series release

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework