Subscribe to RSS Subscribe to Comments

Alan Blaine Whitney

How to add subversion revision into cake template

This post is a quick explaination on how to add a subversion revision number into a cakephp template.  First off you need to tell subversion to place the version into the file.

svn propset svn:keywords “Revision” app/views/layouts/admin.ctp

In this case I am going to add to my admin layout. Now to edit the admin layout.  I am going to add the following line text.

$Revision: $

This will get replaced at every commit/update with

$Revision: 357 $

with the current revision number.

To pull it all together to show the version number. Here is piece of admin.ctp

<?php
$svn = ‘$Revision: $’;
$revision = substr($svn, 11);
$version = intval(substr($revision, 0, strlen($revision) – 2))
?>
(Revision <?=$version?>)

Which will display the current version number.

Cake 1.2RC2 to 1.2RC3

I recently updated a web app from RC2 to RC3.  I replaced the cake dir and replace app/webroot/index.php and app/webroot/test.php.  Deleted my cache files.  Everything went super.  Not one hitch.

UUID’s

I read a good post over at debuggable just now, about UUIDs.  One of the things about the article that struck me that I didn’t know, is that if you have a char(36) field, cake will just start to use them, auto-magically.

This means that in real world application effort wise, auto incrementing ints, or UUIDs are both super easy to use in cake.  Nearly no difference other than your table creation.

This got me thinking about which one is better.  Well, the url’s look better as ints, say ‘/applications/view/147′ versus ‘/applications/view/48c907b0-f088-44ae-8be5-4e811030b5da’.  One is way shorter as well.

Some people quote SEO has being a disadvantage to UUIDs.  I don’t know about that.  It would seem to be that they could be about equal, if both given the same treatment, like putting title in the address.  I would assume that they are equal, but I am not quite sure about this.

The main advantage of UUIDs is uniqueness.  I can see why true uniqueness would be cool.  No centralized system, but yet you have a unique Id.   Merging tables because easy, makes url hacks harder.

So for me the equation is uniqueness versus easier urls.

I am not a fan of Email

I will try to not let my bias not persuade me too much, but I don’t really like email much.  It is so slow to digest the information contained, so many emails don’t have good content, or are spam, or are forwards, yucky.

Yet, email was once a breakthrough in silent, speedy, low-cost communication technology that so seamlessly fits into the information worker’s day.  Today other technologies are better at the silent, speedy, seamlessly, low-cost information exchange, like Atom, wiki, social bookmarking and RSS. Consequently many experts are saying email cost the economy about 650 billion in lost time, actually some say quiet more than that.

A cnet article quoting Carl Honore research, concluded that the average office worker is interrupted every three minutes (email, IM, phone, other office distractions) and that it takes eight minutes to recover.  So that means very little is being done in the untied states, especially when compared to nations like Japan, India, and a host of others.  The cnet article also concluded that companies are coming up with simple ways, custom software, unique project management and sometimes non-technical ways to tackle the information management issues of this phase of the information age.

Furthormore, PC World publish a comical, but serious article about having email addiction and steps to help defend and wart off addiction.  Appearly some 11 million people, doctors have labeled as having some type of health recking email habits.

Way am I writing this post, other than because I don’t like email.  Well largely it’s due to one factor in my life, which is, I now realize time is constantly working against me, time is not my ally.  Here at Sephone, always working to try to squeak out more,  also I’m writing an application with a friend outside of work, teaching a class that requires hours of study a week, and I am always looking for more time to spend with my wife.  Just seems like time is a continuous opponent, that needs to be properly rendered, or it because evil.

Okay, I think I am really going to make a point, I am working my way to it.  My point is this, time is precious, both at work and elsewhere.  Things like email are great tools, just make sure that you have control over the tools, and your tools don’t have control over you.  If you instance have read an email as soon as you get it, you are a slave to your inbox.  If you often purposely look at your email while you are in the middle of something else, you are a slave to your inbox.  Just encouraging everybody to think outside of the inbox.  By just checking your email every so often then closing your email program, it might surprise you how much time you have in the day.

Pay for Content

Their are some really good web applications out there, but in my life their still are some paper publishications that I have that no web app comes close to replacing.  Some of these are the AMC River Guide and the Delorme A&G.  The amount of detail, both in map data and text is far better than those found online.  With the case of the AMC River Guide, the trips that are detailed were actually taken by the authors.

This got me thinking about a larger scale issue.  In this era of “web 2.0″ and wiki’s and blogs, what will happen to detailed research.  Anyone who has ever done any large research knows that wikipedia may be looked at, but is not a great source of in-depth information.  Any information that may actually be there, is really a citation from something else anyway.

I just wonder what will happen to high quanlity content, that needs to be funded.

Subversion for PHP Websites

Lately I have been using svn with a few various PHP websites that I maintain.  In short, here is what I have found out.

Once you get used to typing svn commit and svn update, it’s addicting.  That is a very slick way to go about dev.  I have used it update live websites with svn update, to do development from various places (tele-commute days versus at work).

Here are some things that I don’t like about it.  Inital imports and checkouts take forever, there is no tar like thing to transfer just one file.  Can really take a while sometimes.  This is my biggest problem.  My second thing, is that php websites always have some files you can’t track in the repo, like config files, template caches, or other tmp files, so you also have to remember to svn delete them.

Good reads this morning

This morning I have read some awesome blog posts, just figured I would share.

Less is better
David Heinemeier Hansson, from 37 Signals, creator of Ruby on Rails, over usability guy.  Very good read about web application development.  Really enjoyed him talking about specs and functionality scope on the top of page two.

Small business owners are community managers
Connie Bensen often writes about community managers.  In this post, she covers why small business owners are more or less, community managers.  I liked the graphic.

underperforming
This is something that I don’t do much, but analyst traffic to see how to do things better.  This was a great article describing how to view stuff like google analytics.

In The Morning

Starting tomorrow, I am going to change the way I start my work day.  Normally, I check email, phone messages, check my feed reader, maybe even make a few phone calls.  I think I am wasting my mornings.  The first hour, maybe two hours of my day are sort of quick.  Not everyone is in the office.

More than just that it is still quick, also my mind is still fresh.  Once I read emails, feed reader, etc.  I have stuff on my mind.  I am already distracted some.

So here is my game plan tomorrow morning.  Come in and get right two it.  Check email and feedreader before lunch sometime but later.  I will comment with how it worked.

Microsoft

Microsoft just called me.  They wanted to conduct some survey and they were willing to pay $25.  I just didn’t have the time, plus something just felt wrong about it.

Api’s and Feeds

In this era of the web, you need to have feeds and API’s.  At the very very least, something like an RSS feed.  If you have aggregated content, or updates, you need an RSS feed.

Since everybody has so much going, blogs, twitter, facebook, delicious, digg, youtube, flickr, etc, etc, API’s are so helpful in allowing people to use your service in the most automated way.

« Previous PageNext Page »

Based on FluidityTheme Redesigned by Kaushal Sheth Sponsored by Send Flowers