Build new applications in the cloud - or use interoperable services that run on Microsoft infrastructure to extend and enhance your existing applications. You choose what's right for you.

Table of Contents

 

Lab 1.2 — Windows Azure Web Service

Coverting Projects

 

In this lab, you will learn how to use Windows Azure Toolkit for Eclipse to convert a very simple Standard PHP project into a Windows Azure PHP project.

 


 

Task 0 — Prerequisites

 

Before doing this lab, if you not done so:

 

  1. Complete install of Windows Azure for Eclipse
  2. Complete first lab Getting Started

 


 

Task 1 — Create Standard PHP Project

 

In this task, you will create a Standard PHP project that will contain a simple index.php file.

 

  1. Start Eclipse configured for building Windows Azure PHP Projects.
  2. Initially, starting Eclipse typically defaults to be in PHP perspective. To be sure for this lab, open PHP perspective in Eclipse.
    1. In Eclipse menu-bar, select Window menu
    2. In Window menu, select Open Perspective menu-item
    3. In Open Perspective menu-item, select PHP cascading menu-item
  3. In the PHP perspective, create a PHP Project.
    1. In Eclipse menu-bar, select File menu.
    2. In File menu, select New menu-item.
    3. For New menu-item, note that the initial cascading menu-items are:
      • PHP Project
      • Project...
       Note:

      Note that initial cascading menu-items for New menu-item in will change within PHP Windows Azure perspective.

    4. Select cascading menu-item PHP Project to create.
    5. In PHP Project panel, assign name to new PHP project as "Standard".
  4. In new "Standard" PHP project create a new PHP File.
    1. Select File > New > PHP File:
    2. Assign new PHP file's name as index.php:
    3. Select Finish button
    4. Assign the following code into index.php:
    PHP — index.php
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
      <title>Standard Project</title>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
    </head>
     
    <body>
     
    <h1>Standard Project</h1>
     
    <h2>PHP Information</h2>
    <p>
    <?php phpinfo(); ?>
    </p>
     
    </body>
    </html> 
    
  5. You are finished creating simple Standard PHP project. Let's convert it to Windows Azure PHP project.

 


 

Task 2 — Convert from Standard to Windows Azure

 

In this task, you will convert your previously created Standard PHP project to a Windows Azure PHP project.

 

  1. Change Eclipse perspective from PHP to PHP Windows Azure.
    1. In Eclipse menu-bar, select Window menu.
    2. In Window menu, select Open Perspective menu-item.
    3. In Open Perspective menu-item, select Other... cascading menu-item.
    4. In Open Perspective panel, select PHP Windows Azure
  2. There are two ways to convert a standard PHP project:
    1. From Eclipse's menu-bar...
      1. Open PHP Explorer view
      2. Select PHP project Standard
      3. In task-bar menus, select menu Windows Azure
      4. In menu Windows Azure, select menu-item Convert to Windows Azure PHP Project
    2. or, From PHP Project pop-up menu...
      1. Open PHP Explorer view
      2. Right-click PHP project Standard
      3. In project menu, select menu-item Windows Azure
      4. In selected menu-item Windows Azure, select cascading menu-item Convert to Windows Azure PHP Project
  3. Note the conversion of Standard PHP project:
    1. Open PHP Explorer view
    2. Note that Windows Azure PHP project now has two projects:
      • Standard is now a Windows Azure Service PHP project
      • Standard_WebRole is the Windows Azure Web Role PHP project
        • Note that the contents of the initial Standard PHP project has been migrated into the Windows Azure Web Role PHP project.
        • In this lab, specifically PHP file index.php
    3.  Note:

      Basically, what occurs in the conversion is:

      • Standard PHP project is converted into a Windows Azure Web Role PHP project.
      • Windows Azure Service PHP project is created.

 


 

Task 3 — Convert from Windows Azure to Standard

 

In this task, you will convert your Windows Azure PHP project back to a Standard PHP project.

 

  1. There are two ways to convert to a Standard PHP project:
    1. From Eclipse menu-bar...
      1. Open PHP Explorer view
      2. Select PHP project Standard
      3. In task-bar menus, select menu Windows Azure
      4. In menu Windows Azure, select menu-item Convert to Standard PHP Project
    2. or, From PHP Project pop-up menu...
      1. Open PHP Explorer view
      2. Right-click PHP project Standard
      3. In project menu, select menu-item Windows Azure
      4. In selected menu-item Windows Azure, select cascading menu-item Convert to Standard PHP Project
  2. Note that there is now only one PHP project:
  3.  Note:

    Basically, what occurs in the conversion is:

    • Windows Azure Web Role PHP project is converted into a Standard PHP project.
    • Windows Azure Service PHP project is deleted.

 


 

Summary

 

In this lab, you have learned how to...

 

  1. Covert Standard PHP projects to Windows Azure PHP projects.
  2. And convert Windows Azure PHP projects back to Standard PHP projects.

 

Good job!! You are done with this Lab.