@@ -11,83 +11,29 @@ PHP version >=5.3.3 with enabled phar module.
11
11
Installation
12
12
============
13
13
14
-
15
- Stable Version
16
- --------
17
- You can copy locally the latest stable in a stand-alone file from:
14
+ You can copy locally the latest stable version as a stand-alone file from:
18
15
https://github.com/zend-patterns/ZendServerSDK/raw/master/bin/zs-client.phar
19
16
20
- On Linux you just need to execute the following command:
17
+ On Linux you can execute the following command:
21
18
22
- ```
19
+ ``` sh
23
20
wget https://github.com/zend-patterns/ZendServerSDK/raw/master/bin/zs-client.phar
24
21
```
25
22
26
- Development Version
27
- -------------------
23
+ Contributing
24
+ ===========
28
25
[ ![ Build Status] ( https://travis-ci.org/zend-patterns/ZendServerSDK.svg?branch=master )] ( https://travis-ci.org/zend-patterns/ZendServerSDK )
29
-
30
- Clone the latest source code
31
- ```
32
- git clone https://github.com/zend-patterns/ZendServerSDK.git
33
- ```
34
-
35
- Then change the directory to the newly created one
36
- ```
37
- cd ZendServerSDK
38
- ```
39
-
40
- Install composer
41
- ```
42
- wget http://getcomposer.org/composer.phar
43
- ```
44
-
45
- Get all dependant packages.
46
- ```
47
- php composer.phar install --no-dev
48
- ```
49
-
26
+ If you wish to contribute to the project, please read the
27
+ [ CONTRIBUTING.md] ( CONTRIBUTING.md ) file.
50
28
51
29
Usage
52
30
============
53
31
54
- Stable Version
55
- ---------
56
-
57
32
Run the phar file with --help to see the available commands:
58
- ```
33
+ ``` sh
59
34
php zs-client.phar --help
60
35
```
61
36
62
- See below for more options.
63
- Notice: When using the stable version remember to use zs-client.phar instead of bin/zs-client.php.
64
-
65
- Development Version
66
- ---------
67
- Run the following, from the directory where this file is located, to see all commands:
68
-
69
- ```
70
- php bin/zs-client.php --help
71
- ```
72
-
73
- If you want to see information about certain command only, then run:
74
-
75
- ```
76
- php bin/zs-client.php <commandName> --help
77
- ```
78
-
79
- Compile
80
- ============
81
- You can pack the source code into one stand-alone file that php can read.
82
- Run the following command to produce the zs-client.phar file.
83
-
84
- ```
85
- php bin/create-phar.php
86
- ```
87
-
88
- The generated file should be saved under bin/zs-client.phar. You can copy it
89
- and use it without the need to have the other PHP files.
90
-
91
37
Use Cases
92
38
============
93
39
@@ -100,7 +46,7 @@ can contain information about the version of Zend Server.
100
46
101
47
To add a target run the following command:
102
48
```
103
- php bin/zs-client.php addTarget --target="<put-here-unique-name>" \
49
+ php bin/zs-client.phar addTarget --target="<put-here-unique-name>" \
104
50
--zskey="<put-here-the-webapi-key-name>" \
105
51
--zssecret="<put-here-the-webapi-key-hash>" \
106
52
--zsurl="<(optional)put-here-valid-url>" \
@@ -110,7 +56,7 @@ To update a target run the command with the same --target value and provide the
110
56
new values.
111
57
112
58
zsurl: if not specified, the value ` http://localhost:10081 ` is used.
113
- zsversion: if not specified, the value ` 6.1 ` is used.
59
+ zsversion: if not specified, the latest Zend Server version will be used.
114
60
115
61
The information about the available targets is saved in the home directory of
116
62
the current user in a file named .zsapi.ini.
@@ -121,7 +67,7 @@ Once a target has been defined, specify it in subsequent commands by adding
121
67
its unique name to the argument list, as in this example:
122
68
123
69
```
124
- php bin/zs-client.php monitorGetIssuesListPredefinedFilter \
70
+ php bin/zs-client.phar monitorGetIssuesListPredefinedFilter \
125
71
--target="<unique-name-from-addTarget-command>" \
126
72
--filterId="Resources Issues"
127
73
```
@@ -136,7 +82,7 @@ Below are the steps that you need to take:
136
82
137
83
### Enable Deployment Support
138
84
```
139
- php bin/zs-client.php initZpk --folder="<folder-where-the-PHP-code-is>"
85
+ php bin/zs-client.phar initZpk --folder="<folder-where-the-PHP-code-is>"
140
86
```
141
87
142
88
This will add two new files in the specified folder: deployment.xml and deployment.properties.
@@ -148,7 +94,7 @@ the XML data to match your application name, version, etc.
148
94
### Create Package
149
95
Run the following command.
150
96
```
151
- php bin/zs-client.php packZpk --folder="<folder-where-the-PHP-code-is>" --destination="<folder-where-the-package-will-be-created>"
97
+ php bin/zs-client.phar packZpk --folder="<folder-where-the-PHP-code-is>" --destination="<folder-where-the-package-will-be-created>"
152
98
```
153
99
It will output the name of the newly created package file. You have to use this name to install
154
100
or update an existing application on Zend Server. If you want to use other name for
@@ -159,7 +105,7 @@ There is experimental integration with composer that allows you to download the
159
105
download them and convert them to zpk files. The above command with composer integration will look like this
160
106
161
107
```
162
- php bin/zs-client.php packZpk --folder="<folder-where-the-PHP-code-is>" \
108
+ php bin/zs-client.phar packZpk --folder="<folder-where-the-PHP-code-is>" \
163
109
--destination="<folder-where-the-package-will-be-created>" \
164
110
--composer
165
111
```
@@ -180,7 +126,7 @@ Example:
180
126
### Deploy Package
181
127
Run the following command to install a package.
182
128
```
183
- php bin/zs-client.php installApp --zpk="<location-of-the-zpk-file>" \
129
+ php bin/zs-client.phar installApp --zpk="<location-of-the-zpk-file>" \
184
130
--target="<the-name-of-the-target>" \
185
131
--baseUri="<baseUri>"
186
132
```
@@ -189,7 +135,7 @@ installation can be passed using --userParams="{provide-params-as-query-string}"
189
135
For example if you want to pass parameter APPLICATION_ENV and DB_TYPE then you can
190
136
use the following
191
137
```
192
- php bin/zs-client.php installApp --zpk="<location-of-the-zpk-file>" \
138
+ php bin/zs-client.phar installApp --zpk="<location-of-the-zpk-file>" \
193
139
--target="<the-name-of-the-target>" \
194
140
--baseUri="<baseUri>" \
195
141
--userParams="APPLICATION_ENV=staging&DB_TYPE=mysql"
@@ -199,12 +145,12 @@ If you use the composer integration then packZpk can create multiple packages, i
199
145
deploy these newly created packages in the correct order.
200
146
201
147
```
202
- ZPKS=`php bin/zs-client.php packZpk --folder="<folder-where-the-PHP-code-is>" \
148
+ ZPKS=`php bin/zs-client.phar packZpk --folder="<folder-where-the-PHP-code-is>" \
203
149
--destination="<folder-where-the-package-will-be-created>" \
204
150
--composer`;
205
151
206
152
for i in $ZPKS; do
207
- php bin/zs-client.php installApp --zpk="$i" \
153
+ php bin/zs-client.phar installApp --zpk="$i" \
208
154
--target="<the-name-of-the-target>" \
209
155
--baseUri="<baseUri>" \
210
156
--userParams="APPLICATION_ENV=staging&DB_TYPE=mysql"
@@ -219,7 +165,7 @@ In some cases we may expect slower communication between the client and the serv
219
165
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.
220
166
221
167
```
222
- php bin/zs-client.php getSystemInfo --target="<name-of-the-target> \
168
+ php bin/zs-client.phar getSystemInfo --target="<name-of-the-target> \
223
169
--http="timeout=40"
224
170
225
171
```
@@ -229,7 +175,7 @@ In most cases the HTTPS access to your Zend Server will use self-signed certific
229
175
In order to instruct the client to accept the SSL certificate you can do the following.
230
176
231
177
```
232
- php bin/zs-client.php getSystemInfo --target="<name-of-the-target> \
178
+ php bin/zs-client.phar getSystemInfo --target="<name-of-the-target> \
233
179
--http="sslverify=0"
234
180
235
181
```
@@ -238,15 +184,15 @@ php bin/zs-client.php getSystemInfo --target="<name-of-the-target> \
238
184
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
239
185
HTTP query string. Request with timeout of 40 seconds and acceptance of self-signed certificates will look like this.
240
186
```
241
- php bin/zs-client.php getSystemInfo --target="<name-of-the-target> \
187
+ php bin/zs-client.phar getSystemInfo --target="<name-of-the-target> \
242
188
--http="timeout=40&sslverify=0"
243
189
```
244
190
245
191
### Persisting the HTTP Options
246
192
If you want to keep the http options saved to a target then when defining or updating the target define also the http parameter.
247
193
Format the value as valid HTTP query string. Take a look at the following example.
248
194
```
249
- php bin/zs-client.php addTarget --target="<name-of-the-target> \
195
+ php bin/zs-client.phar addTarget --target="<name-of-the-target> \
250
196
--zsurl="http://x.y.z" \
251
197
--zskey="admin" \
252
198
--zssecret="<secret-hash>" \
@@ -260,7 +206,7 @@ json and kv(key value). To specify the desired format you have to use the --outp
260
206
261
207
Example:
262
208
```
263
- php bin/zs-client.php getSystemInfo --target=zserver --output-format=kv
209
+ php bin/zs-client.phar getSystemInfo --target=zserver --output-format=kv
264
210
```
265
211
266
212
Will return
0 commit comments