Skip to content

Commit

Permalink
Added example exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
bkrukowski committed Sep 27, 2018
1 parent fbfc9e9 commit dee7474
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/bin export-ignore
/dev-tools export-ignore
/example-exporter export-ignore
/optimizer export-ignore
/tests export-ignore
/dev-tools export-ignore
Expand Down
2 changes: 2 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . DIRECTORY_SEPARATOR . 'bin')
->in(__DIR__ . DIRECTORY_SEPARATOR . 'example-exporter')
->in(__DIR__ . DIRECTORY_SEPARATOR . 'optimizer')
->in(__DIR__ . DIRECTORY_SEPARATOR . 'src')
->in(__DIR__ . DIRECTORY_SEPARATOR . 'tests')
->exclude('vendor')
;

$header = <<<'HEADER'
Expand Down
3 changes: 3 additions & 0 deletions example-exporter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!.gitignore
!exporter.php
35 changes: 35 additions & 0 deletions example-exporter/exporter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env php
<?php

/*
* This file is part of the awesomite/error-dumper package.
*
* (c) Bartłomiej Krukowski <bartlomiej@krukowski.me>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use GuzzleHttp\Client as Guzzle;

require \implode(\DIRECTORY_SEPARATOR, array(__DIR__, 'vendor', 'autoload.php'));


$guzzle = new Guzzle();
$response = $guzzle->get(
'http://localhost:8001/exceptionChain',
array(
'http_errors' => false,
'headers' => array(
'Host' => 'example.awesomite.local',
),
)
);

$html = \str_replace(
\realpath(__DIR__ . \DIRECTORY_SEPARATOR . '..'),
'(...)',
(string)$response->getBody()
);

\file_put_contents('example.html', $html);

0 comments on commit dee7474

Please sign in to comment.