Home arrow Web Authoring arrow Page 3 - Deploying your Site with phpEclipse
WEB AUTHORING

Deploying your Site with phpEclipse


Eclipse simplifies the process of deploying your site to a web server. You can even use Ant, traditionally thought of as a Java tool, to help you in the deployment. This article, the first of two parts, explains how. It is excerpted from PHPEclipse: A User Guide, written by Shu-Wai Chow (Packt Publishing, 2006; ISBN: 1904811442).

Author Info:
By: PACKT Publishing
Rating: 5 stars5 stars5 stars5 stars5 stars / 6
March 09, 2006
TABLE OF CONTENTS:
  1. · Deploying your Site with phpEclipse
  2. · FTP, SFTP, and WebDAV Export
  3. · Using Ant for Deployment
  4. · Setting up Ant for FTP

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Deploying your Site with phpEclipse - Using Ant for Deployment
(Page 3 of 4 )

You may have heard of Ant in the Java development world. Being a pure Java tool, Ant is often called 'the Java version of make'. With Ant, you create scripts called build files that are interpreted by the Ant parser. These scripts aid you in Java development by compiling your code and deploying it in your build directory. For both small home-grown projects and large Java enterprise environments, Ant has become an absolutely critical tool for Java developers. In the PHP world, though, we do not have any code to compile, and often, FTP is adequate for moving files into production. Why, then, as PHP developers, do we care about Ant?

In some business environments, production web servers are tightly controlled. Developers are not allowed anywhere near the servers, let alone pushing out code at their whim. The sheer act of deploying new code often occurs only after a long ritual of meetings and approvals at various levels. In these environments, deployment occurs with a script that automates the delivery of an application from one area to the production site. Ant scripts can do this job for you for applications in any language.

Even if you are not working in such an environment, why would you use Ant? A key benefit is Ant's integration with CVS and Subversion. Using Ant, you can write a script to grab all files in the repository with a certain tag and FTP them to a production server. Imagine the time saved and reduction in human error with this. In a large application with PHP class files in one directory, HTML view files in another, JavaScript files in their own separate directory, and stylesheets in yet another, a deployment involves a huge effort and it is difficult to keep track of what has changed.

At deployment time, you have to check out all the correct files from CVS or Subversion and then FTP all of them again to the production web server. If all you have to do is tag a file at the end of testing, you have drastically reduced the chance that you'll miss something when retrieving from the code repository or FTPing.

Finally, Ant scripts are easy to write. Being XML-based, these scripts are fairly simple and intuitive. If we were not concerned with code cleanliness, it would take only one line of code to check out a project from the code repository, and another line to FTP files. The reference documentation is excellent. If you require any more support, Ant is supported by a large user base and online community. Being an Apache Foundation project doesn't hurt its popularity either.

Eclipse integrates Ant smoothly into our development environment. Included with the JDT, Eclipse has a nice Ant editor, templates, and tag help. You can execute them directly from Eclipse. Let's walk through an example using CVS.

 


The official Ant release does not support Subversion. Luckily, Ant employs an extensible architecture like Eclipse. Tigris.org, the developer of Subversion, has created an Ant task called svnAnt that allows Ant to interface with Subversion repositories. More information about this proect is available at http://subclipse.tigris.org/svnant.html

 


blog comments powered by Disqus
WEB AUTHORING ARTICLES

- Top WordPress Plugins for Social Media
- How to Install WordPress on WAMPP
- More of the Best Wordpress Plugins for Comme...
- Top Wordpress Plugins to Fight Spam
- More of the top Drupal modules for SEO
- Top Drupal Modules for SEO
- More Top Wordpress Plugins for SEO
- Website Optimization Tips
- Backup and Restore a Drupal Website and Data...
- 5 Best Web Font Services
- Web Font Embedding Services
- Joomla Site Administration
- Create PHP Pages that Use WordPress Templates
- Top Joomla Extensions for Social Networking
- Drupal Modules for Site Navigation

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 1 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials