This repository has been archived by the owner on Dec 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ability to customize services (logger, client) via json config file
- Loading branch information
Showing
10 changed files
with
231 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ | |
], | ||
"plugins": [ | ||
], | ||
"analysers" : [ | ||
"analysers": [ | ||
], | ||
"services": [ | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace Bartlett\Tests\Reflect\Environment; | ||
|
||
use Monolog\Logger; | ||
use Monolog\Handler\RotatingFileHandler; | ||
|
||
class YourLogger extends Logger | ||
{ | ||
public function __construct($name = 'DEV') | ||
{ | ||
$tempDir = sys_get_temp_dir() . '/bartlett/logs'; | ||
|
||
if (!file_exists($tempDir)) { | ||
mkdir($tempDir, 0755, true); | ||
} | ||
$filename = sprintf('phpreflect-%s.log', date('Ymd')); | ||
|
||
$stream = new RotatingFileHandler("$tempDir/$filename", 30); | ||
$stream->setFilenameFormat('{filename}-{date}', 'Ymd'); | ||
|
||
$handlers = array($stream); | ||
|
||
parent::__construct($name, $handlers); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"source-providers": [ | ||
{ | ||
"in": ". as current", | ||
"name": "/\\.(php|inc|phtml)$/" | ||
} | ||
], | ||
"plugins": [ | ||
], | ||
"analysers": [ | ||
], | ||
"services": [ | ||
{ | ||
"logger": "Bartlett\\Tests\\Reflect\\Environment\\YourLogger" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters