Merge branch 'master' of https://github.com/thelia/thelia into install_wizard

# By Manuel Raynaud (19) and others
# Via Manuel Raynaud (7) and others
* 'master' of https://github.com/thelia/thelia: (29 commits)
  feed loop is now countable
  Change error page design
  Add validation button on form
  - Edit country view creation - Delete and edit modalbox creation - Countries routes management
  Completed template management
  fix faker
  fix faker script
  Working : Fixture : cleaning
  debugbar log query also use Tlog
  update CartAdd form
  Working : Fixture : cleaning
  Working : Coupon : Fix unit tests @todo refactor
  force charset in sql files
  Countries view and routing creation
  save if producSaleElements is in promo or not
  Finished Features management
  add promo column in cart_item
  dispatch event when default currency change
  add return statement in clear cache method
  create cache for config entity
  ...
This commit is contained in:
gmorel
2013-09-16 15:08:09 +02:00
81 changed files with 5791 additions and 1576 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -40,7 +40,9 @@ class PropelCollector extends DataCollector implements Renderable, LoggerInterfa
protected $peakMemory = 0;
public function __construct()
protected $alternativeLogger;
public function __construct(LoggerInterface $alternativeLogger = null)
{
$serviceContainer = Propel::getServiceContainer();
$serviceContainer->setLogger('defaultLogger', $this);
@@ -54,6 +56,8 @@ class PropelCollector extends DataCollector implements Renderable, LoggerInterfa
'commit',
'rollBack',
));
$this->alternativeLogger = $alternativeLogger;
}
/**
@@ -118,6 +122,10 @@ class PropelCollector extends DataCollector implements Renderable, LoggerInterfa
list($sql, $duration_str) = $this->parseAndLogSqlQuery($message);
$message = "$sql ($duration_str)";
if ($this->alternativeLogger) {
$this->alternativeLogger->log($level, $message);
}
}
/**
@@ -172,7 +180,7 @@ class PropelCollector extends DataCollector implements Renderable, LoggerInterfa
*/
public function emergency($message, array $context = array())
{
$this->log(null, $message, $context);
$this->log(\Thelia\Log\Tlog::EMERGENCY, $message, $context);
}
/**
@@ -187,7 +195,7 @@ class PropelCollector extends DataCollector implements Renderable, LoggerInterfa
*/
public function alert($message, array $context = array())
{
$this->log(null, $message, $context);
$this->log(\Thelia\Log\Tlog::ALERT, $message, $context);
}
/**
@@ -201,7 +209,7 @@ class PropelCollector extends DataCollector implements Renderable, LoggerInterfa
*/
public function critical($message, array $context = array())
{
$this->log(null, $message, $context);
$this->log(\Thelia\Log\Tlog::CRITICAL, $message, $context);
}
/**
@@ -214,7 +222,7 @@ class PropelCollector extends DataCollector implements Renderable, LoggerInterfa
*/
public function error($message, array $context = array())
{
$this->log(null, $message, $context);
$this->log(\Thelia\Log\Tlog::ERROR, $message, $context);
}
/**
@@ -229,7 +237,7 @@ class PropelCollector extends DataCollector implements Renderable, LoggerInterfa
*/
public function warning($message, array $context = array())
{
$this->log(null, $message, $context);
$this->log(\Thelia\Log\Tlog::WARNING, $message, $context);
}
/**
@@ -241,7 +249,7 @@ class PropelCollector extends DataCollector implements Renderable, LoggerInterfa
*/
public function notice($message, array $context = array())
{
$this->log(null, $message, $context);
$this->log(\Thelia\Log\Tlog::NOTICE, $message, $context);
}
/**
@@ -255,7 +263,7 @@ class PropelCollector extends DataCollector implements Renderable, LoggerInterfa
*/
public function info($message, array $context = array())
{
$this->log(null, $message, $context);
$this->log(\Thelia\Log\Tlog::INFO, $message, $context);
}
/**
@@ -267,7 +275,7 @@ class PropelCollector extends DataCollector implements Renderable, LoggerInterfa
*/
public function debug($message, array $context = array())
{
$this->log(null, $message, $context);
$this->log(\Thelia\Log\Tlog::DEBUG, $message, $context);
}

View File

@@ -50,7 +50,7 @@ class DebugBarListeners extends BaseAction implements EventSubscriberInterface {
//$debugBar->addCollector(new RequestDataCollector());
$debugBar->addCollector(new TimeDataCollector());
$debugBar->addCollector(new MemoryCollector());
$debugBar->addCollector(new PropelCollector());
$debugBar->addCollector(new PropelCollector(\Thelia\Log\Tlog::getInstance()));
}
/**