Archive for the ‘Advanced PHP’ Category

The Trend is Zend … in PHP

Tuesday, February 9th, 2010

zend framework logo

Hi,

People ask me from time to time, what PHP framework is the best one to learn?

Well, I always look at technology choices with two things in mind:

  1. How capable is the technology?
  2. How accepted is the technology?

If you look around, it becomes pretty clear, that if you want to learn an effective web application framework, you want to learn the Zend Framework – indeed, the trend is with Zend.

Zend framework being used by companies large and small

I know from first-nerd experience that the Zend Framework is being widely adopted. Just recently for example, Intuit and the BBC have implemented new web apps that are Zend Framework based.

… I know because my good buddy Jon Lebensold of Zendcasts helped build one of them.

There are plenty of other examples out there I’m sure … and I am confident that the trend will continue towards the adoption of the Zend Framework. With the PHP company (Zend) and IBM behind it … it doesn’t take a brain surgeon to figure that one out.

Thanks for reading,

Stefan Mischook
www.killerphp.com

What are ORM Frameworks – the video!

Tuesday, December 15th, 2009

Hi,

I decided to create a video based on my recent article on ORM frameworks. I shot this in HD … so select the HD option if you got big pipes.

Let me know what you think.

Stefan Mischook

What are ORM Frameworks?

Tuesday, December 8th, 2009

Database Image

In the following article we will learn a few things about ORM frameworks:

  • What they are.
  • What they do.
  • When and why to use them.
  • And finally, what ORM options PHP’ers have.

Let’s start …

If you’re working with PHP, you will certainly find yourself working with relational databases (like MySQL) sooner or later. Anyone who has ever built a reasonably complex web application knows, that the SQL can get really hairy at times – especially when you consider all the data filtering that you have to deal with!

ORM frameworks to the rescue!

ORM is yet another nerd-acronym, it is short for Object Relational Mapping. In a nutshell, an ORM framework is written in an object oriented language (like PHP, Java, C# etc…) and it is designed to virtually wrap around a relational database. If you look at the name (ORM), it basically translates into: mapping objects to relational tables.

There are many different competing ORM frameworks out there, because many nerds have their own ideas as to how to best do things – nothing new here! But you know what, some of these nerds are right … not all ORM frameworks are created equal.

(more…)

Defending against SQL Injection attacks

Wednesday, December 2nd, 2009

First, let me just say that this is not a tutorial, this is an article meant to give you an overview with a few options thrown in.

Ok, let’s start …

You should protect your relational databases (like MySQL) from the dreaded SQL injection attack. These attacks are conducted by evil sniveling nerds, trying to insert damaging SQL code into your HTML form fields (and query strings too) to do things like … drop database tables or even wipe out your database altogether!

… These attacks are very real!

My Recent Experience

We recently put up our new shopping cart system … I personally keep on eye on activity, and to my surprise, we can get 25-30 attempted attacks a day! Man, if I could just get my hands on one of these guys ….

:)

Fortunately, there are a few code-centric steps you can take to protect yourself from these SQL injection attacks:

  • Use this function: mysql_real_escape_string() and wrap your input variables with it.
  • Use an object-relational mapping (orm) system to basically avoid writing SQL to begin with. I hear the best one for PHP’rs today is Doctrine
  • use a prepared statement that basically processes everything and cleans it up for you. PHP has the PDOStatement class for this.

Another option (that I like to use), is to just remove the database from any possible external interaction. Sometimes this is not possible but when it is, it works well. So for instance, our cart does not talk to a relational database at all, so all these SQL injection attacks we get just makes me giggle like a little school girl.

Stefan Mischook
www.killerphp.com

Live Webinar on Google Wave and the Zend Framework

Monday, November 16th, 2009

Hi Guys,

My good buddy and right-hand-nerd, Jon is being flown down to do a live webinar for the Zend geeks at Intuit. It seems the accounting giant has recognized Jon’s ability to take the complex and make it seem simple.

Just in case you don’t know, Jon is the author of our crazy cool shopping cart tutorial and our new series on advanced PHP.

… Jon is starting to realize that my choice to go with the Zend Framework a few years ago made sense. Actually, it made dollars and cents!

:)

OK, bad nerd humor … I know. I’m just low on material that isn’t profanity laced.

If you want to know WHY, after looking at all the other PHP frameworks out there, that I thought the Zend Framework was the best choice long term (even back when Zend was still in Beta) .. you’re going to have to ask!

Anyway here is the official announcement:

Jon Lebensold, author of the popular PHP Shopping Cart and founder of Zendcasts.com will be writing a Google Wave Gadget in Boston at Intuit’s East coast office. Intuit is setting up a live webinar which you can attend by registering on the Zendcasts website.

Zendcasts.com began this year with the hope of assisting intermediate PHP developers further their Zend Framework skills. If you’re a PHP developer interested in building apps on Google Wave or want to watch someone build an AJAX application with web services like Google Wave and Intuit’s QuickBase, this free webinar will be worth spending a lunch hour at your desk.

The webinar takes place Wednesday, November 18 at 12:00 (noon) Eastern Standard Time (GMT -05:00).Register online now.

Here’s the banner:

qb-gwave-promo

Just in case you are not familiar with Quickbase … just click on the link.

That’s it for today. But coming soon, I will have some pretty big news … actually, the biggest thing to come to killerphp.com since we ordered that huge pizza! Ok, even bigger than that!!

;)

Stefan Mischook
www.killerphp.com

Getting into PHP6 and Advanced PHP Concepts Part 7

Friday, November 6th, 2009

Hi,

In our never ending quest for pure PHP nerdness, we continue our look at advanced PHP. This is video 7 of a series of videos where we explore PHP6 and other advanced PHP concepts, concepts often seen in PHP frameworks like Zend, PHP Cake and others.

The video:

More to come.

Stefan Mischook
www.killerphp.com

Getting into PHP6 and Advanced PHP Concepts Part 6

Sunday, November 1st, 2009

Hi,

They just keep on coming! This is video 6 of a series of videos where we explore PHP6 and other advanced PHP concepts, concepts often seen in PHP frameworks like Zend, PHP Cake and others.

The video:

Yes, I’m using Youtube … it saves me bandwidth! I’ve been pushing 250 GB a month just on Killerphp.com!

Many more to come,

Stefan Mischook
www.killerphp.com

Getting into PHP6 and Advanced PHP Concepts Part 5

Tuesday, October 27th, 2009

Hi,

As promised, this is video number FIVE of a series of videos where we explore PHP6 and other advanced PHP concepts, concepts often seen in PHP frameworks like Zend, PHP Cake and others.

You can expect this series to continue over the next several weeks.

Thanks for watching!

Stefan
www.killerphp.com

Getting into PHP6 and Advanced PHP Concepts Part 4

Friday, October 23rd, 2009

Hi,

As promised, this is the FOURTH video of a series of videos where we explore PHP6 and other advanced PHP concepts, concepts often seen in PHP frameworks like Zend, PHP Cake and others.

You can expect this series to continue over the next several weeks.

Thanks,

Stefan Mischook
www.killerphp.com

Getting into PHP6 and Advanced PHP Concepts Part 3

Wednesday, October 21st, 2009

boxshot-advphp

Hi,

As promised, this is the third video of a series of videos where we explore PHP6 and other advanced PHP concepts, concepts often seen in PHP frameworks like Zend, PHP Cake and others.

You can expect this series to continue over the next several weeks.

Thanks,

Stefan Mischook
www.killerphp.com

Getting into PHP6 and Advanced PHP Concepts Part 2

Tuesday, October 20th, 2009

boxshot-advphp

Hi everyone,

As promised, here is my second installment of our new PHP video tutorial course that covers more advanced PHP subjects including:

- PHP 6
- Advanced PHP architectures seen in PHP frameworks like Zend, CakePHP etc …
- Magic methods
- anonymous functions
- namespaces

Etc …

The second video:

Just in case you missed it, here is the link to the first part of Getting into PHP6.

Thanks for watching,

Stefan Mischook
www.killerphp.com

Getting into PHP6 and Advanced PHP Concepts Part 1

Friday, October 16th, 2009

boxshot-advphp

Hi everyone!

I’m back again (after my big move across town) and this time, I’ve got a new set of PHP video tutorials!

… Yes, people started to wonder why killerphp.com had a bunch of Javascript videos coming out; shouldn’t those videos belong on killerjavascript.com!?

;)

Anyway, I am happy to announce our new set of PHP videos that cover more advanced PHP subjects including:

- PHP 6
- Advanced PHP architectures seen in PHP frameworks like Zend, CakePHP etc …
- Magic methods
- anonymous functions
- namespaces

Etc …

The ultimate goal of these techniques is to learn how we can write more compact PHP code.

The first video:

That’s all for now.

… Now if only I can figure out why my new external drive is clicking?

Stefan Mischook
www.killerphp.com

JQUERY Video Tutorial Course.

Thursday, September 3rd, 2009

jquery-box-shot-medium

Hi,

I like to announce our new JQuery video tutorial course.

Though not strictly related to PHP, JQuery is a very popular Javascript library that many PHP programmers find themselves working with.

Besides straight JQuery videos, we do get into some PHP specific subjects:

  • PHP and Ajax
  • PHP and JSON

The table of contents:

* Getting jQuery: Part 1 – 8:22 minutes
* Getting jQuery: Part 2 – 8:57 minutes
* Events: Part 1 – 14:43 minutes
* Events: Part 2 – 13:23 minutes
* Dom manipulation – 10:39 minutes
* Ajax introduction – 10:16 minutes
* Ajax with PHP – 17:59 minutes
* Introduction to JSON – 14:47 minutes
* PHP classes with JSON – 21:21 minutes

-

This is not a one of my completely free courses but I released about 40 minutes of free videos from the course.

About the course:

jQuery is the predominate AJAX / Javascript library that is used by Adobe, Microsoft and many other companies and organizations.

Learning jQuery will make it easy for you to create all kinds of cool DOM and Ajax affects with very little effort. Beyond the canned menus and affects, jQuery also makes it easier for hard-core Javascript and AJAX programmers to get things done.

Thanks for reading,

Stefan Mischook
www.killersites.com

What makes a professional programmer?

Tuesday, August 11th, 2009

I recently got an email question put to me by someone wanting to know what makes a professional programmer:

Since I have started my career, I have been working for managers who really don’t know how to program. I have been improving myself through tutorials and books. However, I still don’t know whether i’m a good programmer or just better than the guys i’m working with.

Can you tell me what makes a good programmer? Better yet, please tell me what level should a PHP programmer be at after three years of development?

The short answer:

A good programmer is able to put out clean code that works and is easy to update. Simplicity is a sign of professionalism in any profession or discipline.

In the same email, he continues to ask:

Can you give me a list of books or subjects I should know by now (three years of development). Any advice you give would be much appreciated.

Beyond PHP basics (and the core functionality), I would suggest that PHP programmers should work to learn the following:

  1. Object Oriented PHP
  2. Learn about design patterns. Important ones include: MVC, decorators and factories.
  3. Learn an MVC framework like the Zend Framework or PHPCake etc …
  4. Get deeper into PHP; understand how it works under the hood. This will help you later on when trying to decided how to most effectively build applications.

Notes:

Like any other language, PHP sometimes gives you a few ways to do the same thing. It makes sense to learn the advantages and disadvantages of each for the sake of optimized code. For example, PHP provides a few different ways to interface with MySQL … you have the classic libs but you also have new object oriented methods.

When it comes to learning design patterns, it might be easier to learn a PHP framework at the same time. Why? Many of these frameworks often times provide great examples of popular design patterns.

Final comment:

Though the above is ideal, I’ve have seen many PHP programmers who don’t have half the skills I mention above, but were still effective programmers who got the job done.

Stefan Mischook

www.killerphp.com

PHP Video: Controllers in MVC

Thursday, June 25th, 2009

php video

Hi,

In this video, I talk a little about the MVC design pattern with special attention to the middle layer in MVC: the ‘controller’.

A few points:

- MVC is short for Model View Controller
- The Controller is the part that brokers the communication between the View and the Model.
- The Controller is the throw-away part in MVC.

Watch the video for more details.

(more…)

PHP Video: Why Zend instead of other PHP Frameworks?

Sunday, June 14th, 2009

php video

Hi,

In response to my a recent podcast where I recommended that PHP programmers learn the Zend Framework, I was asked why I choose Zend, rather than other PHP frameworks.

The video:

(more…)

PEAR vs. Zend Framework

Friday, March 14th, 2008

PEAR vs. Zend Framework

Now that the Zend Framework is ready for ‘prime time’, I’ve been considering the Pear framework with regards to how it now fits in the PHP world.

zend framework logo

NOTE:

Several picky nerds have pointed out that PEAR is not a framework – check out the comments below. OK, I would agree, technically speaking, PEAR is not a framework. That said, this is what the PEAR people say on the home page of their web site:

‘PEAR is a framework and distribution system for reusable PHP components. You can find help using PEAR packages in the online manual and the FAQ.’

Anyway, that is an argument of semantics and nerd-details … not the point of my article.

… Back to my article:


Both Zend and Pear are frameworks but how are they different?

I would say that the Zend Framework attempts to create a comprehensive whole – a consistent set of components that are designed to work together in a unified manner.

… That is one of the reasons for a framework in the first place.

Though unified, one of the cool things about the Zend Framework is that you can just pick and choose what components you want to use – you don’t have to buy the whole cake to take advantage of all that juicy object oriented PHP code.

About PEAR:
pear-framework-logo

With the Pear framework, it is more of a hodgepodge/motley of assorted components. Pear is widely used (and useful) but it does cross over (in terms of functionality) with what we have in the Zend Framework. So the question that comes to my mind is:

Do we still use Pear, if we have the Zend Framework?

(more…)

Zend Framework: Using View Helpers to Build Rich, Scalable, Controls

Tuesday, January 29th, 2008

Using View Helpers to Build Rich, Scalable, Controls
by: Jon Lebensold

Whether you’re developing an ASP.NET application, working with rails or dealing with a templating engine like Smarty, the idea of partial templates is not foreign. Partial templates allow developers and designers to work with panels or sub-groupings of content that need to be dynamic.

With a proper AJAX framework in place, these controls can be written in a way that they can be updated in whichever Controller they eventually reside. This kind of flexibility can allow you the flexibility of using certain signature controls for multiple parts of an application.

(more…)

The Zend Framework: Writing Object-Oriented PHP with Ease.

Wednesday, November 21st, 2007

Introduction

In my attempt to turn you nerds into uber-nerds, I’ve been lucky enough to get the young and talented Jon Lebensold (my right hand nerd) to bang out a few articles (and soon videos) on some of the emerging PHP technologies and working practices that take PHP into the enterprise arena.

Enterprise arena = sophisticated scalable and adaptable code.

About this article:

The following article introduces you to ‘web application frameworks’. If you don’t know what this is, read on and you soon will. But for those of you that are impatient … in a nutshell:

A web application framework is a set of code libraries (in our case, that would be libraries written in PHP) that handles/does many of the things that we typically need to do when building database driven websites.

For more details, you need to read the article.

Stefan Mischook

-

The Zend Framework: Writing Object-Oriented PHP with Ease.

By: Jon Lebensold

This article aims to introduce the concept of developing a PHP application with a set of libraries that facilitate development by abstracting ones self from writing generic libraries.

We know that classes are composed of behaviours (methods) and data (properties), however their value only becomes apparent when we develop applications in layers, with different components answering different questions.

What Does a Layered Development Approach Look Like?

(more…)

What is Source Control and Why Should I Use It?

Monday, November 5th, 2007

By: Jon Lebensold

So you’ve started developing this application for a client and naturally, he or she is really pleased with your development. Six months pass. You’re called in again to add a couple features to your existing application. Unfortunately, as you begin development, changes in the source code begin to occur.

(more…)

Top of page  go to top of page