LDSTechForumProjects

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 Notepad ++

You will need to install or already have a text pad editor so that you can edit code. Notepad++ is a popular editor.

  1. Go to www.notepad-plus-plus.org.
  2. Click Download in the left sidebar.
  3. Click Notepad++vXXX Installer, where XXX refers to the latest version. For example, Notepad++v6.1.3 Installer.
  4. After the installer file downloads to your computer, click it to begin the installation.
  5. When prompted with User Access Control permission, click Yes.
  6. Select your language and click OK.
  7. Click Next through the menu, and then click Install.

Install TortoiseSVN

TortoiseSVN is Subversion source control software that will allow you to download, upload, work on, and track changes in project files.

  1. Go to http://tortoisesvn.net/.
  2. Click the Downloads tab. (Note: Do not the Download button in the advertisement section).
  3. 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.
  4. Click the downloaded file to start the installation.
  5. Click Run.
  6. 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.

  1. In your web browser, go to www.uniformserver.com.
  2. Click /download in the upper-left corner.
  3. Click the link next to “Looking for the latest version?” to download Uniserver.
  4. Move the downloaded file to your C:/ drive. Note:Do not move the file to your Program Files folder as this will cause permissions problems later.
  5. Double-click the file to start the installation.
  6. When prompted, click Run.
  7. Click Extract when prompted.

Uniserver extracts and installs in its own self-contained folder called Uniserver. All installation files are contained in this folder (nothing is added to your registry).

If you run into trouble with installation, see the Uniform Server wiki section on installation.

Set up your web server

  1. Open the UniServer folder.
  2. Double-click Start_as_service. (You can drag this file to your taskbar for quicker access.)
  3. When prompted for permission by User Access Control, click Yes.
  4. When prompted to change your password, Click Yes.
  5. Type a new password in the text box.
  6. Click Change Password.
  7. 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
  8. Click Install Apache Service.
  9. 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.

  1. 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.
  2. Click Server Configuration.
  3. In the new window, click PHP.
  4. Select Edit Current Configuration file: php.ini.
    Editing the PHP configuration
  5. In the new window, search (ctrl+f) for soap.
  6. On the line, ;extension=php_soap.dll remove the semicolon. This will uncomment the line and make it active in the code.
    Enabling SOAP in the php.ini file.
  7. Save and close the file.
  8. Close the Uniform Server Configuration window.

Testing the web server

  1. In the Server Service window, click Start Apache Service.
  2. Click Start MSQL Service.
  3. Click View www.<p>A new web page, “Welcome to The Uniform Server," opens.
    Checking that Uniform Server installed correctly.
  4. In a new Notepad++ document, type:
<?php 
  phpinfo(); 
?>
  1. Save the file as phpinfo.php in the C:/Uniserver/www folder.
  2. In your web browser type localhost/phpinfo.php

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.

To check out the project files:

  1. Go to tech.lds.org.
  2. Sign in with you LDS Account username and password.
  3. Click Projects and find the project you are working on.
  4. Click the project to open the Project Details.
  5. Copy the link by Source Code Repository
    Copying the source code repository link for the project. Only development projects use a source code repository.
  6. Go back to the UniServer folder on your C:\ drive and open the www folder.
  7. Right-click and select SVN Checkout. Note: If you do not see this option, you have not installed TortoiseSVN.
  8. Under URL of Repository paste the link. (This field may be auto-filled from your clipboard already.)
  9. Click OK.
  10. Enter your LDS Account username and password.
  11. Click the check box titled Save authentication.
  12. 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.
  13. 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:

  1. Right-click a file with a red dot.
  2. 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:

  1. Right-click the folder with the red dot.
  2. Go to TortoiseSVN > Check for Modifications <p>A window appears listing all the files that were changed.
  3. 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:

  1. Right-click the folder you want to create a patch for.
  2. Go to TortoiseSVN > Create Patch.
  3. In the window that appears, select the files you want to create patches for, and then click OK.
  4. Save the patch.
  5. 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:

  1. Right-click the file.
  2. Go to TortoiseSVN > Revert.
  3. Select the files you wish to revert, and then click OK.

This page was last modified on 21 June 2012, at 15:39.

Note: Content found in this wiki may not always reflect official Church information. See Terms of Use.