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

SitePoint PHP Blog:
Automate PHP with Phake - Real World Examples
July 10, 2014 @ 12:51:07

The SitePoint PHP blog has posted part two of their series looking at using Phake for automation in your applications. In this second part they take some of the basics they shared in part one and apply them in some more practical examples.

In part one, we covered the basics of Phake and demonstrated ways of executing tasks with it, covering groups, dependencies, and arguments. In this part, we'll look at some sample real world applications of Phake. Note that the following examples are largely based on things that I usually do manually that need some sort of automation.

He includes three different task examples, each with the code to make them happen (and descriptions of what it's doing):

  • Uploading Files to Server with a Phake task
  • Seeding the Database
  • Syncing Data

You can find out more about Phake on the project's GitHub page (including grouping, aborting and describing tasks).

0 comments voice your opinion now!
phake automate library tutorial part2 practical example

Link: http://www.sitepoint.com/automate-php-phake-real-world-examples/

SitePoint PHP Blog:
Becoming a PHP Professional Practical Teamwork
January 07, 2014 @ 13:35:12

In part four of his "Becoming a PHP Professional" post series Bruno Skvorc looks at the topic of "professional teamwork" , more so as it relates to a bit more practical things.

Last time, we discussed social aspects of teamwork, and how working in a team can both benefit and harm you. There's loads to take into consideration when working with other people, and lots to be gained. This time, let's talk about practical aspects of teamwork, particularly virtual teams or, in other words, teams with remote members.

He covers a three main topics (several that only relate to non-colocated teams):

  • Time Zone Difference and Broken Bottleneck in Teamwork
  • Organic Solutions (the importance of a technical lead and filter)
  • Inorganic solutions (technology to make life easier and remote workers more productive)
0 comments voice your opinion now!
professional developer series part3 practical teamwork solutions

Link: http://www.sitepoint.com/becoming-php-professional-practical-teamwork

Kevin Schroeder:
Google finally acknowledges that PHP exists
July 22, 2013 @ 11:53:10

Kevin Schroeder has an interesting post to his site about how Google is finally acknowledging PHP exists and how it's "exploding on Google App Engine"...but it's only happening just now.

How is it that one of the most despised programming languages in the word is running (as Google claims) up to 75% of the web? Many nay-sayers will say "oh it's just WordPress" or "oh, it's just PHPbb". But in doing that they are completely missing the point. [...] In the article Venture Beat says "PHP is moving to the Enterprise very quickly". This is not true. PHP IS in the enterprise and has been for a long time. People just either don't know it or refused to admit it.

He talks about the things that PHP does, including something interesting - it exposes the focus on the theoretical (the "ivory tower" as he puts it) and puts the focus back on the practical, real-life world of just getting things done. He suggests that Google's reasoning behind taking so long to get PHP up and running on the App Engine was just someone with "their blinders on" to the world of the practical that PHP fills so well.

0 comments voice your opinion now!
google appengine support exist enterprise theoretical practical

Link: http://www.eschrade.com/page/google-finally-acknowledges-that-php-exists

Blake Gardner:
Practical usage of PHP 5.5 generators yield keyword
June 24, 2013 @ 11:54:42

With the release of PHP 5.5 came a whole group of new features, including the "yield" keyword for better handling of values in iteration. Blake Gardner has posted a practical example of its use to his site today.

The key to understating the way the yield works verses a normal function is that rather than generating all of your data and returning the final array when it's done; you yield the value as it's generated. The state of the generator function is saved after you yield and then its state is restored when called again so the iteration can continue.

He shows a basic use of "yield" in a simple foreach of 1000000 values. In the first example, memory is exhausted and the second yields the values as they come, reducing the overhead significantly. The "range_yield" function returns them as the "for" loop generates them.

0 comments voice your opinion now!
yield feature practical use tutorial generator

Link: http://blakegardner.co/2013/06/24/practical-usage-of-php-5-5-generators-yield-keyword

PHPMaster.com:
Explore Aspect Oriented Programming with CodeIgniter, Part 2
August 20, 2012 @ 09:13:36

In this new post to PHPMaster.com they continue their look at aspect-oriented programming with CodeIgniter. In part one they introduced some of the fundamentals of AOP and in this new article, they dig deeper with more practical examples.

In the previous part of this series we learned what Aspect Oriented Programming (AOP) is and the meaning of important AOP terminology. In this part I'll explain why we need AOP using practical examples and how to add AOP behavior to your PHP application using the CodeIgniter framework.

They start with a look at a few pieces of functionality that could cut across multiple parts of the application like logging or authentication/authorization. They show how to use the "hooks" feature of CodeIgniter to implement the AOP proxy class generation, executing pre- and post-controller.

0 comments voice your opinion now!
aspectoriented programming tutorial codeigniter framework practical


DZone.com:
Practical Testing Patterns - Redux
June 02, 2011 @ 12:12:25

A while back we posted about a series of articles Giorgio Sironi was doing about some of the more practical applications of testing patterns in PHP unit testing. He' been building on the series ever since and has lots of great patterns you can use to more correctly structure your testing practices.

The current list includes:

There's lots more where these came from, all divided into sections like "Fixture Setup", "Test Double" and "Database Isolation" patterns. You can find the full list so far here.

0 comments voice your opinion now!
testing pattern unittest practical


Shameer's Blog:
PHP 5.3 Practical look into Lambda functions and closures
December 30, 2010 @ 11:11:26

For those out there still coming to grips with some of what PHP 5.3 has to offer, I'd suggest checking out this new article from Shameer about using lambdas and closures along with some examples putting them into action.

PHP 5.3 packaged the power of functional programming by adding support for lambda functions and closures. You will be familiar with them in javascript. In this article we will have a look into these features and its usages.

He starts with explanations of what they are with simple code examples showing their use - a lambda assigned to a variable and closures with the "use" keyword. He shows how they can be used in application prototyping, making handy callback functions and includes a practical example of finding the factorial of a number using a lambda.

2 comments voice your opinion now!
lambda closure tutorial practical example


Vance Lucas' Blog:
Practical Uses for PHP 5.3 Closures
October 20, 2010 @ 08:51:47

By now everyone's heard about one of the more powerful and major advancements made in the PHP 5.3.x series of the language - closures. You might have read a description of them and been left wondering what a practical application might be to help drive the point home. Vance Lucas has written up a post to help with just that.

If you're like me, you might be wondering what the practical uses for these new features are before you can rightly justify diving in and using them in new or existing projects. I experimented a lot with closures and possible uses over the past few weeks, and came up with some compelling reasons to start using them.

He's come up with five different examples of how you can use this handy feature:

  • Templating
  • Dynamic Code Extension
  • Delayed Execution
  • Caching
  • Convenience (as in their role in one-off functions for callbacks)

Each of the tips comes with a bit of code (except delayed execution, that's a bit more involved) to help explain the point a bit more.

0 comments voice your opinion now!
closure practical example template dynamic delay cache


Cormac' PHP Blog:
Practical example php implementation of the Observer pattern
October 14, 2010 @ 08:36:35

New from Cormac's blog there's a post looking at an implementation of the Observer design pattern in a bit more practical scenario than some other examples out there.

Observer is a pattern where an object called the subject maintains a list of dependents (observers) and notifies them of any state changes. I implemented this recently to log changes to an Account object, and to notify the account holder if their account had expire - here's the basics of the code, hopefully it'll help someone else figure out how the pattern works

The basis of the Observer pattern is that you attach these "observer" objects to a main object. These watch the object and see if something changes (like a property value) and react accordingly. For their example, they create a setup that extends the main Observer class to have some or the detection functionality built-in.

0 comments voice your opinion now!
practical example observer pattern


php|architect:
Programming you're doing it wrong
March 11, 2010 @ 11:06:42

In an opinion piece posted to the php|architect site Marco Tabini suggests that we (as developers) are doing it wrong as we move further and further away from the pragmatic side of programming into the abstract.

No matter how advanced the techniques that we use, there is always something that we could be doing better. [...] Which one is right? The real problem is that the answer to that question is, "yes." That's because it lacks a specific context in which it can be inserted.

He suggests that, in our quest to figure out what the perfect case for any situation, we stop focusing on the practicality of writing applications to accomplish goals. Sometimes it's not about getting the right theory behind the code - sometimes it's just doing it.

0 comments voice your opinion now!
programming opinion theory practical focus



Community Events





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


symfony2 configure code series refactor language install community introduction framework interview list laravel opinion podcast release developer testing threedevsandamaybe unittest

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