12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
- defined('YII_DEBUG') or define('YII_DEBUG', true);
- defined('YII_ENV') or define('YII_ENV', 'dev');
- require 'api/vendor/autoload.php';
- require 'api/vendor/yiisoft/yii2/Yii.php';
- $config = require 'api/config/web.php';
- (new yii\web\Application($config));
- $res = new app\models\LocomotiveModel();
- $locomotiveModel = new app\models\LocomotiveModel();
- $locomotiveModel->project_id = '1151';
- $time = $locomotiveModel->milliseconds();
- $time = explode(' ', microtime())[1];
- $params =array();
- $params['sld'] = '95d7646d-e7ee-11e4-829d-00155d6cab05';
- $start = $_REQUEST['start'];
- $end = $_REQUEST['end'];
- if (!$start)
- $start = '1';
- if (!$end)
- $end = '100';
- $params['start'] = $start;
- $params['end'] = $end;
- TWXrequest($params);
- function TWXrequest($params)
- {
-
-
- $url = "http://qaplatform.digitaldepot.ru:8085/Thingworx/Things/connSmoppLibrary/Services/get_workers";
- $jsonEncoded = json_encode($params);
- $curl = curl_init();
- curl_setopt($curl, CURLOPT_URL, $url);
- curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "AppKey: 33cd23bb-3b03-4638-afef-7104a13e9211", "Accept:application/json"));
- curl_setopt($curl, CURLOPT_TIMEOUT, 600);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($curl, CURLOPT_POST, 1);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $jsonEncoded);
- curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
- $result = curl_exec($curl);
- var_dump($result);
- }
|