Download the PHP package zenddevops/client without Composer
On this page you can find all versions of the php package zenddevops/client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zenddevops/client
More information about zenddevops/client
Files in zenddevops/client
Package client
Short Description ZF2 CLI tool to access Zend Server Web API
License BSD-3-Clause
Homepage https://github.com/zendtech/ZendServerSDK
Informations about the package client
Table of Contents
- Intro
- Requirements
- Installation
- Contributing
- Usage
- Use Cases
- HTTP tuning
- Output formats
- Providing array values
- Deployment properties syntax
- Feedback
Intro
ZendServerSDK, aka zs-client, is a command line application that communicates with Zend Server's WebAPI. It can run on all modern Operating Systems(OS) such as Linux, Mac OS X and Windows.
Requirements
PHP version >=5.3.3 with enabled phar module.
Installation
You can copy locally the latest stable version as a stand-alone file from: https://github.com/zend-patterns/ZendServerSDK/raw/master/bin/zs-client.phar
On Linux you can execute the following command:
Contributing
If you wish to contribute to the project, please read the CONTRIBUTING.md
Usage
Run the phar file with --help to see the available commands:
Use Cases
Adding Target
A target is representing the information needed to connect to a Zend Server. Every target contains unique name and must have URL that points to the location of the Zend Server, WebAPI key and secret and optionally a target can contain information about the version of Zend Server.
To add a target run the following command:
To update a target run the command with the same --target value and provide the new values.
zsurl: if not specified, the value http://localhost:10081
is used.
zsversion: if not specified, the latest Zend Server version will be used.
The information about the available targets is saved in the home directory of the current user in a file named .zsapi.ini.
Using Targets
Once a target has been defined, specify it in subsequent commands by adding its unique name to the argument list, as in this example:
Deploying PHP application
You have a PHP application that you want to deploy to Zend Server. In order to use the deployment you will have to enable deployment support, create a package and upload it to the remote server.
Below are the steps that you need to take:
Enable Deployment Support
This will add two new files in the specified folder: deployment.xml and deployment.properties.
Configure the Deployment
Using Zend Studio 10 or normal text editor edit the deployment.xml file and change the XML data to match your application name, version, etc.
Create Package
Run the following command.
It will output the name of the newly created package file. You have to use this name to install or update an existing application on Zend Server. If you want to use other name for the output file you can use the --name="{desired-zpk-name}" option.
Composer Integration
There is experimental integration with composer that allows you to download the dependant packages, as described in composer.json, download them and convert them to zpk files. The above command with composer integration will look like this
The result from the command will be list of packages in the order that they have to be installed (top first, bottom last). Example:
/tmp/zendframework.zend-stdlib-2.2.4.zpk /tmp/zendframework.zend-console-2.2.4.zpk /tmp/zendframework.zend-file-2.2.4.zpk /tmp/zendframework.zend-mvc-2.2.4.zpk /tmp/zendframework.zend-text-2.2.4.zpk /tmp/zendframework.zend-math-2.2.4.zpk /tmp/zendframework.zend-json-2.2.4.zpk /tmp/zendframework.zend-serializer-2.2.4.zpk /tmp/zenddevops.webapi-dev-dev.zpk /tmp/AddYourUniqueApplicationName-1.0.0.zpk
Deploy Package
Run the following command to install a package.
You can use the same command to update a package. User parameters during the installation can be passed using --userParams="{provide-params-as-query-string}". For example if you want to pass parameter APPLICATION_ENV and DB_TYPE then you can use the following
Safe Package Deployment
If you deploy a new version of your zpk if the old version is still being deployed then
this can lead to unpredictable results. In order to prevent this you can use the --safe
flag.
If it is present zs-client will check if there is a current deployment going on for this app
and will exit if that is the case.
Example:
If you want to be safe AND want to wait for the previous deployment to finish then you can use the --safe and --wait flags together.
Example:
Deploy Multiple Packages
If you use the composer integration then packZpk can create multiple packages, instead of one. Below is a suggestion how you can deploy these newly created packages in the correct order.
HTTP tuning
Changing Connection Timeout
In some cases we may expect slower communication between the client and the server. In that case we can set explicitly the http timeout to a bigger value. The example below shows how to set it to 40 seconds.
Accepting Self-Signed SSL Certificates
In most cases the HTTPS access to your Zend Server will use self-signed certificate. In order to instruct the client to accept the SSL certificate you can do the following.
Combining Multiple HTTP options
If you want to combine multiple HTTP options in the same request then you can format the value of the http parameter as a valid HTTP query string. Request with timeout of 40 seconds and acceptance of self-signed certificates will look like this.
Persisting the HTTP Options
If you want to keep the http options saved to a target then when defining or updating the target define also the http parameter. Format the value as valid HTTP query string. Take a look at the following example.
Output formats
In the cases where the output is text zs-client supports three formats: xml, which is the default one, json and kv(key value). To specify the desired format you have to use the --output-format parameter.
Example:
Will return `
Providing array values
Some commands accept arrays as arguments.
For example configurationExtensionsOn allows you turn on multiple extensions at the same time. The code below turns on bcmath and tidy:
Notice the syntax of the extensions value. It is a list of items having comma as delimiter. If for some reason you want to replace the comma with another delimiter this can be done by adding the new delimiter enclosed in smaller than (<) and bigger than (>). In the example below we use semicolon as delimiter:
If needed you can pass more complicated array data. For example a PHP array like the one below ...
... can be represented in the command line using the following syntax.
Here the default delimiter is &. If you want to use custom delimiter, semicolon for example, then you can specify it similar to the previous example:
Notice about delimiters: Choose your delimiter wisely.
- Choose custom delimiter only if the default ones ("," and "&") do not work for you.
- A delimiter should not be special character that is interpreted by your shell.
- A delimiter should not be special character that is removed silently by your shell.
- A delimiter should not be one of the characters that are already in the data.
Deployment properties syntax
In the deployment.properties
file one can specify the files that will become part of the
application or part of the deployment scripts.
Read this document for more information.
Make sure to read about the way scriptsdir.includes values are processed.
For application excludes we support following wildcard syntax:
**/{something}
- will exclude all entries that have base name {something}, no matter if they are files or folders, Example: **/.svn excludes all folders and files with the name.svn
. This is true for/.svn
,public/.svn
ormodule/folder-with-file/.svn
. If the entry is folder then the content of that folder and sub-folders will be excluded too.*{something}
- will exclude all entries ending with {something} in their name. Example:*.fla
will exclude all files ending with.fla
, likevideo.fla
. or directories, likemore.fla
.
Feedback
For questions and feedback write to slavey (at) zend DOT com.
All versions of client with dependencies
zendframework/zend-i18n Version ~2.4.0
openlss/lib-array2xml Version dev-master
zenddevops/webapi Version dev-master
mustangostang/spyc Version dev-master
slk/icm Version dev-master