Archive

Archive for July, 2009

Setting Up Kohana Development and Production Environments

July 29, 2009 Leave a comment

I develop my Kohana applications on Windows using the awesome XAMPP package. This allows me to test everything on my local PC before pushing the changes to the live server. Kohana uses an ‘IN_PRODUCTION’ constant which can be useful, especially for those little things that change. For example, I change the background colour of the page or header graphic so it’s obvious to me which environment I’m looking at. There’s nothing worse than pushing a page to the live server and then having to scramble around to find an old copy to replace it with. For this reason, I also recommend adding Subversion into your regime. It will save you a lot of panic attacks, trust me.

There are also five other settings that you should change within Kohana to ensure everything works correctly across environments. Read more…

Advertisements

Dreamweaver CS4 – Only Subversion v1.4.5 Supported

July 21, 2009 Leave a comment

Just in case you missed my own problems with Subversion support in Dreamweaver CS4, be warned. Nothing beyond version v1.4.5 is going to work so avoid the headache and install v1.4.5 or just stick to a real IDE for developing your applications. Adobe will catch-up eventually but until they do I may have just given up and switched to Eclipse or some derivative thereof.

Categories: Uncategorized

Adobe Dreamweaver CS4 Build 4117 Crash : Initializing Files

July 20, 2009 8 comments

It never ceases to amaze me how I can destroy my working setup in a matter of seconds that takes hours to recover from. Take todays example…

I posted a message on the Kohana forums to find out what the Kohana Ninjas use for developing their applications. As I’d been having problems with the ORM objects and my incorrect pluralization when I setup the relationships I wanted to step-through the Kohana internals and discover where I was going wrong.

So after downloading all of the leading PHP IDEs, installing them and failing miserably to get them working with my Kohana application, I turned to the forums. So far I’ve had some great replies and will be working my way through them over the coming weeks. One particular comment struck a chord though, I should be using Subversion.

I agree and I’d been trying to get it going on and off for a while and then I recalled that Dreamweaver CS4 had source control built-in so I used a handy guide to setup Subversion 1.6.3 on my PC. As Jeff’s post said, it took less than 30 minutes to get it going and I even added the repository into my Mozy backup just to make double sure. All worked fine until I shutdown my PC and tried to start CS4 up again, it refused – BANG!!!

CS4 started up and then failed while ‘Initializing Files’. I tried a whole multitude of fixes, including the deletion of files, registry keys. I even downloaded the Microsoft Debugging Tools, used the File Monitoring application from SysInternals and Google’d every step of the way.

In the end I found the clue online – it was Subversion. As this had been my last change I’d suspected this was the culprit, I’d even removed the web site I was working on, as well as stopping the service but to no avail.

Dreamweaver CS4 is only compatible with Subversion 1.4.5 so I had to downgrade my Subversion. I found a copy of the 1.4.5 Windows binary online and installed it. DON’T DO THIS!!!

I ended up over-writing my copy of Subversion and then going through some hoops to dump the repository with the 1.6.3 copy and reload it with the newly installed 1.4.5 copy.

WITH HINDSIGHT – Dump the repository with the 1.6.3 copy you have installed, THEN downgrade it, recreate the repository, setup the users and permissions again and then reload the repository from the dumped files.

And now it all works again – phew! Just another 8 hours wasted of my life.

UPDATE: It seems the problem may be caused by TortoiseSVN and Dreamweaver CS4 as it seems DW will work with a later version of Subversion but only if no other client interacts with the repository … ever. See this Adobe forum posting for more information. To me, it seems highly unstable though and would still recommend downgrading to 1.4.5 until Adobe fix the ‘real’ problem.

Using an IDE with Kohana

July 18, 2009 Leave a comment

My name is Pablo and I’m a Dreamweaver addict.

I’ve worked with Dreamweaver for many years and always developed my PHP applications in it. I find it a nice environment where I can modify my HTML, CSS and write my PHP. I’m used to it and it works for me … mostly.

