Not so long ago I was working on a little project using the django framework and was looking for a simple nested set implementation, I found one that was good enough for my needs on djangosnippets.org. I thought this was pretty cool, and realised we didn't have a one stop shop for Zend Framework code snippets. Symfony and CakePHP also have dedicated sites for this. I'm aware of generic snippets sites and pastebin sites, but I thought it'd be another good learning opportunity to build my own with the Zend Framework, for the Zend Framework.
I've ended up implementing a pretty simple site, ZFSnippets. The current basic implementation makes use of:
There are plenty of things I'd like to implement (and fix;)), but will have to see if I find anytime:
- A site search engine using Zend_Search_Lucene
- More flexible posting, probably using wiki style markup
- Version history for all snippets
- Moving to a stackoverflow.com style, trust model, allowing regular users to collaborate, edit and update snippets.
- Forgot my password link
- Contextual error handling and descriptions
- Accurate scoring/ranking, based on complex calculations.
I did actually spend quite a bit of time looking at markup libraries, coupled with HTMLPurifier, but it seemed like too much effort to start with, so I opted for a method of splitting the source code using hashes like pastie.
I like the idea of having a go with Zend_Search_Lucene, probably adding particular snippets to a queue for indexing whenever somebody posts one or comments on one.
Having built the site, I'm actually struggling to think of what might go on there. Helpers seem like an obvious one, but without building large, complex Zend Framework application, I don't have much need for custom code, the framework does the leg work for me. Nevermind, if you think it might be any use to you, head on over there and have a browse around, although it's a little low on content at the minute, or maybe subscribe to the feed and keep your eye out for anything interesting.