Dec 15
2009

Creating a SVN Repository

Posted by: admin in CMS

Tagged in: Untagged 

Any Source code control (SCC) system needs a repository that acts like a vault to hold the current and archival copies of the files that have been registered with the application. For a single developer, a repository can simply be created as a folder on the local drive. Once the folder is created, SVN can be selected to register it as a repository, and it immediately creates the files and folders that will be needed by the application for housekeeping of the archive.

Create a folder and name it SVN_Repository. This folder may be located on your local drive or, for backup possibilities, may be located on a network drive that is scheduled for automated backup. If you would prefer to set up a SVN Server, you can easily find instructions on that process on the SVN site, although the configurations (particularly in regard to security) are beyond the scope of this book.

Right-click on the folder and, from the context menu, select the TortoiseSVN ➪ Create repository here... option. You will be asked to select the repository type. Leave the default selection and click the OK button. The system should let you know that the repository was created successfully.

Because SVN may be integrated with many development systems (most particularly, Eclipse), you will be able to use this repository from within your development environment.

Using Eclipse
Eclipse is a professional development system originally created by IBM before it was transferred to the open source community. Eclipse has a complete IDE, and an extension gives the system full support for PHP development. The Eclipse IDE is project-based, so all of the various files of a project can be coordinated.

There is a plug-in for the Eclipse development system called Subclipse that seamlessly integrates SVN version control into the development environment. With a simple right-click and menu selection within the environment, you can check in or check out files for your project.

Download EasyEclipse and Installation
Rather than downloading Eclipse and performing the necessary installation on all of the various plug-ins, it is generally a good idea to simply download the EasyEclipse for PHP distribution. This installer includes all of the key plug-ins for PHP development, including Subclipse. At the EasyEclipse Web site, you can find the installers for Windows, Mac OS X, and Linux:       www.easyeclipse.org

The package is more than 100MB, so it is best to download it using a fast connection. The installation pro- cedure only requires two steps: accepting the license agreement and choosing the installation directory.

Configuring Eclipse
When you first run Eclipse, the application will prompt you for the location of your workspace folder. Select the “Use this as the default” option so that workspace will be used in future executions. The first time Eclipse opens, it will bring up the Welcome screen.

Workbench Basics
In Eclipse, the development environment is called the workbench. The main workbench window appears. The configuration of the workbench display is determined by the current perspective. A perspective governs which windows (or parts, as they are known in Eclipse terminology) are displayed and the current resources available. In the upper-right corner of the window, you can see the perspectives shortcut bar that allows switching between current perspectives, as well as opening other ones. The title bar shows which perspective is currently displayed. In this figure, the Resource perspective is being used.

You can create a new project from a variety of templates (such as Java, Static Web, PHP, XML, and so on), all of which include basic templates that cater to the type of project that is being created. The type you will be using for Joomla development will be a PHP project. Before you create a new project, it is useful for Joomla development that all project files have the security code that prevents the file from being executed outside of the Joomla framework.

To begin to familiarize yourself with Eclipse, modify the default PHP template to use the Joomla security code. Under the Window menu, select the Preferences option. The preferences are stored within a tree inside the window. Expand the PHPeclipse Web Development node, then expand the PHP node, and finally click on the Code Templates item.

In the right pane of the Preferences window, you can see all of the available template files for this type of project. Select the “New PHP files” item and click the Edit button. You can now add any code you want to be presented in a new file. In this case, enter the following code:

// no  direct  access

defined(‘_JEXEC’)  or die(‘Restricted access’);

Click the OK button to save the changes. Now, any new PHP files created in Eclipse will automatically have run security included.

The Subclipse plug-in included with the EasyEclipse installation. If you have installed the standard Eclipse application, be sure to download and install Subclipse to give Eclipse access to the SVN functionality. Subclipse is available for download here:    http://subclipse.tigris.org


Comments (0)Add Comment

Write comment

busy

Latest posts from our blog...

Tags

Copyright © 2009 Webhostingart.com. All rights reserved unless otherwise stated.