BCD Advances PHP-on-i Development in WebSmart
December 9, 2014 Alex Woodie
BCD Software has supported the PHP language with its WebSmart suite of IBM i development tools for several years. But with the last week’s unveiling of WebSmart version 10.6, the Chicago-based company is allowing PHP coders to do more advanced development using object-oriented techniques thanks to the addition of Zend Framework 2 (ZF2) and PHP data object (PDO) templates.
WebSmart’s support for ZF2 is aimed at more advanced developers who are looking to build enterprise-grade applications that incorporate a model-view-controller (MVC) architecture and object-oriented (OO) coding techniques. ZF2 provides this core MVC layer, and now BCD supports ZF2 in its DB2 for i database template in the PHP edition of WebSmart.
The Zend Framework brings other handy features in addition to the MVC and OO paradigm, such as security and authorization control; database access; session management; logging and message management; search engine and email integration; date and time manipulation; unit conversion; RSS and Atom feeds; enforcement of data input validation rules; GoogleApp APIs; JSON conversion; REST support; localization capabilities; PDF support; and advanced memory manipulation capabilities, among other features.
Support for the PDOs, meanwhile, allows WebSmart developers to incorporate OO concepts in the database layer, if not the application layer itself. According to BCD (which is owned by Quadrant Software), the PDO provides a database abstraction layer that allows applications to access either MySQL or IBM i DB2, and allows them to switch back and forth between the two supported IBM i databases. “Programmers should consider using these templates if they want the flexibility to change databases or host their applications on another platform,” BCD says.
Marcel Sarrasin, BCD’s director of marketing, says support for ZF2 and PDOs is a natural step forward for BCD and its PHP customers. When BCD first released WebSmart PHP in 2007, the company only supported standard procedural PHP, but as the customer base grew in size and sophistication, more customers became comfortable with OO techniques and technology.
“What we’re seeing is there is a higher level of sophistication on the learning curve,” Sarrasin tells IT Jungle. “There’s a small percentage of our customer base–and the PHP customer base in general on IBM i–that’s ready to take that route, but we’re seeing a bit more of that now so we thought it was time to create template to help that level of development.”
Not every PHP-on-IBM i programmer is ready to take the OO route with ZF2, Sarrasin says, but the number is growing. “It’s a learning curve,” he says. “It’s more complicated than coding PHP procedurally or at more of an introductory object-oriented entry. For a one-person shop doing internal applications, it might be overkill. The benefits start to pay off in larger applications where you’re really re-using code more and maintenance becomes a factor.”
The new PDO templates in WebSmart provide an intermediate step on that OO learning curve, Sarrasin adds. “We have the three levels,” he says. “PDO is kind of in the middle because it is an object-oriented application you’re creating, but the only object it’s creating is the database access. We’ve basically modulated the database access by using the PDO functions. That’s more the recommended approach for smaller projects. What’s interesting is ZF2 uses PDO as well as an option for database objects, but it also makes everything else in it object-oriented as well.”
WebSmart 10.6 also brings support for JQuery ThemeRoller, which makes it easier to use custom jQuery UI themes. ThemeRoller is a JQuery website where users can customize the look and feel of their user interfaces, and have those changes delivered in handy CSS files that users can apply on their websites.