-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWebApi-BootstrapSingleServer.php
40 lines (31 loc) · 1.37 KB
/
WebApi-BootstrapSingleServer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
require_once 'bootstrap.php';
$userAgent = 'Zend Server Development';
$date = gmdate('D, d M Y H:i:s') . ' GMT';
$uri = Zend_Uri::factory('http://yonni-desktop:10081/ZendServer/Api/bootstrapSingleServer');
/**
* The following variable should hold the same preshared key of the server set in
* zend-server-user.ini under zendServer\apiKey
*/
$client = new Zend_Http_Client();
$client
->setUri($uri)
->setHeaders(array(
'User-Agent' => $userAgent,
'Date' => $date,
'Accept' => 'application/vnd.zend.serverapi+json;version=1.7'
));
$client->setParameterPost('adminPassword', '1234');
$client->setParameterPost('orderNumber', 'pe');
$client->setParameterPost('licenseKey', 'D5127010001G21DD07DE791B619D7EA3');
$client->setParameterPost('production', 'TRUE');
// $client->setParameterPost('dontWait', 'TRUE');
// $client->setCookie('debug_host', '10.1.2.174');
// $client->setCookie('debug_port', '10137');
// $client->setCookie('_bm', '2897');
// $client->setCookie('debug_session_id', rand(3000, 1000000));
// $client->setCookie('ZDEDebuggerPresent', 'php%2Cphtml%2Cphp3');
$client->setConfig(array('timeout' => 60));
$response = $client->request(Zend_Http_Client::POST);
echo cleaning(nl2br(htmlentities($response->getBody())));
echo cleaning(nl2br(htmlentities(print_r($response->getHeaders(),true))));