Archive for the ‘Events’ Category

php|works 2006 Day 3

Session 1: eZ components

Derick Rethans Slides

eZ components are re-useable, clean IP, Open Source friendly, building blocks that you can use in your PHP applications.

Similar to PEAR, it requires a base class for common exceptions and other common elements and provides components for:

  • Command line
  • File
  • database
  • Mail
  • Image
  • Logging and Debugging
  • System Information
  • as well as a output Templating and Translation component.

Components are generally independent and do not rely on other components unless absolutely necessary and each class in prefixed with ecz to eliminate the possibility of conflicting with your existing classes.

Installation is as simple as downloading the latest source and adding the appropriate ini include path. the only trick is that component framework relies on the __autoload() function so if you’re using it in your framework, you’ll need to check for the components using ezcBase::autoload($classname); (assuming you’ve already included the base using “require ezc/base/Base.php”).

For installation of new components, you can also use the PEAR installer using the channel://components.ez.no, so for example to install the base automagically, just run PEAR install channel://components.ez.no/Base

For usage examples see the docs or Derricks slides from the seminar. Neat things include:

  • Console table formatting and progress bars!
  • Really nice logging components for creating and managing your own custom log files.
  • Database query abstraction, looked a little messy to me, but I’ll have to check it out a bit more before I judge.
  • Creating and sending MIME mail (similar to PEAR)
  • Feed readers
  • Graphs
  • SignalObserver: IPC for PHP

Session 2: Explaining EXPLAIN

Lukas Smith Slides EXPLAIN is an SQL keyword implemented by most databases that outputs what the query is going to do (execution plan) and ‘explains’ how it’s going to do it and the estimated “execution cost”. If your queries are running slowly, using EXPLAIN could reveal some interesting information about the performance of your query and where you can improve things. Remember however that EXPLAIN isn’t actually part of the SQL standard, it’s just a nice developer feature added after the fact.

When looking at the output of EXPLAIN:

EXPLAIN ANALYZE SELECT * FROM customer JOIN contact USING (last_name);

QUERY PLAN

Hash Join (cost=1.02..92.23 rows=2048 width=351) (actual time=1.366..58.684 rows=4096 loops=1) Hash Cond: ((”outer”.last_name)::text = (”inner”.last_name)::text) -> Seq Scan on customer (cost=0.00..60.48 rows=2048 width=107) (actual time=0.079..21.658 rows=2048 loops=1) -> Hash (cost=1.02..1.02 rows=2 width=287) (actual time=0.146..0.146 rows=2 loops=1) -> Seq Scan on contact (cost=0.00..1.02 rows=2 width=287) (actual time=0.074..0.088 rows=2 loops=1) Total runtime: 62.233 ms

the order of the table is important. Form the presentation, in general for complicated queries, PostgreSQL is better at picking a good execution order over MySQL (ya!).

When using indexing, the formate of your query is important. for example in you have a table where c1 and c2 columns are indexded, “c1=c2 AND c1=12″ would be better written as “c1=12 AND c2=12″ as the index may not be used on the c1=c2 comparison.

PostgreSQL allows you to specify the storage order of the records in your table so you can further optimize based on what you’ll be sorting on (he didn’t say HOW to do this, I’ll have to look into it more).

Lukas has a tendency to run out of time on his presentations so he was flying through this presentation to fit it in. I stopped typing everything to pay attention so definitely check out the slides. Related

Session 3: Apps Made Easy on Zend Framework

John Coggeshall

I’ve poked about in the Zend Framework (even submitting a proposal which was ultimately rejected due to the scope of the framework) and have been following it closely. Were at a point at work where we need to reevaluate some of our platform and decide if there are better alternatives out there. ZF combined with PEAR and eZ components, offer a lot of compelling reasons to start integrating more ‘off the self’ components rather than trying to re-invent the wheel.

The Zend Framework is just a small part of the PHP collaboration project that offers a “clean IP”, modular collection of PHP classes based on PHP 5 / E_STRICT. It provides a starting point for all your applications and demonstrates the PHP 5 best practices. It’s modular design allows only pieces to be used within your applications and achieves it’s goals with a minimal object hierarchy.

One of the ideals I like the best is that the frameworks strives to be simple and easy to use. “Simple things should be simple, complex things should be possible”. the architecture is distributed as a package, not as individual modules, which provides a “use at will” setup so everything is accessible if you want it.

The framework is namespaces to Zend:: and all constants are class based so it will lay nicely with any other components (ez, Pear). Other than setting up the proper include path in your php.ini file, all you need to do is download it (or check it out from the subversion as I do).

ZFApp

ZFApp is a framework based of ZF that sets up the initial structure of an application using the Zend Framework. It’s in the Lab project of Zend’s framework, where non-core idea prosper. ZFApp is working towards, for example, being able to write a blog in 30 minutes with all the bells and whistles including authentication, searching, syndication and more.

Taking a lot from Ruby on Rails, ZFApp provides a rudimentary installer that sets up an initial app framework where you can then begin to play. Taking the “Convention over Configuration” approach, you can then add controllers and views in the specified format and -tada-, your app will be up and running is seconds.

The demo app for the seminar was a fully functioning blog app, which appeared well rounded on minimal code. If you’re looking to build new apps based on the Zend Framework, this is definitely worth a look. From the brief introduction, the only hesitation I have is the views reliance on Smarty. I’ll have to explore more but allowing alternate template engines would be a nice add-on.

