Skip to content

Commit b0885a7

Browse files
author
Dmitry Tarasov
committed
Replace stubs for Exec transport
1 parent fc30c0e commit b0885a7

2 files changed

Lines changed: 6 additions & 11 deletions

File tree

run/standalone.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
require '../vendor/autoload.php';
44

55
//$transport = null;
6-
$transport = new Stackify\Log\Transport\CurlTransport('0Zw8Fj4Hr3Aa1Sf2Gw4Cb3Gk7Fp6Zn6Sc0Gw2Cr');
6+
$transport = new Stackify\Log\Transport\ExecTransport('0Zw8Fj4Hr3Aa1Sf2Gw4Cb3Gk7Fp6Zn6Sc0Gw2Cr', ['debug' => 1]);
77
$logger = new Stackify\Log\Standalone\Logger('test.com', 'myPC', $transport);
88

99
session_start();
1010
$_SESSION['user_id'] = 42;
1111

1212
try {
13-
include 'exception.php';
13+
//include 'exception.php';
1414
} catch (Exception $ex) {
1515
$logger->warning('test', ['exception' => $ex, 'a' => 'b']);
1616
}
1717

18-
$logger->info('mess\'age');
19-
$logger->alert('test');
18+
$logger->info('message');
19+
//$logger->alert('test');

src/Stackify/Log/Transport/ExecTransport.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Stackify\Log\Transport;
44

55
use Stackify\Log\Transport\Config\Api;
6-
use Stackify\Exceptions\InitializationException;
76

87
/**
98
* This transport collects log data until the end of processing.
@@ -20,9 +19,7 @@ class ExecTransport extends AbstractApiTransport
2019
public function __construct($apiKey, array $options = array())
2120
{
2221
parent::__construct($apiKey, $options);
23-
if ('Windows' === substr(php_uname(), 0, 7)) {
24-
throw new InitializationException('CurlTransport does not work on Windows');
25-
}
22+
// @TODO windows support
2623
}
2724

2825
protected function getAllowedOptions()
@@ -39,9 +36,7 @@ protected function getTransportName()
3936

4037
protected function send($data)
4138
{
42-
echo $data;
43-
// @TODO
44-
$url = Api::API_BASE_URL;
39+
$url = Api::API_BASE_URL . Api::API_CALL_LOGS;
4540
$cmd = "$this->curlPath -X POST";
4641
foreach ($this->getApiHeaders() as $name => $value) {
4742
$cmd .= " --header \"$name: $value\"";

0 commit comments

Comments
 (0)