Views

Setting up a local web development environment

Setting up a local web development environment allows you to create and modify web applications on your own computer, rather than uploading the application files to a server to run the files.

To set up a local web development environment, you will need to download and set up a web server, such as Uniform Server, on your local machine. Uniform Server (similar to WampServer or XAMPP) simulates a web server on your machine with the LAMP Stack (Linux, Apache, MySQL, and PHP) resources, which are essential for working with Swarm Tester, Joomla and other applications.

In addition to a web server, there are a few other programs you'll need to work with application files. One is Notepad++, a text editor that lets you write and edit various types of code, including PHP. You will also need to install TortoiseSVN, a subversion client that will help you manage versions of source code. This article walks you through setup and installation of these web development resources.

Install TortoiseSVN

Click the Downloads tab. (Note: Do not the Download button in the advertisement section).

Download the correct version for your system (32-bit or 64-bit). If you don't know whether your computer is 32-bit or 64-bit, click your Windows Start button, right-click My Computer and select Properties. The System Type lists this information.

Click the downloaded file to start the installation.

Click Run.

Click Next through the menu, and then click Install.

Set up a web server

Install a web server

Uniform Server is a local server that will allow you to test the applications you create or modify with or without the Internet. XAMPP or WAMP can also be used, but these instructions are for installing and using Uniform Server.

Set up your web server

Double-click Start_as_service. (You can drag this file to your taskbar for quicker access.)

When prompted for permission by User Access Control, click Yes.

When prompted to change your password, Click Yes.

Type a new password in the text box.

Click Change Password.

Click OK to proceed and close the Set New MySQL Password dialog box.

In the Uniform Server dialog box, there are several new options.

New options in the Server Service window

Click Install Apache Service.

Click Install MySQL Service.

Enable SOAP

SOAP, or Simple Object Access Protocol, is a protocol that allows applications to exchange structured information over other web protocols, such as HTTP. Enabling SOAP is necessary when working with some applications, such as Swarm Tester.

If it's not already open, start Uniform Server by navigating to the Uniserver folder (installed on your C:\ drive) and click Start_as_service.

Click Server Configuration.

In the new window, click PHP.

Select Edit Current Configuration file: php.ini.

Editing the PHP configuration

In the new window, search (ctrl+f) for soap.

On the line, ;extension=php_soap.dll remove the semicolon. This will uncomment the line and make it active in the code.

An information file should open on a new web page. If it does, you have set up your web server correctly and PHP is working.

Running a php info command to ensure PHP is working

Checking out project files

At this point you need to be a member of a developer project in order to access the project files. See 2. Join a project (volunteers) for more information on joining projects. Each project has various roles, such as project manager, tester, developer, and observer. The project manager sets roles for each team member. Although any team member can check out source files, you must be designated as a developer on the project to commit changes back to the source code repository.

Copying the source code repository link for the project. Only development projects use a source code repository.

Go back to the UniServer folder on your C:\ drive and open the www folder.

Right-click and select SVN Checkout. Note: If you do not see this option, you have not installed TortoiseSVN.

Under URL of Repository paste the link. (This field may be auto-filled from your clipboard already.)

Click OK.

Enter your LDS Account username and password.

Click the check box titled Save authentication.

Click OK. This will add a folder to your www folder and download a copy of all the relevant project files to your machine.

Downloading project files to your local machine.

When checkout is finished, click OK.

There is now a folder with the name of your project containing all the development files for that project.

Working with TortoiseSVN

There are several features of TortoiseSVN that will allow you to easily track and change files. You can see which files were changed and exactly where they were changed. You can also create patches so that an administrator can easily check and apply the changes that were made.

See the changes made to a file

When you make changes to a code file, such as a read-me file, a red dot will appear next to the file and folder where changes were made. For practice, once you've downloaded project files, such as from the LDSTech project, navigate to a Read Me file (if one exists, such as in the ldstech > wiki > trunk folder for the LDSTech project) and make a change. To see the changes made:

Right-click a file with a red dot.

Go to TortoiseSVN > Diff.

A side-by-side window appears highlighting the specific place where changes were made.

See the changes made within a folder

In the project folder, a red dot will be present to signify that a change was made to a file within that folder. To see the changes made in the folder:

Right-click the folder with the red dot.

Go to TortoiseSVN > Check for Modifications <p>A window appears listing all the files that were changed.

Double-click the file name to open the side by side diff view.

Commit changes

Unless you are designated as a developer on the project, you will not be able to commit changes directly (by right-clicking the file and choosing SVN Commit), and any attempt will result in an error message.

Instead, when you have a fix, you will need to create a patch of the changes you made and then submit it to the project manager for approval.

Create a patch

A patch is a text file that contains code detailing the changes you made to the files. This will let the developers easily see and approve any changes you make. It will also let the developers easily apply your changes. To create a patch:

Right-click the folder you want to create a patch for.

Go to TortoiseSVN > Create Patch.

In the window that appears, select the files you want to create patches for, and then click OK.

Save the patch.

Send the patch to the project manager or developer on the team.

Revert a file

Reverting will undo any changes that you made to a folder or file. It will revert the file back to the way it was before you opened it. To revert changes to a file: