CakePHP and Aptana Cloud = Love at First Sight

Before I write a post, I usually test the code I write about… and try to copy/paste it the best I can… so I don’t look like an ass later on.

This post, however, I simply cannot prepare for…

I’m just way too excited (yes, even more than Pacquiao’s dismantling of De La Hoya last week) about the topic, which deals with CakePHP in a littler manner, but mostly focuses on my new found love: “Aptana Cloud”.

Aptana IDE has been my choice in web development for a little while now (Eclipse users take note, all other IDE users… at least give it a shot ;)). It has solid support for JS, CSS and PHP. Thankfully, I don’t care about Java anymore, thus it works out perfectly well. Just the ability to insert a color hex value from a tiny built-in pallet, while working on a CSS file… puts a smile on my face every time.

I do love such attention to detail, but just to make things a little better, it also has support (i.e. auto-complete, proper highlighting and other time-saving features for coders) for jQuery (which I use) as well as top popular JS frameworks such as ExtJS, Prototype, … etc., so it appears like the Aptana team is “on top of web dev things” ;)

Alright, that seems like a few good-enough reasons to make Aptana my top IDE.

Well… all of a sudden (to me, which means I’m way behind the trends) Aptana folks introduced a cloud computing service, that kicks major ass as far as I can see… while testing it for about two days.

So this post will be just about my ventures into Aptana Cloud, setting up a cake app and being all happy about the potential with such a service.

(… guess I should have prefaced this post by saying that I’m not a paid actor :))

Alright… so first, if you’d like, you can read about Aptana Cloud (and watch a nice little video) here: http://www.aptana.com/cloud.

Now, I’m pretty much going to outline my baby-steps with Aptana Cloud + CakePHP and what I did (and learned a little) to launch a CakePHP application on Aptana Cloud.

1.Why bother and what is this all about?

To me, when working with multiple clients or multiple developers (or even on a single project), management of deployment/synchronization and consistency between development, staging and production somehow always caused a little pain. (I hope most people follow dev->stage->production release cycle ;)) Of course, if you have IT guys, or your are an admin systems guru, managing servers becomes a lot easier, but even still… if one is focused on web development, is it worth the time and effort to somehow worry about the state of your server (Email, Database, SVN, this, that, etc.)? (To me, at least, it always seemed like a boring and mundane task, sorry to all the geeky sysops ;) ).

There had to be a better way…

2.Creating a cloud… and whatta f… is this “cloud”?

Somehow I found out about the Aptana Cloud in my IDE…

After reading up on the service… I thought something along the lines of: “Well, that might address my pain just mentioned above… why not give it a shot?”.

Without boring you with anymore details in the IDE it’s basically 3 clicks and your cloud is setup…

… Which means, you’ve got a fully working:

Staging Server, Production Server and Private Server.

They are all up and running with SVN, SSH access, Postfix (for outgoing emails only, as far as I know). Oh yeah, all up and ready in *real-time*… and $0 for you to spend. (GTFO, you might think)… well, you get a 21 day free-trial. (Don’t even have to pull out a CC… that’s people thinking about doing things right… another smile).

3.So how to get my app running?

Well, I SSH’d into the “virtual” (cloud) server (right from the IDE too;)) and probably did a bunch of things wrong, clicked around here and there and after deliberation decided to do the following…

Obviously I need the cake core up there, and the default doc root is:


/home/aptana/homes/teknoid/staging/web/htdocs

I thought the “right” way to install an app in this scenario was to put the cake core in the “web” directory and then *sync* my app into htdocs.

After that, I’d set the doc root (which is easily changed right in IDE) to:


/home/aptana/homes/teknoid/staging/web/htdocs/webroot

4.Getting the cake core installed

After kicking around some ideas for a while, I decided to use the latest SVN repo from CakePHP. Thankfully, the SVN is already good to go in the cloud so in my:


/home/aptana/homes/teknoid/staging/web/

I did:


svn checkout https://svn.cakephp.org/repo/branches/1.2.x.x/cake/

Alright, I get the cake core in the place where I hope it should be.

5.Syncing up the app from Aptana

Now I need to get my project (app) uploaded to the staging server. That’s what I think I did next…

Right click the project name in my IDE’s project browser, went to “Synchronize” (you can decide if you wish to sync up your local or development project to public or staging server).

The IDE takes a “minute to think” and then it creates a sync-up dialog. Since it was my first time uploading the project, all files had to be created and after some “syncing up” my app was ready to run on the test server. And it did! :)

6.Following up

I realized that syncing-up app/config and app/tmp directories (as some other folders/files) probably isn’t a good idea, and thankfully you can easily add such exceptions in the IDE.

….

Well, that covers my little venture into CakePHP and Aptana Cloud. As you can guess so far it has been a very positive experience.

7.Some random notes

  1. First and foremost, to me, is the “team” option… Say, I have a project that I cannot finish due to laziness or whatever other strange reasons. I can easily “delegate” the coding to someone else with a simple SVN account setup and possibly some free beer. That type of “delegation and collaboration” pain is simply removed from the equation.
  2. I found that Apatna team is very responsive and open to suggestions, so if you feel like sharing some ideas on how it could benefit the community and CakePHP (but more importantly, your exciting life as a web developer), throw them on the Aptana forums or even here.
  3. I’m still very early in my testing, there are probably lots of things I miss or don’t know yet.
  4. The service is improving daily, so I think following the solid growth patterns of CakePHP, these kinds of projects I do really enjoy because it’s an amazing learning experience.
  5. I’ve tested the “sync” option numerously and it works quite well, I’ve not found a single problem… other than that it’s a bit slow (at least for me) and I could see about 3 UI improvements :)
  6. Give it a shot!
  7. Git support should be there any day now ;)
  8. I think the “Private” server is meant for your own stats and overall cloud management (i.e. don’t sync your CakePHP projects there).
  9. Yep, you get tools like phpMyAdmin to manage your DB (or internal IDE DB browser), all the obvious that you need to use the terminal… and well so far that’s all I’ve needed :)
  10. And I hear that there are some very interesting things coming down the line in Aptana… concerning some PHP frameworks, the IDE and the app deployment ;)
%d bloggers like this: