October 8, 2007
Slimming the PHP layer
royk @ 5:15 pm
Our development cycles are balanced by technical improvements (which yield close to no “obvious” benefits to users) and feature releases and improvements (”yay, new shiny things!”).
One of our long-running goals with the PHP component of Deki Wiki is to slim it down. Every release, I incrementally rip out more code that is crufty and unused (there’s a lot of this since we shifted all the business logic to the brand-spankin’ new Dream-based API). I thought it might be interesting to see how much progress I’ve made since the Gooseberry version of Deki Wiki (the last release before the API).
Deki Wiki file sizes
(Total filesize of PHP library files)
Gooseberry:
$ du -bcs *.php 2037635 total
Current in SVN:
# du -bcs*.php 1181533 total
Deki Wiki PHP include() count
(Count of total library files)
Gooseberry:
$ ls -1 | wc -l 159
Current in SVN:
# ls -1 | wc -l 100
Article rendering
(A specific example)
Gooseberry:
$du -bs Article.php 108823 Article.php
Current in SVN:
# du -bs Article.php 28646 Article.php
Of course, these numbers are a bit misleading, since the code hasn’t necessarily been deleted, but simply moved to the API layer. However, keep in mind that these numbers don’t take into account all the extra work on the PHP side for handling the API transport, the new features (tagging + comments), additional internationalization work, and more extensive templating options.
These numbers from the code refactoring work aren’t just for navel-gazing purposes (”Look at what I do, Mom!”), but hold a real value to the OpenGarden community; by slimming the PHP layer, we hope to achieve a few things:
- We can finally decouple our PHP layer from the database access layer and allow anybody to install a lightweight PHP script to access our hosted API
- Allow casual PHP coders to dive into the code and begin extending the API themselves (less code = easier to understand! [we hope!])
- Allow the Deki Wiki PHP to be a blueprint for someone who wants to port the front-end to another language - want to run in a native .NET environment? Port to ASP.NET!
I’m really excited to see where all these steps take us during the upcoming year - a lot of these ideas came from discussions with our OpenGarden community, and we hope that we can follow through and execute the ideas well
categories: MindTouch





No Comments »
No comments yet.
RSS feed for comments on this post. TrackBack URL
Leave a comment