The developer has an existing application that they want to get deployed into their cloud container.
With the new Zend SDK and using a local copy of your application you can deploy your application to the DevCloud and start working on it immediately. This functionality is currently available using the zdpack program included with Zend Server in conjunction with the Zend SDK. Version 0.0.16 or greater is required.
Pushing your existing application to the DevCloud is quite easy when done in conjunction with the SDK. The first thing you need to do is add a deployment target to your local installation. This is done using the "zend add target" command. If you are working with a standard Zend Server you need to enter in the host, API name and the secret key. With the DevCloud you only need to enter in your username and password (assuming you have the SDK set up):
zend add target -d username:password
You will then get a response back from the server and the SDK will give you a target ID (necessary for supplemental steps)
Target https://username.my.phpcloud.com was added successfully, with id 0
At this point you can now deploy your application to the DevCloud. You only need to tell it how.
The first thing you *should* do is have your public files reside in some kind of public directory and data files existing outside of that public directory. Keeping data files (configuration files, caches, etc.) out of the document root is a great security best practice. In fact, keeping virtually ALL of your application out of the document root is generally a good idea. But even if you're not you can still use the SDK. You'll just need to make a few changes to your document root in the deployment file.
Start by telling the SDK to initialize your project directory.
zend create project -t simple -n MyProject
This should produce the following output (or something similar)
Project resources were created successfully for MyProject under D:\workspace.devcloud\MyProject
From there you will need to edit the new deployment.xml file in the main directory of your application. This file is used by the deployer to set up your application on the server. There are a lot of options that you have in the deployment file (including things like deploy scripts and the like), but to get it into the DevCloud there is only a minimal amount of configuration that is needed.
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <package xmlns="http://www.zend.com/server/deployment-descriptor/1.0" version="1.0"> <name>MyProject</name> <version> <release>1.0.0</release> </version> <appdir>public</appdir> <docroot/> </package>
To deploy the application go into the MyProject directory (or whatever the name of your application is) and type
zend deploy application
This will deploy the application to your container. You can specify the URL with the -b flag if you don't want to use the default. When the application is deployed you will get a message like the following.
Application MyProject (id 18) is deployed to http://<default-server>/MyProject