Roundup

Overall the conference was worthwhile, much better than last years. The speakers seemed well prepared and knowledgeable but I was more selective about what sessions I attended based not only on the topic but also the speaker. A few speakers could have presented themselves in a little more professional manner (no ripped shorts and flip-flops please) but the content of their presentations was still good.

I didn’t get a chance to attend the after hours events but I heard they went well so I’ll have to attend next year. Aside form the conference, I do have a few gripes with Wordpress now that I’ve been using it consistently for tree days (code formatting and headers anyone?).

As for ideas, I have a ton. I mentioned in a previous post that we’re in the rocess of migrating to PHP5 at work and I’m responsible for upgrading and improving the overall framework and system. Zend Framework, XML, convention over configuration, namespaces and a bunch of other PHP5 goodies will be at the front of my brain as we wade further into v5. It’ll be exciting!

And as a followup to my Ap’p'le post, they’ll be replacing my MacBook keyboard, but I have to leave it with them for a week once they get the part in. I’ll have to argue that a bit more as I live an hour from the store and my wife and I are expecting our first child next week so I’m not going to have time to be diving there at their leisure, let alone be without my MacBook for a week when the baby’s coming and I have to unload my cameras!

Oh, and here’s the solution they came up with for the lack of plugs…

Plugs

php|works 2006 Day 2

Aside: just a note that I think abot 30-40% of the people here are using Mac laptops and about 80-90% of the speakers are.

Keynote: Microsoft platforms for the PHP Developer

Joe Stagner (Microsoft) An introduction to PHP on Windows and why you should consder it. I didn’t take a lot of notes here since we use Linux/Apache/PostgreSQL/PHP at work and have no intentions of changing for a variety of reasons I won’t get into here. This was recorded so perhaps they’ll distribute it from the phparch site.

Mentioned was PHP Designer, which may be worth a look.

(more…)

php|works 2006 Day 1

Keynote

Rasmus Lerdorf Slides (may not be working yet)

Yet another excellent keynote by Rasmus, I’ll have to track him down at lunch for a little chat. Rather than go into detail, I’ll just link to the video of the keynote on Google. Highlights are:

  • Flash and IE header/cookie hacks
  • Optimizing your server and script to handle a Digg/Slashdot (including how to find bottlenecks)
  • Dom and simple XML
  • Geocoding/maps/flickr
  • Real file upload progress detection in PHP 5.2, Finally! (source)

(more…)

A midday surprise

Went to lunch at the conference and figured I’d browse the books at the regisration desk. Guess what I found…

book.jpg

php|works 2006 Day 0.5

Arrived early again today so I have almost an hour before the Rasmus Lerdorf keynote starts. Just a quick post over my excitement on getting free swag in the conference package - an Apress t-shirt! Coincidence?

Apress shirt back Apress shirt front

php|works 2006 Day 0

The official conference doesn’t actually start until tomorrow as today was an ‘extra’ day of in-depth tutorials (hence day 0 not day 1). I was however pleasantly surprised by the initial preparedness of the extra day. I arrived an hour and a half early (to beat the downtown Toronto traffic) and they were already accepting registrations and everything was ready to go. Last year I was worried I was in the wrong building as I waited in the lobby for about an hour before I even saw signs of the conference. The location itself is pretty easy to get to and has a nice atmosphere.

Conference Room

(more…)

Off to the conference

I’m attending the PHP Architect PHP conference tomorrow so I’ll be posting a summary of the seminars I attend and hopefully some video (The video may be delayed a bit though as I have to get it off the camera). Check back later tomorrow night for the first day’s report and my thoughts about the new PHP5 certification exam.

Zend PHP5 Certification: Coming to a conference near you.

I just finished watching (or listening as there wasn’t much to see) the php|architect ‘Get PHP 5 Certified’ webcast and am looking forward to taking the PHP 5 certification exam at the public launch during the upcoming php|works conference in Toronto. The exam is currently in beta and only a few select ZCE’s have been allowed to test it out.

The exam has been completely re-written but will follow the same multiple choice/multiple answer/fill-in-the-blank format of the previous exam. Also, if you take the test at one of the many testing centers, you still won’t know your final score beyond pass/fail, but you will get a summary of the subjects/areas where you should improve. Helpful for those who fail the test and want to re-take it again.

It’s nice to see the certification process advancing along with the language. It was mentioned during the talk that in the past, PHP has been seen as a hobbyists language but now with the improvements in PHP 5, and the upcoming PHP 6, enterprise has started to accept the language more and more. Certifying yourself can only help you gain credibility, and helps the PHP community gain credibility as well.

From the web cast, there were a few additional points:

  • An updated study guide will be released sometime before the conference.
  • The cost will be the same as the PHP 4 exam.
  • Currently there are no plans to continue the PHP 4 exam AFTER 2006, unless it is demanded by the community. So if you want to get certified in 4, you’d better do it soon.
  • Your certification and certificate will distinguish between 4 and 5.
  • Those of us who are already certified in PHP 4 will have to re-take the entire exam, no upgrades, but you can get a discount by contacting zend.

For more info on the conference check out the php|architect site and for more info on the exam check out Zend’s site.

Content & imagery © Copyright 2007 by Jeffrey Sambells as appropriate.