About IT and Sports

My Web development experiences and sports encounters


Posts Tagged ‘ftp’

Git deployment over ftp

Most shared hosting services don’t offer git deployment options. Normally you just use ftp to upload your changes to your website. It’s easy to make errors on such deployments, especially when you do updates where you only want to change a number of files. Because I didn’t want this anymore for my blog, I looked for a better solution.

I found git-deploy. It’s a binary executable which you run from your Linux development environment. It’s able to deploy only the changes since your last deployment. It requires ruby and can be installed using gem. I followed the installation instructions on the project homepage on github: https://github.com/aizatto/git-deploy.

The only thing I was missing in this installation description was the installation of ruby. I used this command:

sudo apt-get install ruby libruby rdoc libgtk2-ruby libglade2-ruby libyaml-ruby libzlib-ruby libopenssl-ruby libdl-ruby libreadline-ruby libiconv-ruby sqlite3 libsqlite3-ruby irb libssl-dev

Copy the git-deploy binary to your binaries path. Create a deploy.yml and REVISION file. The REVISION file is used to save the commit-id of the last deployment.

When you committed changes to git, just run git-deploy. The REVISION file on your ftp site is updated by git-deploy.

Choosing a PHP IDE (part 2)

In my previous post I highlight some important features of IDE’s. I will try to explain how the well-known IDE’s perform on these features. I will give some comments on the following apps Eclipse PDT, Zend Studio, Netbeans, Aptana and Komodo.

Eclipse PDT
This eclipse version is a special tailored version for PHP development. Eclipse is very well know and popular open source framework. It counts numerous of plugins and the settings in its configuration section are countless. You might see this as a strenght, but I can also work against you. I for one have never managed to run a project the way I want it to. Creating a new project takes a long time. Recently a feature has been added to create a project from source. Which is handy but probably also the reason why creation of a project takes a long time.

A second problem is code completion. You need to enable Automatic assist in the Code assist section of the PHP configuration. But unfortunately code completion seems to be incomplete.  It might have something to do with extreme long building process after you created a project. This easily takes more than an hour. Additionally PDT freezes sometimes and I even witnessed some hangups. After running into these problems I don’t need to explain that I gave up on Eclipse PDT quite soon.

Zend Studio
As I stated in part 1 of this article the latest version of Zend Studio is based on Eclipse. This is currently version 7.1. Zend is supporting the Eclipse PHP development (PDT). They bring out Zend Studio with some enhancement like support for Unit testing, remote servers,  svn integration, zend framework, code generation and refactoring. In general my experience with 7.1 is that it is slow. Some improvements were made lately but don’t try to run a project from samba shares or ftp servers because you will get disappointed. Other reasons of irritations are the ‘file out of sync’ messages and the long project building time. But when you get your project up and running you’re fine from there. Studio 7.1 offers a good editor and all viewing capabilities you would want to have. A nice feature is the ability to mark and rename a variable, without have to search and replace.

Another Zend Studio option is version 5.5.1. This is ‘the old’ version which is not based on Eclipse but is still downloadable from zend.com. It is fast, has most features you need and is quite reliable. I especially like the remote server options. Just add a ftp folder to your project and you can start working right away. I am not seeing this in any other IDE. Code completion is ready after a few minutes even when working van samba of local folder.  And code completion works pleasantly.

A big advantage of using Zend Studio is the integration with the Zend Debugger. When you are using Zend Server or Zend Platform you can connect to the integrated debugger to step through your application. It is also possible to install the Zend Debugger separately on your server. Studio 7.1 even has local debugger integrated although I did not succeed to get it running with complex application like a CMS or Zend Framework app. Especially handy are the browser toolbars Zend offers to start a debug session from firefox or IE.

A free alternative is Netbeans. A project is started very quickly. It builds the project in the background to load code completion in memory, but you can start editing right away. Code completion has a problem when you try to work with samba shares or ftp folders. It is just way to slow which even makes Netbeans freeze for about 20 seconds or more. The problem has been noted and the Netbeans community is working on a solution which should be available in the next version 6.9. Netbeans has ftp projects. Setting up such a project downloads the sources locally. It is not possible to edit direct from server without having the download the complete content, which usually takes a long time before you can start working on the project.

The next eclipse variant is Aptana Studio.  It’s free. After downloading and installing Aptana you need to install the PHP Development Tool (PDT) plugin. Just like its soul mates, Aptana suffers from slow project creation. It is not possible to create a project from sources immediately. You have to add a folder manually to the project using the advanced button in de folder add dialog. It is strange to see that when I opened files from the project browser, the default php editor on my Macbook was run. To prevent this you need to make Aptana your default editor. Code completion didn’t work. A strong point of Aptana is said to be support for javascript libraries and javascript debugging.

Code completion in Komodo IDE is pretty fast but tends to make some mistakes here and there. I could not find out why these errors occur, they seem to be random. Starting a project is quite easy. Just create your project file in the source root and off you go. Komodo analyses the sources quickly so you will have code completion in a few minutes. I think that Komodo is fastest off all IDE’s on this point. Minor point is that I am missing a good class viewer. Only the current class is shown. Extended classes are missing. I also like to keep the project viewer and class viewer visible all the time. This does not seem to be possible in Komodo.

At the moment my prefered IDE is Zend Studio 5.5.1. It’s fast and reliable. Main reason for choosing 5.5.1 is the very good preformance of code completion. Furthermore it supports ftp projects en debugging.

If you want start off with an free IDE, I would advise Netbeans. You need to develop from local sources otherwise Netbeans is unworkable. But from there you will enjoy this editor very much. The performance problem should be solved in version 6.9 which is planned for march 2010.

Although I didn’t test all IDE’s in the same degree, this article gives you some insight into a number of important features of IDE’s. When you’re in the process of making a choice for an editor, just try them for a week.  But more importantly, ask yourself the question: “What is important for me when writing code”.