Author page: DennyLato

You Have No Idea How Good You Look

People are the worst judges of how they look. I came to realize this while looking through some friend’s profiles in facebook. Typically the pictures they chose as “profile pictures” – ie. “the picture that best represents you right now” looked nothing like them. Most of the girls were giving silly coy poses and making the duck face. What is up with that? Seriously.

What were your favourite pictures in your high school yearbook? It certainly wasn’t the face listings, and it wasn’t any of the posed shots. It was always those “captured moment” shots from dances, sporting events, whatever. It’s the pictures that were taken when the subjects didn’t know anyone was watching. It’s the pictures of you in a moment where you’re just being yourself. Let’s face it, you’re awesome! The sad part is that even if you agree that you are awesome, you probably don’t think you’re that physically attractive. I’m looking at you: women. I don’t know a single woman who doesn’t think she’s ugly in some way. She’s either too fat, too thin (a rarity), too veiny, too wrinkly, hair is too curly, hair is too straight, too hairy, too balding. You get the point.

Garden Preview Part I

Almost two years ago I started thinking about rewriting the Lussumo Framework, the framework upon which Vanilla is built. After a year of heavy contemplation, I finally started development on the new version, which I have come to call “Garden”.

My concept for the Garden framework is not to be competition for the likes of The Zend Framework, CakePHP, or even CodeIgniter (to name a few of the other great PHP frameworks), but something both a little less and a little more. My idea was to create a framework that didn’t solve everyproblem, but just most of the common problems we face when developing simple web applications. I wanted to build a framework that had user and permission management built right in. I wanted to build a framework with which you could easily create new applications and throw them alongside any others – and all users, roles, permissions, preferences, plugins, and themes could play nice together.

Markosullivan.ca can safely say that I have accomplished that task.

Recently I had an active member of the Lussumo Community contact me and ask if his plugins for Vanilla 1 would work with Vanilla 2. It was hard to give him the answer that, no, none of the (over 400) plugins for Vanilla 1 would work with Vanilla 2.

Garden Preview Part II: FileSystem

Whenever I start looking into how an application works, the first thing I do is browse through the files & folders to see where everything is. And, interestingly enough, where the files and folders reside in Garden have a lot to do with how Garden works.

[Edit – After some good suggestions in the comments of this post, I’ve made some changes to this post and updated appropriately.]

Let’s start by looking at the root folder of my development version of Garden:

Here’s a breakdown of what each root folder/file is:

applications: The applications folder contains folders, which in turn contain all of the files specific to each application. As you can see, I’ve got four applications listed here. The “garden” application is the base application of the framework that handles signing in, user, role, permission, plugin, and application management. The “scaffolding” application is the first application that I developed with Garden, which you may remember from a few months ago. Sadly, after months of changing how the core Garden libraries work, the Scaffolding application is now very broken. The “skeleton” application is a set of folders and files that represents an empty application. My idea with Skeleton was to have a set of files that a developer could copy as their starting point for a new application (You could also call it an “application template”).

Benchmarking Magic (Revisited)

Since I started development on Garden (the next Lussumo development framework), I have spent a LOT of time crawling the web for information on everything from PHP optimization, to wacky new design patterns; anything I can get my hands on that will spark some new ideas in my head. In my travels, I’ve found a few very interesting posts that I’ve gone back to and read over and over again; getting new insights with each new read (and subsequent contemplation). One of these articles is called Benchmarking Magic by Larry Garfield (If you are interested in PHP development, I highly recommend you read his blog regularly).

I’ve been entranced by the possibilities of PHP’s magic methods for some time; but all I’ve ever heard about them was that they are slow. Larry took the time to benchmark PHP’s magic methods next to the standard alternatives to see exactly how slow they are. His results, though not too surprising, were definitely enlightening. Calling PHP’s magic __call method is slow, but the real issue is that you can’t do much with a __call unless you are then able to take the requested method and arguments and do something with them. This usually involves the use of PHP’s call_user_func or call_user_func_array functions.

Garden Preview Part XI: Structure

Most open source software forum have database setup scripts that are simply a set of SQL instructions that you can inject directly into your database (typically mysql) to get going. Vanilla 1 was no exception to this rule. The benefit of this approach is that you can quickly and easily get your app up and running. The downside to this approach is that when it is time to upgrade the application to a newer version, you have to write extremely convoluted scripts to figure out what application version the user currently user has, or write scripts to examine database table structure to see what fields need to be removed, or what fields need to be added. Hell, it’s even difficult to understand what I just wrote, let alone the code that would go along with it.

The Database Structure Class

Garden does not have any SQL install or update scripts. Instead, every application in garden has a structure.php file which can be used by either the Garden installer, or by the application management screen when enabling that application. The structure.php file contains a set of instructions on how to build the structure of the database. This file uses the DatabaseStructure class to define the structure of the database.

Garden Preview Part III: Anatomy of a Request

mod_rewrite was an afterthought in Vanilla 1. As a result, markosullivan.ca have always felt that the mod_rewrite mappings were sloppy and really just didn’t make much sense. In Garden, the way pages are accessed is completely different, and definitely deserves explaining. Let’s start by looking at a typical url request in Garden without mod_rewrite enabled:

http://localhost/garden/default.php/garden/settings/configure

Let’s look closer at each part of the request:

http://localhost/garden/default.php: On my development server, I’ve created a folder called garden, and placed all of the garden files I discussed in last week’s preview in it. As you can see, the default.php file that handles all requests is sitting within that folder’s root.

/garden: The next part of the url is the application that is being requested. In this case, we are requesting the “garden” application within the garden framework’s application folder.

/settings: The next part of the url is the controller that is being requested within the garden application. In this example, we are requesting a controller called “Settings”.

/configure: the final part of the url in this example is the method within the “Settings” controller that we are calling. In this example, we are calling $SettingsController->Configure();.

I could take the same request and add information to the end, like this:
http://localhost/garden/default.php/garden/settings/configure

Me and My MP: An Exercise in Ignorance

A number of weeks ago I wrote a letter to my member of parliament (Lynne Yelich, MP) in an effort to let her know about my concerns over the proposed Bill C-61 – which will, in effect, make almost everyone in Canada a criminal. Here is a complete copy of the letter I sent to Lynne:

June 24, 2008

Dear Lynne,
I’m a constituent who has been following recent developments in Canadian copyright law. I’m concerned that the Copyright bill (C-61) presented by the government on June 12th goes too far in outlawing the lawful use of copyrighted material, and does not take into account the needs of consumers and Canada’s creative community who are exploiting the potential of digital technology. I’m disappointed that this bill adopts an American approach to digital copyright laws, instead of crafting a Canadian approach.

Canada’s copyright laws need to advance Canada’s interests. This means copyright laws that respect ordinary consumer practices, such as unlocking cell phones and copying the contents of purchased DVDs for use in video iPods. The current bill outlaws these practices. This means copyright that facilitates the work of Canadian creators, such as documentary filmmakers, who instead find that this bill outlaws the use of DVDs as source materials for their films.