Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' of git://github.com/zendframework/zf2 into string
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-mabe committed Jul 7, 2012
14 parents 51601cb + dcc1eaf + 6f4b805 + a30a64f + ea67c13 + 44df0b2 + 38e090d + 7af74e7 + 8b311b1 + e2c2b94 + ee7347d + 8b04bfe + b487f00 + ecdfdf6 commit b3fbd9c
Show file tree
Hide file tree
Showing 46 changed files with 292 additions and 573 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

14 changes: 0 additions & 14 deletions .travis/run-tests.sh

This file was deleted.

7 changes: 0 additions & 7 deletions .travis/skipped-components

This file was deleted.

61 changes: 0 additions & 61 deletions .travis/tested-components

This file was deleted.

6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zendframework/zend-log",
"description": "Zend\\Log component",
"description": "component for general purpose logging",
"license": "BSD-3-Clause",
"keywords": [
"zf2",
Expand All @@ -10,11 +10,11 @@
"homepage": "https://github.com/zendframework/zend-log",
"autoload": {
"psr-4": {
"Zend\\Log\\": "src/"
"Zend\\Log": "src/"
}
},
"require": {
"php": ">=5.3.23",
"php": ">=5.3.3",
"zendframework/zend-servicemanager": "self.version",
"zendframework/zend-stdlib": "self.version"
},
Expand Down
30 changes: 0 additions & 30 deletions src/Exception.php

This file was deleted.

38 changes: 0 additions & 38 deletions src/Filter.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/Filter/Priority.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Priority implements FilterInterface
*
* @param int $priority Priority
* @param string $operator Comparison operator
* @return void
* @return Priority
* @throws Exception\InvalidArgumentException
*/
public function __construct($priority, $operator = null)
Expand Down
4 changes: 1 addition & 3 deletions src/Filter/Regex.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/**
* @namespace
*/
namespace Zend\Log\Filter;

use Zend\Log\Exception;
Expand All @@ -46,6 +43,7 @@ class Regex implements FilterInterface
* Filter out any log messages not matching the pattern
*
* @param string $regex Regular expression to test the log message
* @return Regex
* @throws Exception\InvalidArgumentException
*/
public function __construct($regex)
Expand Down
7 changes: 4 additions & 3 deletions src/Filter/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

namespace Zend\Log\Filter;

use Zend\Log\Exception,
Zend\Validator\ValidatorInterface as ZendValidator;
use Zend\Log\Exception;
use Zend\Validator\ValidatorInterface as ZendValidator;

/**
* @category Zend
Expand All @@ -43,7 +43,8 @@ class Validator implements FilterInterface
/**
* Filter out any log messages not matching the validator
*
* @param ZendValidator $validator
* @param ZendValidator $validator
* @return Validator
*/
public function __construct(ZendValidator $validator)
{
Expand Down
38 changes: 0 additions & 38 deletions src/Formatter.php

This file was deleted.

8 changes: 3 additions & 5 deletions src/Formatter/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/**
* @namespace
*/
namespace Zend\Log\Formatter;

use Zend\Log\Exception;
Expand All @@ -47,8 +44,9 @@ class ErrorHandler implements FormatterInterface
/**
* Class constructor
*
* @param null|string $format Format specifier for log messages
* @throws Zend\Log\Exception\InvalidArgumentException
* @param null|string $format Format specifier for log messages
* @return ErrorHandler
* @throws Exception\InvalidArgumentException
*/
public function __construct($format = null)
{
Expand Down
33 changes: 17 additions & 16 deletions src/Formatter/ExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/**
* @namespace
*/
namespace Zend\Log\Formatter;

/**
Expand All @@ -36,35 +33,39 @@ class ExceptionHandler implements FormatterInterface
/**
* This method formats the event for the PHP Exception
*
* @param array $event
* @param array $event
* @return string
*/
public function format($event)
{
$output = $event['timestamp'] . ' ' . $event['priorityName'] . ' (' .
$event['priority'] . ') ' . $event['message'] .' in ' .
$event['extra']['file'] . ' on line ' . $event['extra']['line'];
$output = $event['timestamp'] . ' ' . $event['priorityName'] . ' ('
. $event['priority'] . ') ' . $event['message'] .' in '
. $event['extra']['file'] . ' on line ' . $event['extra']['line'];

if (!empty($event['extra']['trace'])) {
$outputTrace = '';
foreach ($event['extra']['trace'] as $trace) {
$outputTrace .= "File : {$trace['file']}\n" .
"Line : {$trace['line']}\n" .
"Func : {$trace['function']}\n" .
"Class : {$trace['class']}\n" .
"Type : " . $this->getType($trace['type']) . "\n" .
"Args : " . print_r($trace['args'], true) . "\n";
$outputTrace .= "File : {$trace['file']}\n"
. "Line : {$trace['line']}\n"
. "Func : {$trace['function']}\n"
. "Class : {$trace['class']}\n"
. "Type : " . $this->getType($trace['type']) . "\n"
. "Args : " . print_r($trace['args'], true) . "\n";
}
$output.= "\n[Trace]\n" . $outputTrace;
$output .= "\n[Trace]\n" . $outputTrace;
}

return $output;
}

/**
* Get the type of a function
*
* @param string $type
* @param string $type
* @return string
*/
protected function getType($type) {
protected function getType($type)
{
switch ($type) {
case "::" :
return "static";
Expand Down
4 changes: 2 additions & 2 deletions src/Formatter/FormatterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ interface FormatterInterface
/**
* Formats data into a single line to be written by the writer.
*
* @param array $event event data
* @return string formatted line to write to the log
* @param array $event event data
* @return string formatted line to write to the log
*/
public function format($event);
}
Loading

0 comments on commit b3fbd9c

Please sign in to comment.