SVN Update made easy PT2

SSH, PHP and Subversion equals lots of fun!

On a previous post I explained how to build SVN updater script in PHP. This works fine on hosts that allow the webserver runas user to access the subversion binaries, such as Dreamhost.

What if not?

Our favorite hosting provider Webdrive allows our ssh-user access to subversion but not the apache runas user.

What can we do?

In order to avoid being asked to update the working files for website xyz.com every change someone made -> we need a script that executes the command “svn up” via ssh on a remote server!

This script will be hosted locally and the access will be restricted.

Sounds good what are the problems?

Everyone, who ever tried to build a script that connects via SSH to a remote machine in PHP, knows the big question:

“How can I send the password?”

The answer is: “Not

thanks to ssh key authentication.

Read the rest of this entry »

August 25th, 2009 / Tech Talk / tim

What are the hard refresh shortcuts for a Mac using Safari and Firefox?

Quick tip

The shortcut keys for refresh / hard (force) refresh on a Mac for Safari and Firefox:

Firefox

Refresh: Command+R
Hard refresh: Command+Shift+R

Safari

Refresh: Command+R
Clear the cache: Command + Option + E

*Command = Apple key

June 26th, 2009 / Tech Talk / Lexi

SVN update made easy

subversion logoPHP Subversion Updater

In our company we use Subversion for version control.

Using a GUI for Mac gives our more graphical team members easy access to common tasks, such as committing changed files to the repository.

However updating the working copy on a (test-) web server still requires knowlegde of a unix shell and having to log in and running it manually can be a full time position.

After doing some research I found the official PECL SVN bindings. These are still very experimental and a hussle to install.

So I decided to use the simplest solution that just executes a “svn up” on the server and does not require any server-side modification:

exec("svn up ".dirname(__FILE__), $out, $ret);

Which serves perfectly for this purpose.

Wrapping this line in a (30secs) self refreshing file makes sure the working copy stays updated.

And the best thing is:
it does not require anything, except installed svn binaries that are executable for the apache user and write access to the webroot.
Download

May 25th, 2009 / Tech Talk / tim

Howto downsize product images in Magento using Mage_Catalog_Helper_Image

or

“How can I downsize large product images but not enlarge small images?”

simple as:

syntax:

$this->helper('catalog/image')
->init($_product, 'image')
->keepFrame(false)
->constrainOnly(true)
->resize(650);

example:

$this->helper('catalog/image')
->init($_product, 'image')
->keepFrame(false)
->constrainOnly(true)
->resize(650);

Read the rest of this entry »

May 13th, 2009 / Tech Talk / tim