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

Ross Tuck:
How I Use Traits
May 18, 2015 @ 17:56:47

Ross Tuck has posted a new article to his site today talking about how he uses traits in his applications and where he sees them having the most value.

Recently, a few folks asked about a trait in a new project I wrote. Right around the same time, Rafael Dohms showed me his new talk about complex cognitive processes we don’t notice. Because my brain is a big mushy sack, the two blended together. The result was this post, which tries to capture how I use traits but also how I decide to use them in the first place.

He starts off with a bit of talk about leverage versus abstraction and how the concepts relate to code. He includes a brief example of each and points out that, while each is good, abstraction tends to be more useful. He then applies this back to the world of traits, how they compare to the use of normal static methods and how they have an advantage of encapsulation without oversharing. He suggests that assertions are more fit as static methods and that traits are a better fit in cases where multiple inheritance is needed. He also touches in interfaces in traits and his opinion on when is the best time to use them.

tagged: using traits opinion leverage abstraction static interface inheritance

Link: http://rosstuck.com/how-i-use-traits/

Kristopher Wilson:
Using Interfaces Effectively in PHP
Mar 27, 2015 @ 15:12:32

Kristopher Wilson has a quick post talking about how he thinks you can use interfaces effectively in PHP applications.

Yesterday, a question appeared on Reddit about the purpose of interfaces in PHP. While I was too late to the party to provide an answer to that thread (at least that would get noticed by anybody), I thought it was a great topic of conversation. So let's take a look at interfaces in PHP.

He introduces some of the basics around interfaces and provides some sample code showing how they're created and used (and extended). He talks about some good practices for implementing them in your classes and how this fits into the world of dependency injection. He also includes a bit about type hinting based on the interface implemented and how they can be seen as "contracts" in your code.

tagged: using interface contract introduction example extend

Link: http://kristopherwilson.com/2015/03/26/using-interfaces-effectively-in-php/

SitePoint PHP Blog:
Using PHP Streams Effectively
Nov 21, 2013 @ 17:54:02

Vito Tardia has a new tutorial posted to the SitePoint PHP blog today showing you how to use PHP streams effectively, a continuation of his streams series started here.

n my previous article we've discovered the basics of PHP Streams and how powerful they were. In this tutorial we are going to use this power in the real world. First I'll show you how to build your custom filters and attach them to a stream, then we'll package our filters inside a document parser application.

He starts out by introducing the concept of filters in streams - bits of code that can be attached to the stream to perform operations on the data traveling through it. He includes a simple base64 encoding example with a fopen call to illustrate. He gets into more complex filtering by creating a Markdown filter capable of translating the incoming Markdown-formatted data into a document using the MarkdownExtra library. He also includes an example of another filter added on post-Markdown conversion, a Template filter using the RainTPL templating library.

tagged: using streams filter markdown template tutorial

Link: http://www.sitepoint.com/using-php-streams-effectively/

Gonzalo Ayuso:
Releasing unmanaged resources (a PHP port from C#’s “using” statement)
Sep 10, 2013 @ 15:55:44

In a new post to his site Gonzalo Ayuso has put together an example of releasing unmanaged resources similar to something C# does with its "using" functionality.

Sometimes we work with instances that needs to released even when exceptions happens. Something typical when we work with resources (Files, Database connections, …) [...] Sometimes I need collaborate with C# projects. C# is a great language. I really like it. It has a really cool feature to solve this problem: the “using” statement. Because of that we are going to build today one small library to implement something similar in PHP.

He provides a basic code example, showing how to use a "Disposable" interface with a "dispose" method that can be implemented based on the resource type you need to use. In his example, it's a "File" class that implements the interface and and global "using" function is defined to clean up the object after use. The code for the sample is also available on Github.

tagged: release unmanaged resource csharp using tutorial

Link: http://gonzalo123.com/2013/09/09/releasing-unmanaged-resources-a-php-port-from-cs-using-statement/

Tim Koschuetzki's Blog:
New Poll (Using CakePHP)
Nov 01, 2007 @ 13:00:35

Tim Koschuetzki has started up a new poll on his site asking its visitors questions involving CakePHP:

The new poll asks you if you are using the CakePHP Framework already or if you plan on using it. For those of you who don’t know it yet - it's in my opinion th framework to go these days. The easy and intuitive MVC architecture and the components in it make php development really easy and fun.

So far there haven't been any votes (it's still pretty new) so get on over and voice your opinion now.

CakePHP is one of the more popular and powerful PHP frameworks out there and it has a loyal following of dedicated users and developers on its team. It's definitely worth checking out if you're still perusing the market for a framework to go with.

tagged: cakephp framework poll using plan cakephp framework poll using plan

Link:

Tim Koschuetzki's Blog:
New Poll (Using CakePHP)
Nov 01, 2007 @ 13:00:35

Tim Koschuetzki has started up a new poll on his site asking its visitors questions involving CakePHP:

The new poll asks you if you are using the CakePHP Framework already or if you plan on using it. For those of you who don’t know it yet - it's in my opinion th framework to go these days. The easy and intuitive MVC architecture and the components in it make php development really easy and fun.

So far there haven't been any votes (it's still pretty new) so get on over and voice your opinion now.

CakePHP is one of the more popular and powerful PHP frameworks out there and it has a loyal following of dedicated users and developers on its team. It's definitely worth checking out if you're still perusing the market for a framework to go with.

tagged: cakephp framework poll using plan cakephp framework poll using plan

Link:

Ilia Alshanetsky's Blog:
Why are you not using PHP 5?
Dec 11, 2006 @ 19:34:00

In a new post on his blog today Ilia Alshanetsky asks the community the all-important question on everyone's lips - "why are you not using PHP 5?"

It would seem that despite a 300% growth (from <4% to >12%) in PHP 5.X usage in 2006, it still only commands about 12% of the entire PHP user base. [...] As a 5.X release master, I am very interested in hearing what's holding back 5.X adoption and what can we, as the developers do in 2007 to help speed of 5.X adoption.

He notes that a lot of the concerns (speed issues, stability problems, etc) have already been addressed and are working like a champ in the latest PHP5 versions releases.

So, do you have a reason why you're still using PHP 4? If you're not using it, you know someone who is. Take this as an opportunity to give them a friendly shove in the PHP 5 direction.

You can also check out this response and opinion on the topic on cyberlot's blog as well as this post on the PHPWomen blog.

tagged: php5 using statistics php4 speed complaint stable php5 using statistics php4 speed complaint stable

Link:

Ilia Alshanetsky's Blog:
Why are you not using PHP 5?
Dec 11, 2006 @ 19:34:00

In a new post on his blog today Ilia Alshanetsky asks the community the all-important question on everyone's lips - "why are you not using PHP 5?"

It would seem that despite a 300% growth (from <4% to >12%) in PHP 5.X usage in 2006, it still only commands about 12% of the entire PHP user base. [...] As a 5.X release master, I am very interested in hearing what's holding back 5.X adoption and what can we, as the developers do in 2007 to help speed of 5.X adoption.

He notes that a lot of the concerns (speed issues, stability problems, etc) have already been addressed and are working like a champ in the latest PHP5 versions releases.

So, do you have a reason why you're still using PHP 4? If you're not using it, you know someone who is. Take this as an opportunity to give them a friendly shove in the PHP 5 direction.

You can also check out this response and opinion on the topic on cyberlot's blog as well as this post on the PHPWomen blog.

tagged: php5 using statistics php4 speed complaint stable php5 using statistics php4 speed complaint stable

Link:

NewsForge.com:
Using phpMyAdmin
Aug 18, 2006 @ 12:11:33

On NewsForge, an article with a look at phpMyAdmin has been posted, a "getting started" guide for those not familiar with the software.

So many open source projects depend on MySQL that it's almost impossible for administrators and other open source enthusiasts to avoid working with at least one MySQL database. MySQL's command line interface is easy enough to use, but if you don't feel like reaching for a five-pound MySQL reference book or Googling for proper SQL syntax, phpMyAdmin is a great alternative to learning MySQL commands by heart.

They take a brief look at how it's set up, though it's not an installation tutorial, more about configuration. They guide you through some of the interface before getting to the real functionality - inserts, selects, dumping/restoring data, working with users, and checking/repairing tables when things go awry.

tagged: using phpmyadmin guide introduction configure insert users data repair using phpmyadmin guide introduction configure insert users data repair

Link:

NewsForge.com:
Using phpMyAdmin
Aug 18, 2006 @ 12:11:33

On NewsForge, an article with a look at phpMyAdmin has been posted, a "getting started" guide for those not familiar with the software.

So many open source projects depend on MySQL that it's almost impossible for administrators and other open source enthusiasts to avoid working with at least one MySQL database. MySQL's command line interface is easy enough to use, but if you don't feel like reaching for a five-pound MySQL reference book or Googling for proper SQL syntax, phpMyAdmin is a great alternative to learning MySQL commands by heart.

They take a brief look at how it's set up, though it's not an installation tutorial, more about configuration. They guide you through some of the interface before getting to the real functionality - inserts, selects, dumping/restoring data, working with users, and checking/repairing tables when things go awry.

tagged: using phpmyadmin guide introduction configure insert users data repair using phpmyadmin guide introduction configure insert users data repair

Link:


Trending Topics: