-
Notifications
You must be signed in to change notification settings - Fork 2
Managing Projects
The default deployable project has to include two files:
- deployment.xml
- deployment.properties
The first file is the deployment descriptor. For more details, see DeploymentDescriptor?.
The second file defines the file mapping. For more details about using deployment.properties file, click here.
The Zend SDK allows creating a new deployable project which includes all the required files and a default folder structure. To create a new project, use this command:
zend create project -n <name> [-d <path>] [-t <name>] [-s <script names>]
The flag "-d" can be used if the new project should be created in a different location than the current one (as an argument pass the path to the project destination).
The flag "-t" tells the command line tool to create a project based on specified template name. Possible arguments are (use only one of the following):
- simple - simple project structure
- zend - Zend Application structure
- quickstart - example Guestbook project
By default (if -t is not used) Zend Application is used as a template.
The flag "-s" tells the command line tool create scripts folder (which is optional and not created by default) with scripts passed as an argument (any of the following names: all|postActivate|postDeactivate|postStage|postUnstage|preActivate|preDeactivate|preStage|preUnstage). All scripts created using this option are empty files with comments how to use them.
The Zend SDK also allows you to update an existing project to the proper deployable project. To update an existing project, use this command:
zend update project [-d <path>] [-s <script names>]
By default (command without any option) command line tool treats the current directory as a project root. To specify which application should be updated, use "-d" with a path to the project as an argument (relative to the current location). The flag "-s" has the same behavior as for the project creation (arguments are also the same).
Updating the project results in the following changes:
- Descriptor file is created. Project root folder is taken as a project name.
- If "-s" option was used, then scripts folder is created.
- 'deployment.properties' file is created. By default, it maps all files from the project to the 'appdir' directory, except the descriptor file, the scripts directory and files from the default exclusion list (for more details about the deployment properties file, click here).
The Zend SDK also allows you to clone a project from a git repository, and update it (if necessary) to the proper deployable project. To clone a project from a git repository, use this command:
zend clone project -r <repository> [-d <destination>] [-b <branch>] [-u <user>] [-p <password>] [-k <key>]
By default (command without any optional parameter) the command line tool clones a project from specified repository. If "-d" option is used, then a project is cloned to the specified destination folder. Otherwise, project root folder is created based on the repository name. Clone command supports two authentication methods, user/password and ssh (for github access). In the case of ssh, "-p" option is applied as a pass phrase for a private key. After project is cloned, it is updated (see Updating a Project).
Cloning a project results in the following changes:
- A repository is cloned to the specified location (or to the default one)
- A descriptor file is created (if it is not available). Project root folder is taken as a project name.
- If "-s" option was used, then a scripts folder is created.
- 'deployment.properties' file is created (if descriptor is not available). By default, it maps all files from the project to the 'appdir' directory, except the descriptor file, the scripts directory and files from the default exclusion list (for more details about the deployment properties file, click here).
Zend SDK allows to add new remote to the existing local git repository.
To add a new remote, use this command:
zend add remote -r <repository_url> [-a </path/to/project>]
The flag -a is not required if the current location is a root application folder. The new remote name is based on the repository URL domain (e.g. for git@github.com:mylogin/testapp.git, the URL of the new remote will be called "github" and for https://login@login.my.phpcloud.com/git/testapp.git - it will be "phpcloud").