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.

Session 1: What can PHP learn from rails?

  • Chris Hartjes

  • Convention over Configuration - follow my rules and you’ll be up and running in minutes. (Layout DB this way, put templates here, etc.)
  • Creates structure and discipline in code.
  • Developers working fast are more important than servers working fast.
  • Any app of significant size will require extensive customization.
  • Follow conventions.
  • Common framework provides foundation for discussion.
  • Nothing wrong with wanting the smartest people to be working on your projects. Smart people will want to use a smart tool.
  • Stop re-inventing the wheel. Build code that is modular.
  • Use cli to create a skeleton AND unit test automatically.
  • MVC forces modular code that provides separation.
  • Repeatable deployment of code from version control is the sweet spot.
  • Applying and reverting database alterations critical.

**Remember ** * Tools for developers should be easy to use. * convention over configuration shows that flexibility has a cost. * Agile, iterative development practices have finally reached the mainstream. * don’t ignore ideas because they come from different environments. * Resist the urge to recreate the wheel because you didn’t think of it in the first place. Cheating is OK as long as licenses are OK. * Understand the strengths (and weakness) of the tools you are using.

Session 2: Web Services: REST

Paul Reinheimer This is a BYOL (Bring Your Own Laptop) session so I’ll be codeing not taking notes, but I’ll post some code: (apologize, I’m working on a new theme so this code its all pretty right now) A simple REST client: [todo: figure out how to get wordpress to insert code without screwing it up] A simple REST server: [todo: figure out how to get wordpress to insert code without screwing it up] Remember * You still have to validate all data your receive from a web service. XSS can still happen through a blog post you accept from an RSS feed!

Session 3: Derick’s Ranting Hour

Derick Rethans A ranting hour- what can I say? GOTO goto is comming to a PHP version near you. You may argue this way or that but it was said that: “PHP was originally created to solve much simpler problems, but it is now used to solve much more complicated roblems, were GOTO can increase performance and decrease the amount of code you need to write” ~ Rasmus The real roblem in the end with GOTO is the abuse by people wo don;t understande it’s roper place. Bug reporting Be nice. Provide working reproduce examples. Be patient. **Be helpful if you hae a problem, unlike… ** * * BUG #32549 * BUG #29461

**Get it right ** Zend did not create PHP, nore does it write PHP (but some employees contribute) ## Session 4: Building Portable DB Apps

Lukas Smith Slides Why * Increased market opportunities * Forward compatability for new RDBMS version and extensions (like PDO) * Prevent lock in to one vendor/platform * Reducded training costs if using multiple DB platforms or exensive platforms. Build on PostgreSQL/MySQL test and deploy on Oracle. * Creates a consistent API/abstraction layer with portable SQL through high level function ($db->getAll, etc.). Prepared statmements = no more SQL injection! (well… unless you’re a really bad programmer) See

slides for more. ## To the Aple store… Yes

Apple in the header is ironically correct (that’s how it showed after I typed it). Unrelatd to the conference, I’m heading to the Apple store in Yorkdale mall after today’s sessions to see if they can do somehting about my ‘P’ key. Ever since I got my MacBook ro a few months ago, the P key has been less than responsive. After writing a book on Google Ma[p]s and posts on [P]h[P] it’s getting really annoying. Hopefully they’ll be able to fix it for me and until then, forgive me if I’m missing some P’s in the post above.