ZFSnippets.com – Zend Framework Code Snippets

ZFSnippets Logo

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.

  • Digg
  • del.icio.us
  • NewsVine
  • Reddit
  • Furl
  • DZone
  • StumbleUpon
  • Technorati

Tags: , , , , ,


16 Responses to “ZFSnippets.com – Zend Framework Code Snippets”

  1. Duodraco Says:

    Thanks Dave. Your tool is bookmarked yet.

  2. Zend Framework CZ » Archiv » Zfsnippets.com Says:

    [...] na svém blogu psal seznam p?ipravovaných featur, takže je na co [...]

  3. Daily Links | AndySowards.com :: Professional Web Design, Development, Programming, Hacks, Downloads, Math and being a Web 2.0 Hipster? Says:

    [...] ZFSnippets.com – Zend Framework Code Snippets | DaveDevelopment Zend Framework Snippets! NICE [...]

  4. Uli Says:

    You should replace the timestamp of each rss-entry by the timestamp the entry was entered, otherwise it is really difficult for many readers to distinguish between new and old entries.
    But good job overall :)

  5. daveyboy Says:

    @Uli – Done

  6. daveyboy Says:

    Kinda not

  7. Rho Says:

    Hi, i was looking a zend snippets site for a long time, great job!

    Do you think open source it some day?

    Cheers

  8. daveyboy Says:

    @Rho Yeah one day, once I know everything is secure and it’s tidied up a bit.

    @Uli Still not fixed the date in the feed, I can’t work out what I’m doing wrong

    ...
    'pubDate' => date('r', strtotime($snippet->created)),
    ...
    
  9. Alessio Says:

    I have problems to sign up for this site ZFSnippets.com, I come ’s e-mail confirmation

  10. Mathias Says:

    Very nice resource, thanks for setting up such a platform :)

    Unfortunately, I’m having problems signing up with OpenID. I’m running my own provider using phpMyID and I’m able to sign in into other services such as Stackoverflow and Sourceforge, however when I try to log into ZFSnippets, it checks for Username/Password and but then returns to the register page saying “Login failed”.

  11. daveyboy Says:

    @Mathias, I’ll have a look into that as a priority, don’t want to put people off registering.

  12. ZFSnippets.com update | DaveDevelopment Says:

    [...] been just over a month since I launched zfsnippets.com and I’m very pleased with the reception it got, which spurred [...]

  13. kisin Says:

    is ZFSnippets.com dead?
    i cant post snippets….

  14. daveyboy Says:

    Bugger!

    Yeah I think it’s ok now, possibly a dodgy opcode cache, I touched the main controller and everything seems fine now.

  15. franckbenoit Says:

    Can’t register.
    Looks great thought

  16. Wanted: New home for zfsnippets.com | DaveDevelopment Says:

    [...] been just over a year since I initially launched zfsnippets.com, it was a good little project for me to get used to the Zend Framework, but since [...]

Leave a Reply