-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mirko Fenrich
committed
Jun 16, 2017
1 parent
b1f8e14
commit 7cb51e4
Showing
5 changed files
with
115 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
|
||
namespace Depa\Logger; | ||
|
||
|
||
use Zend\Log\PsrLoggerAdapter; | ||
|
||
/** | ||
* The configuration provider for the Core module | ||
* | ||
* @see https://docs.zendframework.com/zend-component-installer/ | ||
*/ | ||
class ConfigProvider | ||
{ | ||
/** | ||
* Returns the configuration array | ||
* | ||
* To add a bit of a structure, each section is defined in a separate | ||
* method which returns an array with its configuration. | ||
* | ||
* @return array | ||
*/ | ||
public function __invoke() | ||
{ | ||
return [ | ||
'dependencies' => $this->getDependencies(), | ||
'templates' => $this->getTemplates(), | ||
]; | ||
} | ||
|
||
/** | ||
* Returns the container dependencies | ||
* | ||
* @return array | ||
*/ | ||
public function getDependencies() | ||
{ | ||
return [ | ||
'invokables' => [ | ||
], | ||
'factories' => [ | ||
LoggerMiddleware::class => LoggerMiddlewareFactory::class, | ||
|
||
], | ||
]; | ||
} | ||
|
||
/** | ||
* Returns the templates configuration | ||
* | ||
* @return array | ||
*/ | ||
public function getTemplates() | ||
{ | ||
return [ | ||
'paths' => [ | ||
'app' => [__DIR__ . '/../templates/app'], | ||
'error' => [__DIR__ . '/../templates/error'], | ||
'layout' => [__DIR__ . '/../templates/layout'], | ||
], | ||
]; | ||
} | ||
} |
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 @@ | ||
<?php | ||
namespace Depa\Logger; | ||
|
||
use Psr\Log\LoggerInterface; | ||
|
||
class Logger{ | ||
|
||
public $logger; | ||
|
||
public function __construct(LoggerInterface $logger) | ||
{ | ||
$this->logger = $logger; | ||
} | ||
|
||
|
||
|
||
} |
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,16 @@ | ||
<?php | ||
namespace Depa\Logger\Logger; | ||
|
||
use Zend\Log\Logger; | ||
use Zend\Log\PsrLoggerAdapter; | ||
|
||
class ChromePhpLogger | ||
{ | ||
public function __construct() | ||
{ | ||
$logger = new Logger(); | ||
$logger->addWriter(new \Zend\Log\Writer\ChromePHP()); | ||
$PsrLogger = new PsrLoggerAdapter($logger); | ||
return ($PsrLogger); | ||
} | ||
} |
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,16 @@ | ||
<?php | ||
namespace Depa\Logger\Logger; | ||
|
||
use Zend\Log\Logger; | ||
use Zend\Log\PsrLoggerAdapter; | ||
|
||
class NullLogger | ||
{ | ||
public function __construct() | ||
{ | ||
$logger = new Logger(); | ||
$logger->addWriter(new \Zend\Log\Writer\Noop()); | ||
$PsrLogger = new PsrLoggerAdapter($logger); | ||
return ($PsrLogger); | ||
} | ||
} |
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