LogoPhly, boy, phly
the weblog and site of Matthew Weier O'Phinney

Entries tagged as best practices

Related tags
books conferences dojo file_fortune git mvc oop pear personal php programming subversion testing vim zencon08 zend framework zendcon

Tuesday, December 30. 2008

Model Infrastructure

In the last two entries in this series on models, I covered using forms as input filters and integrating ACLs into models. In this entry, I tackle some potential infrastructure for your models.

The Model is a complex subject. However, it is often boiled down to either a single model class or a full object relational mapping (ORM). I personally have never been much of a fan of ORMs as they tie models to the underlying database structure; I don't always use a database, nor do I want to rely on an ORM solution too heavily on the off-chance that I later need to refactor to use services or another type of persistence store. On the other hand, the model as a single class is typically too simplistic.


Continue reading "Model Infrastructure"

Posted by Matthew Weier O'Phinney in PHP at 07:35 | Comments (80) | Trackbacks (3)
Defined tags for this entry: best practices, mvc, php, zend framework

Friday, December 12. 2008

Autocompletion with Zend Framework and Dojo

I've fielded several questions about setting up an autocompleter with Zend Framework and Dojo, and decided it was time to create a HOWTO on the subject, particularly as there are some nuances you need to pay attention to.


Continue reading "Autocompletion with Zend Framework and Dojo"

Posted by Matthew Weier O'Phinney in Dojo, PHP at 11:07 | Comments (21) | Trackbacks (0)
Defined tags for this entry: best practices, dojo, php, zend framework

Tuesday, December 2. 2008

Tidings of the Season

Just about every day, I have an idea for a blog post, and most days, by the end of the day, I just don't have the time or energy to actually write anything up. The inner writer in me screams, "no excuses!" while the aging adult in me whispers, "time for bed, dear."

So, to keep my hand in the game, here are a few things running through my head, or that I'm working on, or that I'll be doing soon.


Continue reading "Tidings of the Season"

Posted by Matthew Weier O'Phinney in Dojo, PHP at 22:07 | Comments (7) | Trackbacks (0)
Defined tags for this entry: best practices, conferences, dojo, php, zend framework

Thursday, September 25. 2008

ZendCon08 Wrapup

I'm a bit late on my ZendCon'08 wrapup; the conference left me both exhausted and with a backlog of email and work that has consumed me since it ended. However, this, too, is good, as it has given me time to reflect... and to finally get my slides up on SlideShare.

ZendCon was alternately exhausting, rewarding, educational, fruitful, infurating, and ultimately wonderful. I've been to every single ZendCon so far -- I started at Zend a scant month before the inaugural event -- and have spoken at each. My first time speaking was a fluke; David Sklar had just started at Ning and had to back out of his "Configuring PHP" tutorial session. Mike Naberezny and I were drafted to take it over, and we had N+1 attendees, where N was the number of speakers. Since that inauspicious beginning, I've gradually taken on more sessions and stuck around to participate in the conference more. I can honestly say that this was the biggest, busiest, and most community focussed ZendCon I can remember.


Continue reading "ZendCon08 Wrapup"

Posted by Matthew Weier O'Phinney in Dojo, PHP at 23:11 | Comments (9) | Trackback (1)
Defined tags for this entry: best practices, conferences, dojo, php, zencon08, zend framework

Wednesday, September 24. 2008

git-svn Tip: don't use core.autocrlf

I've been playing around with Git in the past couple months, and have been really enjoying it. Paired with subversion, I get the best of all worlds -- distributed source control when I want it (working on new features or trying out performance tuning), and non-distributed source control for my public commits.

Github suggests that when working with remote repositories, you turn on the autocrlf option, which ensures that changes in line endings do not get accounted for when pushing to and pulling from the remote repo. However, when working with git-svn, this actually causes issues. After turning this option on, I started getting the error "Delta source ended unexpectedly" from git-svn. After a bunch of aimless tinkering, I finally asked myself the questions, "When did this start happening?" and, "Have I changed anything with Git lately?" Once I'd backed out the config change, all started working again.

In summary: don't use "git config --global core.autocrlf true" when using git-svn.

Posted by Matthew Weier O'Phinney in Programming at 12:16 | Comments (2) | Trackbacks (0)
Defined tags for this entry: best practices, git, programming, subversion

Thursday, September 11. 2008

Setting up your Zend_Test test suites

Now that Zend_Test has shipped, developers are of course asking, "How do I setup my test suite?" Fortunately, after some discussion with my colleagues and a little experimenting on my one, I can answer that now.


Continue reading "Setting up your Zend_Test test suites"

Posted by Matthew Weier O'Phinney in PHP at 15:00 | Comments (42) | Trackback (1)
Defined tags for this entry: best practices, mvc, oop, php, testing, zend framework

Monday, June 30. 2008

Testing Zend Framework MVC Applications

Since I originally started hacking on the Zend Framework MVC in the fall of 2006, I've been touting the fact that you can test ZF MVC projects by utilizing the Request and Response objects; indeed, this is what I actually did to test the Front Controller and Dispatcher. However, until recently, there was never an easy way to do so in your userland projects; the default request and response objects make it difficult to easily and quickly setup tests, and the methods introduced into the front controller to make it testable are largely undocumented.

So, one of my ongoing projects the past few months has been to create an infrastructure for functional testing of ZF projects using PHPUnit. This past weekend, I made the final commits that make this functionality feature complete.

The new functionality provides several facets:

  • Stub test case classes for the HTTP versions of our Request and Response objects, containing methods for setting up the request environment (including setting GET, POST, and COOKIE parameters, HTTP request headers, etc).
  • Zend_Dom_Query, a class for using CSS selectors (and XPath) to query (X)HTML and XML documents.
  • PHPUnit constraints that consume Zend_Dom_Query and the Response object to make their comparisons.
  • A specialized PHPUnit test case that contains functionality for bootstrapping an MVC application, dispatching requests, and a variety of assertions that utilize the above constraints and objects.

Continue reading "Testing Zend Framework MVC Applications"

Posted by Matthew Weier O'Phinney in PHP at 12:00 | Comments (51) | Trackbacks (3)
Defined tags for this entry: best practices, mvc, php, zend framework

Migrating OOP Libraries and Frameworks to PHP 5.3

With PHP 5.3 coming up on the horizon, I'm of course looking forward to using namespaces. Let's be honest, who wants to write the following line?


$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
 

when the more succinct:


$viewRenderer = HelperBroker::getStaticHelper('viewRenderer');
 

could be used? (Assuming you've executed 'use Zend::Controller::Action;' somewhere earlier...)

However, while namespaces will hopefully lead to more readable code, particularly code in libraries and frameworks, PHP developers will finally need to start thinking about sane standards for abstract classes and interfaces.


Continue reading "Migrating OOP Libraries and Frameworks to PHP 5.3"

Posted by Matthew Weier O'Phinney in PHP at 09:00 | Comments (58) | Trackbacks (3)
Defined tags for this entry: best practices, oop, php, zend framework

Sunday, May 18. 2008

Speaking at the Dutch PHP Conference

I've known for some time, but was reluctant to blog about it until the plane tickets were purchased and in hand: I've been invited to speak at the Dutch PHP Conference this coming June:

DPC

I'll be presenting two separate sessions: an all day tutorial on 13 June 2008 covering Zend Framework, and a regular session on 14 June 2008 covering Best Practices for PHP development, which will focus on how to utilize Zend Framework coding standards and methodologies to help deliver efficient, high quality code for your organization.

I'm looking forward to meeting old and new friends alike at the conference!

Posted by Matthew Weier O'Phinney in PHP at 15:08 | Comments (3) | Trackbacks (0)
Defined tags for this entry: best practices, conferences, php, zend framework

Saturday, March 22. 2008

Vim Productivity Tips for PHP Developers

I use Vim for all my editing needs -- TODO lists, email, presentation outlines, coding in any language... everything. So, I thought I'd start sharing some of my vim habits and tools with others, particularly those that pertain to using Vim with PHP.


Continue reading "Vim Productivity Tips for PHP Developers"

Posted by Matthew Weier O'Phinney in PHP at 10:41 | Comments (25) | Trackbacks (3)
Defined tags for this entry: best practices, php, vim
(Page 1 of 2, totaling 16 entries) » next page
  • Home
  • Resume
  • Blog
  • Phly PEAR Channel
  • Contact Me
  • About this site

ZCE

Zend Education Advisory Board Member

Add to Technorati Favorites

Calendar

Back March '10 Forward
Mon Tue Wed Thu Fri Sat Sun
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

Quicksearch

Links

  • PHLY - PHp LibrarY
  • Paul M. Jones
  • Mike Naberezny
  • Shahar Evron
  • Planet PHP
  • Zend Where I now work
  • Garden.org Where I once worked

Archives

March 2010
February 2010
January 2010
Recent...
Older...

Categories

XML Linux
XML Personal
XML Aikido
XML Family
XML Programming
XML Dojo
XML Perl
XML PHP

All categories

Syndicate This Blog

XML RSS 0.91 feed
XML RSS 1.0 feed
XML RSS 2.0 feed
ATOM/XML ATOM 0.3 feed
ATOM/XML ATOM 1.0 feed
XML RSS 2.0 Comments

Show tagged entries

xml best practices
xml books
xml conferences
xml cw09
xml decorators
xml dojo
xml dpc08
xml file_fortune
xml git
xml linux
xml mvc
xml oop
xml pear
xml perl
xml personal
xml php
xml phpworks08
xml programming
xml rest
xml ubuntu
xml vim
xml webinar
xml zendcon
xml zendcon08
xml zendcon09
xml zend framework
© 2004 - present, Matthew Weier O'Phinney
matthew-web <at> weierophinney.net