Thursday, October 27, 2011

Eclipse Continues to Support PHP and Zend Developer Cloud

The last two weeks were a-m-a-z-i-n-g! We released two major pieces that can turn Web development as easy and obvious as writing this hello world application. This time I would like to present additional important piece that the Zend team provide today to enable PHP and Web development (special thanks to @nataliabartol). Welcome the 'Eclipse-based package by Zend'. This package includes the Eclipse Platform latest release (version 3.7.1, code name Indigo-SR1), the Web Tools Source Editing plugin, the PDT plugin (latest version) and the Zend SDK plugin (this plugin enables Zend Developer Cloud). You can find the package and more information about this release here. The size of this package is ~90Mb (depending on your operating system) and users need to extract the package to run the product.

Zend is the provider of Zend Studio 9.0 and lead the Eclipse PHP Development Tools (PDT) project as well as the Zend SDK project. This Eclipse-based product will mainly be useful for developers working with PHP and their workflow includes tasks such as PHP/HTML/Javascript/CSS sources editing, debugging and deployment of Web applications.

The following two minutes demo shows a simple create-deploy-debug cycle enabled by this package:



My team will definitely consider leveraging the Zend SDK to work with more solutions available in the market providing Integrated Development Environment (IDE) for PHP Developers such as Netbeans and  phpStorm, stay tuned!

If you have any questions or comments, feel free to comment below.

Tuesday, October 25, 2011

Pull Down an Application Created on phpCloud

One of the most promising features in Zend Developer Cloud will be to deploy today's most-famous Web applications directly into your container, without being required to supply the application package. The list of pre-packed applications includes projects like Drupal, Joomla, Magento, Wordpress and a customized Zend Framework. Probably Zend will add more applications in the future (want to suggest one?)

The obvious question is, what will be the best practice for working with an already deployed application and how to pull it down to your development environment?

As a background there are two ways for managing an already deployed project, you can select either of the following options depending on your high level development workflows and your tools (ahch, ahch, Zend Studio supports both of them). One important note that is applied for both solutions - you don't need to deploy the project once again. Just modify the content and make sure it's updated properly in the cloud.

Clone Application via Git Repository

One of the Easter Eggs hidden in this already-packed deployment feature is that once an application is deployed, a git repository is created so developers can clone it and later on push their content. Use a command line tool or any development  environment to clone the application. Then use push to upstream git action to update the actual remote application.

To retrieve the application Git Repository, go to you container overview page:
https://my.phpcloud.com/container/<container-name>/overview and push the "git access" button. Use your container name and password as username and password when you make any operation with this repository.



This Git repository authentication is based on secured HTTP with the following details:

  • URI: the path provided by Zend Developer cloud (see above)
  • User: container name
  • Password: container password

Using Zend SDK:

You can use the latest Zend SDK to clone the code to your machine by running the git clone command with your git repository parameters:

zend clone project -r <git-repository-url> -u <user> -p <password>

Using Zend Studio 9.0:
We are about to use a new feature added to Zend Studio in its latest release that enables you to clone a Git repository, start by File | New | PHP Project from Git. A wizard will show up and you will need to enter the information required for this clone operation to happen.



Follow the wizard and hit "Finish". Once your project is cloned, you can start a debug session right-clicking on the index.php file and selecting "Debug as...", supply the full URL of the application and press OK.


Don't forget to open the SSH Tunnel by right-clicking on its node that available in the Targets view and selecting "Open SSH Tunnel"


Download Application via SFTP Client

The trivial way is to use an integrated SFTP client that supports download and upload actions to the SFTP server installed on your container. Remember the following:


  1. Authentication to the SFTP is made using the private key given the time you created the container or user. So you will need to add it to the private keys manager (in Zend Studio / Eclipse it's under Preferences > General >  Network Connections > SSH2. In the General Tab, add the private key file to the text field named: "Private Keys". You don't have to specify a username and password as you use the private key.
  2. The application content is located under the directory named  .apps/http/__default__/0/<user-name>/1.0.0



Hope this tutorial helps you to configure your development environment and you take advantage of it, but if you think there is a different (better) way don't hesitate to comment below.


Saturday, October 22, 2011

Test Drive Zend Developer Cloud with Zend Studio 9

Zend Studio and the Zend Developer Cloud support an integration environment for projects hosted in GitHub. This allows you use the cloud to deploy, debug and modify your Web applications hosted in GitHub  from Zend Studio.

This workflow includes the following tasks:
  1. Creating accounts for GitHub and the Zend Developer Cloud 
  2. Developing a project hosted in Github with Zend Studio and the Zend Developer Cloud
  3. Debugging your application 
  4. Automatically updating your application in real time
Prerequisites

An installed Zend Studio 9.0 (currently on beta) or above. Can be found in one of these pages:
Creating an Account for Github and the Zend Developer Cloud
In order to use GitHub and the Zend Developer Cloud, you must first set up valid accounts for both.
 To create a GitHub account:
  1. Open the GitHub website at https://github.com/. 
  2. Click Plans, Pricing and Signup in the center of the welcome page. The Plans and Pricing page appears. Click Create a free account. The Signup for GitHub page appears. 
  3. Enter your account details in the requested fields, and click Create an account. Your new account page appears. 
  4. Follow the instructions on the Github homepage and create a project and repository. 
  5. For more information on creating a GitHub project go to help.github.com 
To create a Zend Developer Cloud account:
  1. Open the Zend Developer Cloud website at http://www.phpcloud.com/. 
  2. Click Login here in the top-right corner of the homepage. 
  3. Click I do not have an account. The Create a new account page appears. 
  4. Enter your account details in the requested fields, and click Register. The Thank you for creating a Zend account page appears. 
  5. Please answer the questions that appear on the page and click Finish. The Log In page appears. 
  6. Enter your account details, and click Log In. The Zend Developer Cloud welcome appears. 
  7. Click Start now to begin working! Save your Zend Developer Cloud credentials as you will need them later in this workflow.
Working with a Project hosted in Github with Zend Studio and the Zend Developer Cloud

Once you have an existing GitHub and Zend Developer Cloud account, you can use the integration features embedded in Zend Studio and Zend Developer Cloud. You can develop, test and deploy a GitHub application on the cloud through Zend Studio. To create a new container:


  1. Go to the Zend Developer Cloud homepage and open your account and click Start Now on the welcome page. The Create Container page appears. 
  2. Enter the container name and password in the relevant fields, and click Create Container. The SSH Keypair created window appears. 
  3. Click Download private key in PEM format. Save the key on your machine as you will need to browse to it when connecting Zend Studio to your server. Your container has been created and will appear under My Containers on the homepage.
Installing the GitHub Plugin into Zend Studio

Zend Studio gives you the option to use only the plugins you need. For this tutorial, you will need GitHub.

  1. Go to Help | Welcome to open the Zend Studio Welcome screen. 
  2. From the plugin list on the right, mark the Git and GitHub. 
  3. When prompted, restart Zend Studio . When you re-open Zend Studio, the GitHub plugin is installed.

Creating a GitHub Project in Zend Studio

To create a GitHub application in Zend Studio:

  1. Go to File | New |PHP Project from GitHub. The Create Project from GitHub dialog appears. 
  2. Enter the project name and your GitHub authentication details in the relevant fields, and click Refresh. Your application location will appear in the Location box or in the dropdown menu. 
  3. Click Next to move to the Application Deployment dialog.
  4. Select Zend Application Deployment and create a new target by clicking on the PHPCloud icon . The Add Target dialog box appears
  5. Enter your Zend.com credentials and browse to your PEM key in the relevant fields, and click Test Connection.
  6. If no errors appear, click Finish. The Application Deployment section reappears with the target you added.
  7. Make sure the ‘Add Application Deployment Support’ checkbox is marked
  8. Click Finish. Your application will opens in the Zend Studio workspace.


Deploying Your Application on the Zend Developer Cloud

Open your project in Zend Studio. The default file, deployment.xml, opens.

  1. In the Testing area, click Launch a PHP Application The Launch PHP Application dialog opens with the default container you defined during the project creation selected, and your application’s URL
  2. Click Finish and Yes when prompted about your container’s authenticity
  3. Your application appears in your container’s page in the Zend Developer Cloud website, and opens in Zend Studio’s internal browser. Keep the internal browser with your application open as you will need it to automatically update the application.

Debugging Your Application on the Zend Developer Cloud


  1. Open your project in Zend Studio. The default file, deployment.xml, opens.
  2. In the Testing area, click Launch a PHP Application in Debug Mode
  3. Your application now appears in the Debug perspective and stops at the first breakpoint. To continue the debug click .

Automatically Updating Your Deployed Project in Real Time

Zend Studio allows you to automatically update any changes you make in the source code of your application without redeploying the application from the start. Each change you make in the code will be automatically updated in your application on the server.
To automatically update your application:

  1. In the PHP Explorer view, open your projects index.phptml file by going to application| views| scripts | index| index.phptml. The index.phptml file opens in the text editor. 
  2. Make a small textual change in the code and save the project.
  3. Go to the internal browser of your project and click the Refresh icon . Your application updates with the changes applied.
Note: this article describes the workflow as available today for phpcloud developers. I am not sure if this will be the case in next versions, so you should get updated with the php cloud release notes. It was written by the documentation team at Zend, if you have any comment feel free to post it below.

Tuesday, October 18, 2011

First API released for phpcloud.com

In previous post, I presented the Zend Developer Cloud Platform and some thoughts about it. It's time for me to show some pretty cool API we added for developers who want to exploit all the goodies from it. In a nutshell, the Zend Developer Cloud API enables you to authenticate, list your containers details and get a very nice information about your requests, and of course to start debugging of specific events occurred lately.

The first implementation using this API is the Zend Developer Cloud sniffer that "integrates into the PHP runtime and watches for various events such as errors, failing functions, slow scripts and database errors. This allows you to debug your application during development, helping you create a better application.". And the first implementation of this API is available under EPL at the Zend SDK source code In more details the following API is available:

  1. authenticate(u, p, _success, _error)
    Authenticate to the Zend Developer Cloud service given the username and password. Once authentication is validated, a session id is retrieved and assigned as cookie
  2. list(_success, _error)
    Lists all containers for the signed in user
  3. requestSummary(containerName, requestUid, _success, _error)
    Retrieve information about a particular request's events and code tracing. The requestUid identifier is provided in a cookie that is set in the response to the particular request.
  4. downloadAmf(containerName, amf, _success, _error)
    Download the amf file specified by codetracing identifier
  5. startDebug(containerName, issueId, eventGroupId, _success, _error)
    Start a debug session for specific issue

Better Together - Github and Zend Developer Cloud

The two Cloud-based services Zend Developer Cloud and GitHub share some common traits. Although these services are loosely coupled, developers using one service can easily find interest in the other. For example the openness of the services to application developers world, the (so important) social dimension and the fact that it is just easy to use through a set of APIs and tools, make these two services fun to work with... together.

It takes four command lines to see the value (you will need to install Zend SDK first):

# clone an example 'hello tweet' project from a github repository
$ zend clone project -r git://github.com/zendcon/hellotweet.git

# define a Developer Cloud container to host your application
$ zend add target -d account-name:account-password

# set working directory
$ cd  hellotweet

# deploy the newly created application to the defined target
$ zend deploy application 

The result is available as a ready to use Web application http://royganor.my.phpcloud.com/zendcon/ and since I made the container public anyone can create the same container through http://my.phpcloud.com/container/create/snapshot/royganor-snapshot-20111018054539

But there are more similarities, let's review some of them:
  • Identities are open and visible between developers 
  • Applications and repositories are listed:


  • Social activities are available for developers who want/need continuous and fast feedback  


If you are interested in more information about specific aspect of the solution, share it here and I will answer you.



Zend Launches Developer Cloud & SDK To Give Developers Access to Web Applications Market

Zend, The PHP company and the place I work for the past 5 years has made some significant steps over the last year to enable Web developers to deliver scalable Web applications. As part of our strategy Zend has been full-steam ahead on creating better ways for Web developers to make application deployed on a self-served container which can be scaled up and down which have been traditionally difficult areas for PHP developers to execute effectively.

In May the Zend Server team has published a major update to the product with the ability to create application packages that consist of source code, metadata and scripts, and of course deploy applications on any number of servers. At about the same time, my team has worked to deliver tools supporting these capabilities.

Today, Zend is adding the remaining piece, again utilizing its current product line. The company today announced that it is releasing the Zend Developer Cloud and a software development kit (SDK) called Zend SDK to enable Web developer build their applications on a robust platform in a very short time. This is of interest for the very reason that this service is given for free by Zend.

When it comes to entering the PHP applications market like Wordpress, Drupal, Magento, Zend Framework apps, developers are met with a number of obstacles, including environment requirements and unstructured development tools. The advantage then, of Zend′s new platform and SDK is that now developers have streamlined workflows to develop their applications.

To demonstrate how easy it is to create Web applications with the new tools, I created a GitHub repository for a #zendcon tweeter channel  https://github.com/zendcon/hellotweet and made it available on my container at http://royganor.my.phpcloud.com/zendcon/ in about a couple of minutes.

Stay tune for more posts and information about this news.