PHP

New Contributor - Peter Harkins

Let's all give a warm welcome to our newest contributor, the incredibly brilliant and good-looking Peter Harkins.

That's right, clap for me -- er, him, clap for him. I'm not writing this about myself. I mean he's not. Crap.

Hi, folks. I'm a new contributor to CodeSnipers. I'll be writing mostly about design and coding, though I may wander into MicroISV territory if any of my side projects should start doing particularly well.

To tell you a little about myself, I'm a 25-year old web developer in Chicago, IL, USA, Earth. I've been programming for about fourteen years, professionally for the last 5.5. My constant obsession is writing code that's just a little bit better, a little bit smarter, a little bit higher-level. Even though the steps I've taken and will be writing about are small, they're a great way to improve code and design every time you touch it.

New York PHP Conference and Expo

June 2006 Event to Feature Recognized Speakers and Exhibit Hall

NEW YORK – New York PHP, the leader in uniting business and community for open source, announces that it will host the New York PHP Conference & Expo, June 14 – 16, 2006. The conference, titled “The PHP Business Community,” will be held at The New Yorker Hotel in New York City. NYPHPCon 2006 will emphasize both business and technical sessions, giving the audience a chance to learn how to better implement PHP within their enterprise and current infrastructures.

“This conference is a chance for the business and technical sides of PHP to come together at a single event” says Hans Zaunere, President and Founder of New York PHP. “The New York PHP Community has already had a chance to hear many of the top speakers present on a regular basis – now this conference is a chance for the rest of the world to visit New York City and see them all under one roof.”

Stupidly Easy MVC - Group Membership Application - Part 2

This is part two of an example of using my Stupid Easy MVC framework in PHP. In this example we will talk about the how to use the Model. Originally I thought I might make the Directory a separate controller, but at this point I decided not to. I have some more ideas that I haven't quite worked out yet for extending this even to be more like the Rails framework for Ruby (again I do not expect to totally implement RoR, spare the language wars please!).

Stupidly Easy App Walkthough

One day, the phone rings.
Joe: Hey!! can you make a website for my Candy Wrapper Club?
You: "Candy Wrapper Club?!?"
Joe: "Yes! We collect Candy Wrappers! We just need a little bit about the group, how to contact us and a membership list. It will probably only take you a week. My cousin has a webserver with PHP and MySQL. How about it?
You: <sigh> Sureeeeeeee, I've been wanting to try this MVC thing with PHP.
This is a long one, so grab a cup of coffee!

Stupidly Easy MVC - Directory Structure

There are probably many ways to setup a structure using MVC and this article will talk about two of the ways I have done it and explain why I did it that way and how I think it works out after the fact.

Structure 1
For this project, I used Ruby On Rails as inspiration (Imitation is the best form of flattery, yes?) and used a separate directory for each of the Model, View and Controller. I knew I I was going to have multiple models as well. I used inline php/html for the view for this project since it was only a few forms and we didn't want to do a template system yet. It would be easy to change to templates later of course by just editing the view methods to call a template instead of spitting out html.

More Stupidly Easy MVC in PHP

If you've been living under a rock and missed the previous two articles about this EASY 3 class framework, go read Part1 and Part2.

After my initial project where I first created the simple framework I have since used it on 2 other projects. I didn't even use a template solution for one of them, making it even MORE simple. So I've had a chance to really collect my thoughts on this and put it through the ringer. I've had requests for more examples on using this and hopefully this will answer some of your questions.

Sharing my cool toys

I was berated the other day by Keith. He told me about PLEAC and I said yeah, I know!! He said no fair you didn't share your cool toys! So for all you remaining coders out there, I'm sharing! Here's a few handy code snippet sites and I'll review for you today.

PLEAC
This site uses the Perl Cookbook as the basis (which has the Perl source freely available) and volunteers rewrite the snippets in other languages where possible. Very handy, if you know one language and wonder how you would do it in another language.

Embarking on PHP5 Objects

After a brief few weeks studying Perl and its nuances I'm going to take a look at PHP5 Objects. Perl is rather strange when it comes to objects, its basically a hash with methods. May whatever god you Perl programmers worship bless you. Supposedly when Perl 6 comes out (similarly, we don't know when the end of the world will come either) it will have real objects.

One of the annoying things with object in PHP 4 was you had to use a lot of references, you know, that funny & symbol. No longer needed in PHP 5 because you use "Object Handles" perhaps similar to a file handler you when fopen a file. Also available now are access modifiers "public/protected/package" and interface implementation. I can hear the beer mugs of java programmers being raised in celebration to this one. Also new to PHP 5 are real constructors and destroy methods. There are many more features, but lets see some code.

Interview: Chris Shiflett of Essential PHP Security

This is the third in a series of interviews we're making available to the CodeSnipers community. We have been working to track down people who we thought had something valuable to say about the software development community, tools, practices, or direction. Some of the names you will recognize immediately, others you've probably never heard of, but all of them have made an impact in one way or another. Without further delay... we have Chris Shiflett author of Essential PHP Security.

Security is one of those things that many developers think to "bolt on" after the main system has been developed. What is the proper way to think about web application security?

Security isn't much different than other abstract concerns such as performance, maintainability, and reliability. None of these characteristics can be added very easily to an existing application - they need to be considered during every stage of development. (It's like trying to add wisdom to a child.)

They're also difficult to measure. The measure of an application's security is its ability to predict and prevent security problems before they are exploited. It's an ongoing process that begins with a solid design.

Perl vs. PHP - Datatypes[arrays|lists|hash|map]

I've made a few friends recently who are ultra Perl geeks (Yes, you know who you are. Andy, Liz and Brian!) and they are rubbing off on me. I learned Perl a little bit, about 6 years ago when I first started web programming but I didn't know any Perl programmers so I had nobody to pester with questions. I always said that Perl was cryptic so Perl Elitists could show off their l33t ski11s. But I've found it's not all that bad…

I know PHP so well, that it helps my understanding to compare Perl to php (Don't flame me Perl folks! I'm not promoting one over the other, just comparing and contrasting).