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

Linux Magazine:
Micro-Frameworks: Big Things in Small Packages
May 11, 2009 @ 10:26:12

Martin Streicher has written up a new article for the Linux Magazine website looking at microframeworks - one in Ruby and the other in PHP (Limonade).

Indeed, the quality of Rails, CakePHP, Django, and Catalyst notwithstanding, some developers have rebuffed the large frameworks, citing bulk and complexity, to create smaller and simpler alternatives. Dubbed micro-frameworks—think microcomputer versus mainframe—the tools shape incoming requests into something manageable and leave the rest up to you. Choose your design pattern, object-relational mapper (ORM), and rendering technology, and off you go. As you’ll see, a working Web application can be composed in less than ten lines of code in a single source file.

He covers the Ruby framework first (Sinatra) and Limonade next. The framework takes incoming requests and maps them into the developed code. It works like a basic MVC-formatted framework - the request comes in with an action and is sent to a method by the same name. You can use wildcards in the URI, regular expression matching, views, templates and it includes error handling support and configuration option support.

tagged: microframework sinatra limonade mvc small light

Link:

Oren Solomianik's Blog:
Zend Framework Database Admin
May 11, 2009 @ 08:41:54

In his recent blog entry Oren Solomianik takes a look at using the zdbform software (a web-based, simple database administration tool) he's put together using the Zend Framework.

If you're looking for a simple tool that uses Zend Framework's robust database classes (such as Zend_Db and Zend_Db_Table), you can check out zdbform. It's a short yet effective library that let's you perform simple administration tasks on your database, with minimal coding. It's not a full blown phpMyAdmin, but it's a simple way to view, edit and add your tables rows on a web interface.

He shows how you can use it in a script - from the front controller to the input forms - and some of the changes he needed to make in the form class itself to handle a few of the bit more tricky parts.

tagged: zendframework zdbform database admin simple light example download

Link:

Brian Moon's Blog:
Wordcraft, a simple PHP blogging application
Nov 10, 2008 @ 14:28:52

Brian Moon has released a simple blogging application he's worked up - a super-simple, lightweight application that already has several of the common blog features built in.

Up until now, I have used Wordpress.com for my blogging. It works quite well. You can get started quite quickly and it does what most people need. My wife uses Blogger for our family blog. It is, IMO, not as nice as Wordpress.com in some ways. But, it does allow you to edit your styles (for free) and such which is nice. So, why would I want to reinvent the wheel? I am a control freak and rarely run other people's code. I know, it is a character flaw. I am working on it.

His application, WordCraft, already includes things like Akismet/CAPTCHA support for comments, custom page creation, pingback support, temlpating and email notifications. You can download the latest release (version 0.5) from his google code page.

tagged: wordcraft blog application simple mysql light feature download

Link:

Mikko Koppanen's Blog:
Color analysis
Nov 05, 2007 @ 10:26:00

In the latest entry to his blog, Mikko Koppanen shows how to take the power of Imagick and harness it to check and see what sorts of colors an image contains:

The code in the example reduces the image colors to 10, then discards all but one pixel of every color and then creates the palettes out of those colors. This might not be the most accurate way to do this, but at least it's fast.

His code makes three different "palettes" from the image - average, dark and light - and outputs them as a range of colored boxes for each all of the three palettes. Examples of the output are also included in the post.

tagged: imagick color palette average dark light tutorial imagick color palette average dark light tutorial

Link:

Mikko Koppanen's Blog:
Color analysis
Nov 05, 2007 @ 10:26:00

In the latest entry to his blog, Mikko Koppanen shows how to take the power of Imagick and harness it to check and see what sorts of colors an image contains:

The code in the example reduces the image colors to 10, then discards all but one pixel of every color and then creates the palettes out of those colors. This might not be the most accurate way to do this, but at least it's fast.

His code makes three different "palettes" from the image - average, dark and light - and outputs them as a range of colored boxes for each all of the three palettes. Examples of the output are also included in the post.

tagged: imagick color palette average dark light tutorial imagick color palette average dark light tutorial

Link:

David Coallier's Blog:
Simple DBAL, PHP5, Light, Fast, Simple.
Aug 28, 2007 @ 09:32:00

David Coallier has posted about a database abstraction layer that he's been developing for PHP 5.2.x only systems and wants some opinions on his methods:

I made a very light DBAL that uses PHP5.2.x only (Since many people seem to want that) and it has the exact same DSN syntax as MDB2 for now and the query method are also called the same (No API Changes). [...] The main goal of the DBAL is to have a very effective and light way of switching RDBMS but also the possibility to change your DBAL to something more "0feature complete" as such as MDB2.

He includes the list of query method names and the types of databases that he wants it to support (as well as mentioning the fact that it would be unit tested for reliability).

tagged: database abstraction layer dbal php5 light simple fast mdb2 database abstraction layer dbal php5 light simple fast mdb2

Link:

David Coallier's Blog:
Simple DBAL, PHP5, Light, Fast, Simple.
Aug 28, 2007 @ 09:32:00

David Coallier has posted about a database abstraction layer that he's been developing for PHP 5.2.x only systems and wants some opinions on his methods:

I made a very light DBAL that uses PHP5.2.x only (Since many people seem to want that) and it has the exact same DSN syntax as MDB2 for now and the query method are also called the same (No API Changes). [...] The main goal of the DBAL is to have a very effective and light way of switching RDBMS but also the possibility to change your DBAL to something more "0feature complete" as such as MDB2.

He includes the list of query method names and the types of databases that he wants it to support (as well as mentioning the fact that it would be unit tested for reliability).

tagged: database abstraction layer dbal php5 light simple fast mdb2 database abstraction layer dbal php5 light simple fast mdb2

Link:

Synfony Project:
New testing framework
Sep 19, 2006 @ 07:44:42

On the Synfony project's blog, they've posted about a new testing framework that they've implemented for their framework based around something they call "lime".

If you keep an eye on the timeline, you probably saw that the symfony unit tests have been completely reworked lately. This is because we switched from simpletest, which was fine but had side effects when functional tests were executed all at once, to our own testing framework, lime.

Lime is more lighweight than PHPUnit or simpletest and has several advantages. First, it launches test files in a sandbox to avoid strange effects between each test file run (one of the reasons we were unable to fix the old symfony core tests). It also introduces a new sfBrowser, sfTestBrowser and more importantly sfDomCssSelectorBrowser that allow you to write functionnal tests with ease. It is not backward compatible but is a lot more powerful than the old system. Oh, and it holds in a single file, lime.php, without any dependence.

They show some examples of its usage (and a note on which tests will need to be updated) as well as the output that would come of it. They've also included some sample tests (in the "test/" folder of the release) if you'd like to check it out more throughly.

tagged: testing framework lime simpletest light example results testing framework lime simpletest light example results

Link:

Synfony Project:
New testing framework
Sep 19, 2006 @ 07:44:42

On the Synfony project's blog, they've posted about a new testing framework that they've implemented for their framework based around something they call "lime".

If you keep an eye on the timeline, you probably saw that the symfony unit tests have been completely reworked lately. This is because we switched from simpletest, which was fine but had side effects when functional tests were executed all at once, to our own testing framework, lime.

Lime is more lighweight than PHPUnit or simpletest and has several advantages. First, it launches test files in a sandbox to avoid strange effects between each test file run (one of the reasons we were unable to fix the old symfony core tests). It also introduces a new sfBrowser, sfTestBrowser and more importantly sfDomCssSelectorBrowser that allow you to write functionnal tests with ease. It is not backward compatible but is a lot more powerful than the old system. Oh, and it holds in a single file, lime.php, without any dependence.

They show some examples of its usage (and a note on which tests will need to be updated) as well as the output that would come of it. They've also included some sample tests (in the "test/" folder of the release) if you'd like to check it out more throughly.

tagged: testing framework lime simpletest light example results testing framework lime simpletest light example results

Link:

Matthew Weir O'Phinney's Blog:
The light has not set on PHP
Jun 06, 2006 @ 17:16:23

Matthew Weir O'Phinney has posted his own rebuttal to the wide-spread Why the Light Has Gone Out on LAMP article posted recently.

In the post, the author makes an analogy of using PHP + MySQL as the equivalent of using BASIC, and then uses a quote that claims BASIC "has become the leading cause of brain-damage in proto-hackers."

I'm sorry, but using a language doesn't cause brain damage. And there are many levels to programming. And using Python, Ruby, C, C++, Java, etc., does not automatically make you a better programmer than those using one of "those other languages". You can write crap code in any language. You can also write great code in just about any language.

Matthew also mentions a real truth behind programming, no matter who you are - that it takes practice, lots and lots of practice. That's what it is - constant practice so you know better how to combat the troubles you might find the next time they rear their ugly head.

tagged: light set programming practice light set programming practice

Link: