Archive

Archive for the ‘IT’ Category

Class ‘Zend_Db_Table’ not found

March 4th, 2010

New developers sometimes struggle with putting all of Zend Framework’s pieces together. This week someone asked me how to resolve the error:

Fatal error: Class ‘Zend_Db_Table’ not found.

The answer: he needs to “require” the file containing the Zend_Db_Table class, like so:

require_once 'Zend/Db/Table.php';

or (my preference) use the autoloader:

// ZF 1.8 or later: add these lines to your bootstrap file:
require_once 'Zend/Loader/Autoloader.php';
$loader = Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true);

ZF isn’t complicated if you know the few things you MUST use. The autoloader is one of them.

If you need help getting started with Zend Framework, contact me about Zend Framework mentoring, training, or troubleshooting.

Author: Alan Seiden Categories: IT, PHP, Web development, Zend Framework Tags:

Zend Server beta for PHP on IBM i: I like it

February 3rd, 2010

I’m recommending that people try Zend Server beta for IBM i if they’re using PHP on the IBM i. Even though it’s in beta, Zend Server brings improvements over its predecessors, Zend Core and Zend Platform. Improvements include:

  • Easy new user interface combining the best of Core and Platform
  • Better interface makes it easier for people to discover and use features such as code tracing and debugging
  • Elimination of mandatory proxy server (always a thorn in my side!)
  • Use of IBM’s supported, full-featured, flexible Apache server rather than the limited PASE server
  • Better performance

One caveat: the current beta version (as of February, 2010) is missing some functionality that will be available in the generally available (GA) release. Temporarily missing functionality includes:

  • no support for the mail() function (use Zend_Mail or Phpmailer instead in the meantime)
  • inclusion of an older version of the ibm_db2 driver. This version doesn’t have support for the “i5_libl” option. Ask Zend to send you the updated db2 driver if you need it.

I’m looking forward to trying the next beta version and eventually the GA release.

I believe Zend Server will shorten the learning curve for new users and simplify advanced configurations for us “veterans.”

Download it here: Zend Server beta for IBM i

Author: Alan Seiden Categories: IBM i, PHP, System i Tags:

PHP on IBM i (and me) at ZendCon 2009

September 29th, 2009

This year’s ZendCon (Oct. 20-22, 2009, in San Jose, Calif.), the premier PHP conference, features several presentations about developing with PHP on the IBM i, including one by me!

Come hear me speak about “Zend Framework for Enterprise PHP on IBM i” on Tuesday, Oct. 20, 2009, at 4pm.

For details, go to http://www.zendcon.com.

Speaker: Zend/PHP Conference 2009

Our Zend Framework-based Site Honored by IBM/COMMON

May 21st, 2009

We won! IBM has recognized my use of PHP and Zend Framework, and our entire team’s RPG/DB2 and design work, by naming our web solution the IBM i’s most innovative of 2009.

At IBM’s 2009 COMMON conference, IBM awarded the Power Systems Innovation Award for Best Web Solution for eBiz@ABG. The site, developed with my colleagues at  Strategic Business Systems, Inc., was created for New Jersey’s largest wine and spirits wholesaler, Allied Beverage Group.

The system offers product ordering, live inventory levels and pricing, and a full-text search of Allied’s large product catalog. The application was built with Zend Framework (the leading PHP framework) and runs entirely on Allied’s IBM i, leveraging Allied’s db2 database and time-tested RPG logic.

The site is password-protected, so unfortunately I can’t link to it here.

eBiz@ABG is one of the first sites to be built with Zend Framework on IBM i (System i, i5, iSeries, AS/400). It was a true collaboration with Allied, made easier because we all spoke the language of “i.” What’s more, by using large chunks of Allied’s existing RPG code that already handled the complex business logic, we saved time and avoided reinventing the wheel.

Zend Framework worked so well that I committed to mastering it and teaching the community about it. (ZF has a learning curve, but after that curve is mastered, ZF speeds development and offers easy maintenance and growth.) I earned my Zend Framework certification in August 2008, becoming one of the first 50 worldwide to do so and the first ZF-certified “i” professional. Since then, I’ve gone on to be a ZF/i mentor for other development teams, and have become a public speaker, sharing my PHP/ZF/i roadmap at conferences.

Thanks to Allied for the opportunity to collaborate on a great project; thanks to Strategic Business Systems for the support; and thanks to IBM for the award.

How to Study for the Zend Framework Certification Test

January 6th, 2009

When people ask me how to study for the Zend Framework certification test, here’s my answer:

  • First—and I hope this goes without saying—you should already be fairly skilled in developing with Zend Framework, or least with some of its components. Then you’ll have internalized the ZF “style” and will be ready to study the components you haven’t used yet. (To get started with ZF, try the “quick start” tutorial or consider formal training.)

  • Then download the free ZF Certification study guide. It’s just a guide, so don’t expect it to explain Zend Framework in its entirety, or even in the clearest way. The guide will, however, indicate which topics to study and what sorts of questions will be asked. Given that knowledge, you can use other resources to answer your questions as they arise.

  • Each component is explained in the Zend Framework Programmer’s Reference Guide. It’s well written and is organized by component, such as Zend_Acl, Zend_Auth, and Zend_Form. Also included are Zend’s coding standards and a performance guide.

  • Whenever I got confused, I went right to the Zend Framework source code. As a developer, I can digest code faster than I can read a manual. So I recommend reading the code in your favorite IDE whenever you have doubts. You’ll also learn how the developers structured their code, which will help when you need to understand or extend ZF’s functionality for your future projects.

In addition to these resources, Zend now offers training for Zend Framework certification. If you prefer a structured approach, this might be for you.

No matter how you study, the certification process will make you a better ZF developer. In my case, I learned about unfamiliar components and deepened my understanding of the familiar ones. I also got really comfortable delving into the ZF code.

Good luck to everyone!

Author: Alan Seiden Categories: PHP, Zend Framework Tags:

Why Use a PHP Framework?

June 25th, 2008

At last night’s NY-PHP gathering, a fellow PHP’er and I discussed PHP frameworks. I told her I was developing an e-commerce site using Zend Framework. She replied that she’d been considering frameworks, especially Cake and Symfony, “but I’m not sure I need a framework at all. I write my own SQL; my apps work fine. What would a framework do for me?”

Setting aside the differences between PHP frameworks, I’m aware of at least 4 reasons to use them:

  1. Modular design: A home-grown application, with its ad hoc growth, can become a tangled mess that’s hard to change or enhance. Most mainstream frameworks provide a modular design that makes it easier to modify or add components.
  2. Flexible components: Sure, you can write your own authorization class in PHP, but why reinvent the wheel? The framework will provide an integrated component that handles not only your current needs, but requirements that you haven’t yet encountered (but that the framework’s community has). With a framework, chances are that you won’t have to redesign your authorization system when the users ask for something new.
  3. Best practices: As you use the framework, you’ll begin to absorb the practices and (we hope) good habits of the framework’s creators.
  4. New capabilities: Frameworks regularly add functionality to help developers implement new technology. These days, common enhancements involve AJAX and connections to the APIs of popular web service providers.

Developers may understandably wonder if mastering a framework is worth the learning curve. In my opinion, the effort to learn a framework will be repaid with applications that are well structured, flexible, and easily maintained.

Author: Alan Seiden Categories: IT, PHP, Web development Tags:

My first open-source project: Mantis/400

November 27th, 2007

Mantis/400 adds DB2 support to Mantis, the popular PHP-based bug tracking application. I programmed the upgrade with Ira Chandler of Curbstone Corporation, personnel from IBM and Zend, and Mantis’s Victor Boctor.

Mantis/400 runs on IBM System i (formerly AS/400), using Zend Core for i5.

Even before we got involved, Mantis supported several databases, thanks to theADOdb Database Abstraction Library for PHP (and Python). ADOdb’s support of DB2 needed help, though, so we improved it, particularly for System i’s version of DB2.

I recommend the open-source process to anyone who enjoys learning a lot and meeting good people. Our team zestily shared knowledge and discoveries.

More information is available in Alex Woodie’s story in IT Jungle: Mantis Bug Tracker Ported to i5/OS.

Author: Alan Seiden Categories: IT, PHP, System i Tags:

New York Software Industry Association writes about my work with System i/PHP

February 26th, 2007

My work to foster PHP on IBM System i was noted in the Feb. 21, 2007, edition of buzz@nysia, the New York Software Industry Association’s weekly news report. I am delighted that buzz@nysia columnist Donna Bogatin chose me as a featured “mover and shaker.”

Author: Alan Seiden Categories: Announcements, PHP, System i Tags:

PHP mail() on IBM System i

October 7th, 2006

My new article about mail() is available at MC Press Online. The article covers:

  • Zend Core’s implementation of mail() for IBM System i
  • How mail() compares to packages such as PHPMailer
  • Function definition and example
  • How to configure SMTP in Zend Core
  • Overriding defaults with ini_set
  • Troubleshooting

Read it here.

Author: Alan Seiden Categories: IT, PHP, System i, Web development Tags:

Site Upgraded to PHP 5

October 5th, 2006

Early this week I called my web hosting provider, BlueHost, to ask to be upgraded from PHP 4 to 5. They graciously offered to move my files to a PHP 5 server at no charge. I was warned, though, that my site might be inaccessible during the move.

Later that day, I saw that the site was running on PHP 5.

One problem: my custom MX records, pointing to the wonderful FastMail email host, were reset to their defaults. People who wrote to me the morning of October 3 had their email bounced back to them.

BlueHost corrected my MX records quickly once I told them. Email flowed properly within an hour or so.

Lesson: anyone with custom MX records should, if altering web host settings, check the MX records immediately thereafter. Easy way to check: MX Lookup Utility.

Author: Alan Seiden Categories: Announcements, E-mail, PHP, Web hosting Tags: