Kaynağa Gözat

send exec query to backend

tags/0.1.0
Robin Thoni 9 yıl önce
ebeveyn
işleme
0fded9b771
2 değiştirilmiş dosya ile 242 ekleme ve 5 silme
  1. 16
    2
      app/Http/Business/CommandsBusiness.php
  2. 226
    3
      composer.lock

+ 16
- 2
app/Http/Business/CommandsBusiness.php Dosyayı Görüntüle

@@ -2,9 +2,15 @@
2 2
 
3 3
 namespace App\Http\Business;
4 4
 
5
+use App\Http\DataAccess\Models\CommandTypes;
6
+use App\Http\DBO\CommandTypesDbo;
7
+use App\Http\DBO\HostsDbo;
8
+use GuzzleHttp\Client;
9
+use GuzzleHttp\Exception\ClientException;
5 10
 use Luticate\Utils\LuBusiness;
6 11
 use App\Http\DataAccess\CommandsDataAccess;
7 12
 use App\Http\DBO\CommandsDbo;
13
+use Luticate\Utils\LuRequest;
8 14
 
9 15
 class CommandsBusiness extends LuBusiness {
10 16
     protected static function getDataAccess()
@@ -51,7 +57,15 @@ class CommandsBusiness extends LuBusiness {
51 57
 
52 58
     public static function exec($command_id)
53 59
     {
54
-        self::getById($command_id);
55
-        return true;
60
+        /**
61
+         * @var $command CommandsDbo
62
+         * @var $host HostsDbo
63
+         * @var $type CommandTypesDbo
64
+         */
65
+        $command = self::getById($command_id);
66
+        $host = HostsBusiness::getById($command->getHostId());
67
+        $type = CommandTypesBusiness::getById($command->getCommandTypeId());
68
+        return LuRequest::proxy('POST', $host->getUrl() . "/commands/exec", [],
69
+            ["command" => $command->__toString(), "type" => $type->__toString()], ["X-Token" => $host->getToken()]);
56 70
     }
57 71
 }

+ 226
- 3
composer.lock Dosyayı Görüntüle

@@ -174,6 +174,177 @@
174 174
             "homepage": "https://github.com/firebase/php-jwt",
175 175
             "time": "2015-06-22 23:26:39"
176 176
         },
177
+        {
178
+            "name": "guzzlehttp/guzzle",
179
+            "version": "6.1.1",
180
+            "source": {
181
+                "type": "git",
182
+                "url": "https://github.com/guzzle/guzzle.git",
183
+                "reference": "c6851d6e48f63b69357cbfa55bca116448140e0c"
184
+            },
185
+            "dist": {
186
+                "type": "zip",
187
+                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/c6851d6e48f63b69357cbfa55bca116448140e0c",
188
+                "reference": "c6851d6e48f63b69357cbfa55bca116448140e0c",
189
+                "shasum": ""
190
+            },
191
+            "require": {
192
+                "guzzlehttp/promises": "~1.0",
193
+                "guzzlehttp/psr7": "~1.1",
194
+                "php": ">=5.5.0"
195
+            },
196
+            "require-dev": {
197
+                "ext-curl": "*",
198
+                "phpunit/phpunit": "~4.0",
199
+                "psr/log": "~1.0"
200
+            },
201
+            "type": "library",
202
+            "extra": {
203
+                "branch-alias": {
204
+                    "dev-master": "6.1-dev"
205
+                }
206
+            },
207
+            "autoload": {
208
+                "files": [
209
+                    "src/functions_include.php"
210
+                ],
211
+                "psr-4": {
212
+                    "GuzzleHttp\\": "src/"
213
+                }
214
+            },
215
+            "notification-url": "https://packagist.org/downloads/",
216
+            "license": [
217
+                "MIT"
218
+            ],
219
+            "authors": [
220
+                {
221
+                    "name": "Michael Dowling",
222
+                    "email": "mtdowling@gmail.com",
223
+                    "homepage": "https://github.com/mtdowling"
224
+                }
225
+            ],
226
+            "description": "Guzzle is a PHP HTTP client library",
227
+            "homepage": "http://guzzlephp.org/",
228
+            "keywords": [
229
+                "client",
230
+                "curl",
231
+                "framework",
232
+                "http",
233
+                "http client",
234
+                "rest",
235
+                "web service"
236
+            ],
237
+            "time": "2015-11-23 00:47:50"
238
+        },
239
+        {
240
+            "name": "guzzlehttp/promises",
241
+            "version": "1.0.3",
242
+            "source": {
243
+                "type": "git",
244
+                "url": "https://github.com/guzzle/promises.git",
245
+                "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea"
246
+            },
247
+            "dist": {
248
+                "type": "zip",
249
+                "url": "https://api.github.com/repos/guzzle/promises/zipball/b1e1c0d55f8083c71eda2c28c12a228d708294ea",
250
+                "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea",
251
+                "shasum": ""
252
+            },
253
+            "require": {
254
+                "php": ">=5.5.0"
255
+            },
256
+            "require-dev": {
257
+                "phpunit/phpunit": "~4.0"
258
+            },
259
+            "type": "library",
260
+            "extra": {
261
+                "branch-alias": {
262
+                    "dev-master": "1.0-dev"
263
+                }
264
+            },
265
+            "autoload": {
266
+                "psr-4": {
267
+                    "GuzzleHttp\\Promise\\": "src/"
268
+                },
269
+                "files": [
270
+                    "src/functions_include.php"
271
+                ]
272
+            },
273
+            "notification-url": "https://packagist.org/downloads/",
274
+            "license": [
275
+                "MIT"
276
+            ],
277
+            "authors": [
278
+                {
279
+                    "name": "Michael Dowling",
280
+                    "email": "mtdowling@gmail.com",
281
+                    "homepage": "https://github.com/mtdowling"
282
+                }
283
+            ],
284
+            "description": "Guzzle promises library",
285
+            "keywords": [
286
+                "promise"
287
+            ],
288
+            "time": "2015-10-15 22:28:00"
289
+        },
290
+        {
291
+            "name": "guzzlehttp/psr7",
292
+            "version": "1.2.1",
293
+            "source": {
294
+                "type": "git",
295
+                "url": "https://github.com/guzzle/psr7.git",
296
+                "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982"
297
+            },
298
+            "dist": {
299
+                "type": "zip",
300
+                "url": "https://api.github.com/repos/guzzle/psr7/zipball/4d0bdbe1206df7440219ce14c972aa57cc5e4982",
301
+                "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982",
302
+                "shasum": ""
303
+            },
304
+            "require": {
305
+                "php": ">=5.4.0",
306
+                "psr/http-message": "~1.0"
307
+            },
308
+            "provide": {
309
+                "psr/http-message-implementation": "1.0"
310
+            },
311
+            "require-dev": {
312
+                "phpunit/phpunit": "~4.0"
313
+            },
314
+            "type": "library",
315
+            "extra": {
316
+                "branch-alias": {
317
+                    "dev-master": "1.0-dev"
318
+                }
319
+            },
320
+            "autoload": {
321
+                "psr-4": {
322
+                    "GuzzleHttp\\Psr7\\": "src/"
323
+                },
324
+                "files": [
325
+                    "src/functions_include.php"
326
+                ]
327
+            },
328
+            "notification-url": "https://packagist.org/downloads/",
329
+            "license": [
330
+                "MIT"
331
+            ],
332
+            "authors": [
333
+                {
334
+                    "name": "Michael Dowling",
335
+                    "email": "mtdowling@gmail.com",
336
+                    "homepage": "https://github.com/mtdowling"
337
+                }
338
+            ],
339
+            "description": "PSR-7 message implementation",
340
+            "keywords": [
341
+                "http",
342
+                "message",
343
+                "stream",
344
+                "uri"
345
+            ],
346
+            "time": "2015-11-03 01:34:55"
347
+        },
177 348
         {
178 349
             "name": "illuminate/auth",
179 350
             "version": "v5.1.22",
@@ -1397,11 +1568,14 @@
1397 1568
         },
1398 1569
         {
1399 1570
             "name": "luticate/utils",
1400
-            "version": "0.1.1",
1571
+            "version": "0.1.2",
1401 1572
             "source": {
1402 1573
                 "type": "git",
1403 1574
                 "url": "https://git.rthoni.com/luticate/utils.git",
1404
-                "reference": "8965564e6a6b329918ba7e4e9ebcfc9e98f71edc"
1575
+                "reference": "778e4ca0797cdc4691dcdbba9000050f7d9f7e32"
1576
+            },
1577
+            "require": {
1578
+                "guzzlehttp/guzzle": "^6.1"
1405 1579
             },
1406 1580
             "type": "library",
1407 1581
             "autoload": {
@@ -1416,7 +1590,7 @@
1416 1590
                 }
1417 1591
             ],
1418 1592
             "description": "Luticate user management system utils",
1419
-            "time": "2015-11-12 14:55:00"
1593
+            "time": "2015-11-23 23:27:20"
1420 1594
         },
1421 1595
         {
1422 1596
             "name": "monolog/monolog",
@@ -1677,6 +1851,55 @@
1677 1851
             ],
1678 1852
             "time": "2015-11-10 00:45:41"
1679 1853
         },
1854
+        {
1855
+            "name": "psr/http-message",
1856
+            "version": "1.0",
1857
+            "source": {
1858
+                "type": "git",
1859
+                "url": "https://github.com/php-fig/http-message.git",
1860
+                "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298"
1861
+            },
1862
+            "dist": {
1863
+                "type": "zip",
1864
+                "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298",
1865
+                "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298",
1866
+                "shasum": ""
1867
+            },
1868
+            "require": {
1869
+                "php": ">=5.3.0"
1870
+            },
1871
+            "type": "library",
1872
+            "extra": {
1873
+                "branch-alias": {
1874
+                    "dev-master": "1.0.x-dev"
1875
+                }
1876
+            },
1877
+            "autoload": {
1878
+                "psr-4": {
1879
+                    "Psr\\Http\\Message\\": "src/"
1880
+                }
1881
+            },
1882
+            "notification-url": "https://packagist.org/downloads/",
1883
+            "license": [
1884
+                "MIT"
1885
+            ],
1886
+            "authors": [
1887
+                {
1888
+                    "name": "PHP-FIG",
1889
+                    "homepage": "http://www.php-fig.org/"
1890
+                }
1891
+            ],
1892
+            "description": "Common interface for HTTP messages",
1893
+            "keywords": [
1894
+                "http",
1895
+                "http-message",
1896
+                "psr",
1897
+                "psr-7",
1898
+                "request",
1899
+                "response"
1900
+            ],
1901
+            "time": "2015-05-04 20:22:00"
1902
+        },
1680 1903
         {
1681 1904
             "name": "psr/log",
1682 1905
             "version": "1.0.0",

Loading…
İptal
Kaydet