And then there’s that odd occasion where the PHP code is too complex and peppering the code with var_dumps and echos is too time-consuming to track down some bugs. I then have to shift to an IDE where I can step through the code, adding some watches and breakpoints and really get to the root of my problem.

I’ve reached the same point with my Kohana application. I just can’t understand why one of my related models isn’t accessible. The problem seems to come and go so I must have something wrong somewhere but I want to track it through the internals of Kohana to see where my problem is. And for that I guess I need to step into the ORM::__get method and see why it’s not picking up the related model.

So I posted a message in the forums to find the perfect environment but no replies as yet. I read all the other posts on similar topics but they all talk about editing PHP files, I don’t want a text editor, I want an IDE with debug hooks.

I’ve played with phpDesigner, phpED and Zend Studio already. The first two have no way of understand how to get from a controller to a URL, I just can’t map it, i.e. this file refers to this URL. I also don’t see any method of starting a debugging session by simply entering a URL.

So I figure if I’m going to use an IDE I should also integrate source code management into it so I can track all of my changes. I use XAMPP on Windows as my DEV environment and keep my code in C:\Data\Sites\Project and then upload the final code to the remote PROD server when it’s all done. I’m sure I can improve my environment though and will report back on what I ended up with.

Categories: Uncategorized Tags: , ,

Apple Blocks Palm Pre

July 17, 2009 Leave a comment

In a marketing move reminiscent of Microsoft, Apple have blocked the Palm Pre from synchronizing with iTunes. The latest version, 8.2.1, now detects the Palm Pre and refuses to play ball.

Sometimes I wonder how many other evil things will Apple have to do before people turn against them.

Personally, I never liked iTunes anyway and found that Helium Music Manager works far better for me. I even shelled out the few dollars it costs and bought a real copy.

It just goes to show that the more people that buy into Apple’s mantra, the more they’re helping to build another Microsoft. Can you imagine a world with just iPods, iPhones, Safari and Mac OS? Just because their products are nice, it doesn’t mean we should give them the marketplace. The open marketplace is far better, at least companies don’t then use their dominance to stifle competition.

I’ve always liked Google’s position — Don’t be evil — Microsoft and Apple should take note because they both have the same corporate playbook on their desks.

Categories: Uncategorized Tags: , , , , , ,

NameCheap Hosting Update

July 17, 2009 Leave a comment

After berating NameCheap for their overly-demanding need for information to authenticate a change to my account I ended up cancelling the request. All I wanted to do was change the master domain on my account to a new domain, a seemingly simply request that got bogged down in bureaucracy.

They replied to my previous email and relented a little — all they needed was my address, email account and telephone number. Otherwise they’d refuse to action my request.

So I explained.

The email address I used for signup could have been one of 25 I routinely use. It could be anything at one of the 50 domains attached to my NameCheap account or could be my Hotmail or Google Mail account.

My street address could be one of 15 that I’ve routinely used in the 5 years of being a NameCheap customer. Did they want a personal or business address? Was it the one associated with the credit card they charge monthly or something else? If it was the one attached to the credit card, it could be the real address or the spelling mistake that is used by Canada Post and on my bill because Canada Post also spell it incorrectly in their postal code database that they provide. When your credit card is issued by TD Canada the address is populated from the postal code database.

And my telephone number could be the home phone I had two years ago, the home phone today, my cellphone or one that I completely made up because I never saw the point in them having it in the first place.

Now if they could give me a clue about what they’re asking for, I can probably help.

In the end I told them to cancel the ticket. I’ll simply move my hosting elsewhere.

Categories: Uncategorized Tags: ,

Why Choose Kohana?

July 17, 2009 Leave a comment

It’s no secret that I’ve been struggling with Kohana over the past few weeks as I’ve been building a new site for a non-profit in Vancouver, BC.

You may want to read my web development background for more information about my development path and how I got to this current project.

Although I’ve been programming in PHP for a decade or so I’ve learned the limitations of the language and started building up a reportoire of code modules and drop-in classes. The first one I wrote was an error handler as v4 was hopeless. My class would intercept the errors, log them, show them in development but not production, and would even dump the source around the problematic line.

Read more…