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:
- Complete install of Windows Azure for Eclipse
- 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.
- Start Eclipse configured for building Windows Azure PHP Projects.
- Initially, starting Eclipse typically defaults to be in PHP perspective. To be sure for this lab, open PHP perspective in Eclipse.
- In Eclipse menu-bar, select Window menu
- In Window menu, select Open Perspective menu-item
- In Open Perspective menu-item, select PHP cascading menu-item
- In the PHP perspective, create a PHP Project.
- In Eclipse menu-bar, select File menu.
- In File menu, select New menu-item.
- For New menu-item, note that the initial cascading menu-items are:
Note: |
|---|
|
Note that initial cascading menu-items for New menu-item in will change within PHP Windows Azure perspective.
|
- Select cascading menu-item PHP Project to create.
- In PHP Project panel, assign name to new PHP project as "Standard".
- In new "Standard" PHP project create a new PHP File.
- Select File > New > PHP File:
- Assign new PHP file's name as index.php:
- Select Finish button
- 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>
|
- 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.
- Change Eclipse perspective from PHP to PHP Windows Azure.
- In Eclipse menu-bar, select Window menu.
- In Window menu, select Open Perspective menu-item.
- In Open Perspective menu-item, select Other... cascading menu-item.
- In Open Perspective panel, select PHP Windows Azure
- There are two ways to convert a standard PHP project:
- From Eclipse's menu-bar...
- Open PHP Explorer view
- Select PHP project Standard
- In task-bar menus, select menu Windows Azure
- In menu Windows Azure, select menu-item Convert to Windows Azure PHP Project
- or, From PHP Project pop-up menu...
- Open PHP Explorer view
- Right-click PHP project Standard
- In project menu, select menu-item Windows Azure
- In selected menu-item Windows Azure, select cascading menu-item Convert to Windows Azure PHP Project
- Note the conversion of Standard PHP project:
- Open PHP Explorer view
- 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
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.
- There are two ways to convert to a Standard PHP project:
- From Eclipse menu-bar...
- Open PHP Explorer view
- Select PHP project Standard
- In task-bar menus, select menu Windows Azure
- In menu Windows Azure, select menu-item Convert to Standard PHP Project
- or, From PHP Project pop-up menu...
- Open PHP Explorer view
- Right-click PHP project Standard
- In project menu, select menu-item Windows Azure
- In selected menu-item Windows Azure, select cascading menu-item Convert to Standard PHP Project
- Note that there is now only one PHP project:
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...
- Covert Standard PHP projects to Windows Azure PHP projects.
- And convert Windows Azure PHP projects back to Standard PHP projects.
Good job!! You are done with this Lab.
© 2009 Soyatec. All rights reserved.