update 1.0.8.0

Commits for version update
This commit is contained in:
Manish Verma
2016-10-17 12:02:27 +05:30
parent dec927987b
commit 76e85db070
9674 changed files with 495757 additions and 58922 deletions

View File

@@ -100,6 +100,9 @@ class AggregatedCollector implements DataCollectorInterface, ArrayAccess
return $this->sort;
}
/**
* @return array
*/
public function collect()
{
$aggregate = array();
@@ -136,6 +139,9 @@ class AggregatedCollector implements DataCollectorInterface, ArrayAccess
return $data;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
@@ -144,21 +150,38 @@ class AggregatedCollector implements DataCollectorInterface, ArrayAccess
// --------------------------------------------
// ArrayAccess implementation
/**
* @param mixed $key
* @param mixed $value
* @throws DebugBarException
*/
public function offsetSet($key, $value)
{
throw new DebugBarException("AggregatedCollector[] is read-only");
}
/**
* @param mixed $key
* @return mixed
*/
public function offsetGet($key)
{
return $this->collectors[$key];
}
/**
* @param mixed $key
* @return bool
*/
public function offsetExists($key)
{
return isset($this->collectors[$key]);
}
/**
* @param mixed $key
* @throws DebugBarException
*/
public function offsetUnset($key)
{
throw new DebugBarException("AggregatedCollector[] is read-only");

View File

@@ -39,6 +39,9 @@ class ConfigCollector extends DataCollector implements Renderable
$this->data = $data;
}
/**
* @return array
*/
public function collect()
{
$data = array();
@@ -51,11 +54,17 @@ class ConfigCollector extends DataCollector implements Renderable
return $data;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @return array
*/
public function getWidgets()
{
$name = $this->getName();

View File

@@ -49,6 +49,7 @@ abstract class DataCollector implements DataCollectorInterface
* Sets the data formater instance used by this collector
*
* @param DataFormatterInterface $formater
* @return $this
*/
public function setDataFormatter(DataFormatterInterface $formater)
{
@@ -56,6 +57,9 @@ abstract class DataCollector implements DataCollectorInterface
return $this;
}
/**
* @return DataFormatterInterface
*/
public function getDataFormatter()
{
if ($this->dataFormater === null) {

View File

@@ -88,11 +88,17 @@ class ExceptionsCollector extends DataCollector implements Renderable
);
}
/**
* @return string
*/
public function getName()
{
return 'exceptions';
}
/**
* @return array
*/
public function getWidgets()
{
return array(

View File

@@ -35,6 +35,9 @@ class LocalizationCollector extends DataCollector implements Renderable
return textdomain();
}
/**
* @return array
*/
public function collect()
{
return array(
@@ -43,11 +46,17 @@ class LocalizationCollector extends DataCollector implements Renderable
);
}
/**
* @return string
*/
public function getName()
{
return 'localization';
}
/**
* @return array
*/
public function getWidgets()
{
return array(

View File

@@ -35,6 +35,9 @@ class MemoryCollector extends DataCollector implements Renderable
$this->peakUsage = memory_get_peak_usage(true);
}
/**
* @return array
*/
public function collect()
{
$this->updatePeakUsage();
@@ -44,11 +47,17 @@ class MemoryCollector extends DataCollector implements Renderable
);
}
/**
* @return string
*/
public function getName()
{
return 'memory';
}
/**
* @return array
*/
public function getWidgets()
{
return array(

View File

@@ -38,6 +38,7 @@ class MessagesCollector extends AbstractLogger implements DataCollectorInterface
* Sets the data formater instance used by this collector
*
* @param DataFormatterInterface $formater
* @return $this
*/
public function setDataFormatter(DataFormatterInterface $formater)
{
@@ -45,6 +46,9 @@ class MessagesCollector extends AbstractLogger implements DataCollectorInterface
return $this;
}
/**
* @return DataFormatterInterface
*/
public function getDataFormatter()
{
if ($this->dataFormater === null) {
@@ -85,6 +89,9 @@ class MessagesCollector extends AbstractLogger implements DataCollectorInterface
$this->aggregates[] = $messages;
}
/**
* @return array
*/
public function getMessages()
{
$messages = $this->messages;
@@ -107,6 +114,11 @@ class MessagesCollector extends AbstractLogger implements DataCollectorInterface
return $messages;
}
/**
* @param $level
* @param $message
* @param array $context
*/
public function log($level, $message, array $context = array())
{
$this->addMessage($message, $level);
@@ -120,6 +132,9 @@ class MessagesCollector extends AbstractLogger implements DataCollectorInterface
$this->messages = array();
}
/**
* @return array
*/
public function collect()
{
$messages = $this->getMessages();
@@ -129,11 +144,17 @@ class MessagesCollector extends AbstractLogger implements DataCollectorInterface
);
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @return array
*/
public function getWidgets()
{
$name = $this->getName();

View File

@@ -43,11 +43,17 @@ class PDOCollector extends DataCollector implements Renderable, AssetProvider
$this->sqlQuotationChar = $quotationChar;
}
/**
* @return bool
*/
public function isSqlRenderedWithParams()
{
return $this->renderSqlWithParams;
}
/**
* @return string
*/
public function getSqlQuotationChar()
{
return $this->sqlQuotationChar;
@@ -77,6 +83,9 @@ class PDOCollector extends DataCollector implements Renderable, AssetProvider
return $this->connections;
}
/**
* @return array
*/
public function collect()
{
$data = array(
@@ -151,11 +160,17 @@ class PDOCollector extends DataCollector implements Renderable, AssetProvider
);
}
/**
* @return string
*/
public function getName()
{
return 'pdo';
}
/**
* @return array
*/
public function getWidgets()
{
return array(
@@ -172,6 +187,9 @@ class PDOCollector extends DataCollector implements Renderable, AssetProvider
);
}
/**
* @return array
*/
public function getAssets()
{
return array(

View File

@@ -179,16 +179,29 @@ class TraceablePDO extends PDO
return array_filter($this->executedStatements, function ($s) { return !$s->isSuccess(); });
}
/**
* @param $name
* @return mixed
*/
public function __get($name)
{
return $this->pdo->$name;
}
/**
* @param $name
* @param $value
*/
public function __set($name, $value)
{
$this->pdo->$name = $value;
}
/**
* @param $name
* @param $args
* @return mixed
*/
public function __call($name, $args)
{
return call_user_func_array(array($this->pdo, $name), $args);

View File

@@ -15,11 +15,23 @@ class TraceablePDOStatement extends PDOStatement
protected $boundParameters = array();
/**
* TraceablePDOStatement constructor.
* @param TraceablePDO $pdo
*/
protected function __construct(TraceablePDO $pdo)
{
$this->pdo = $pdo;
}
/**
* @param mixed $column
* @param mixed $param
* @param null $type
* @param null $maxlen
* @param null $driverdata
* @return mixed
*/
public function bindColumn($column, &$param, $type = null, $maxlen = null, $driverdata = null)
{
$this->boundParameters[$column] = $param;
@@ -27,6 +39,14 @@ class TraceablePDOStatement extends PDOStatement
return call_user_func_array(array("parent", 'bindColumn'), $args);
}
/**
* @param mixed $param
* @param mixed $var
* @param int $data_type
* @param null $length
* @param null $driver_options
* @return mixed
*/
public function bindParam($param, &$var, $data_type = PDO::PARAM_STR, $length = null, $driver_options = null)
{
$this->boundParameters[$param] = $var;
@@ -34,12 +54,23 @@ class TraceablePDOStatement extends PDOStatement
return call_user_func_array(array("parent", 'bindParam'), $args);
}
/**
* @param mixed $param
* @param mixed $value
* @param int $data_type
* @return mixed
*/
public function bindValue($param, $value, $data_type = PDO::PARAM_STR)
{
$this->boundParameters[$param] = $value;
return call_user_func_array(array("parent", 'bindValue'), func_get_args());
}
/**
* @param null $params
* @return bool
* @throws null
*/
public function execute($params = null)
{
$preparedId = spl_object_hash($this);

View File

@@ -31,11 +31,6 @@ class TracedStatement
* @param string $sql
* @param array $params
* @param string $preparedId
* @param integer $rowCount
* @param integer $startTime
* @param integer $endTime
* @param integer $memoryUsage
* @param \Exception $e
*/
public function __construct($sql, array $params = array(), $preparedId = null)
{
@@ -44,12 +39,22 @@ class TracedStatement
$this->preparedId = $preparedId;
}
/**
* @param null $startTime
* @param null $startMemory
*/
public function start($startTime = null, $startMemory = null)
{
$this->startTime = $startTime ?: microtime(true);
$this->startMemory = $startMemory ?: memory_get_usage(true);
}
/**
* @param \Exception|null $exception
* @param int $rowCount
* @param null $endTime
* @param null $endMemory
*/
public function end(\Exception $exception = null, $rowCount = 0, $endTime = null, $endMemory = null)
{
$this->endTime = $endTime ?: microtime(true);
@@ -158,11 +163,17 @@ class TracedStatement
return $this->preparedId !== null;
}
/**
* @return mixed
*/
public function getStartTime()
{
return $this->startTime;
}
/**
* @return mixed
*/
public function getEndTime()
{
return $this->endTime;
@@ -178,11 +189,17 @@ class TracedStatement
return $this->duration;
}
/**
* @return mixed
*/
public function getStartMemory()
{
return $this->startMemory;
}
/**
* @return mixed
*/
public function getEndMemory()
{
return $this->endMemory;

View File

@@ -15,6 +15,9 @@ namespace DebugBar\DataCollector;
*/
class PhpInfoCollector extends DataCollector
{
/**
* @return array
*/
public function collect()
{
return array(
@@ -23,6 +26,9 @@ class PhpInfoCollector extends DataCollector
);
}
/**
* @return string
*/
public function getName()
{
return 'php';

View File

@@ -15,6 +15,9 @@ namespace DebugBar\DataCollector;
*/
class RequestDataCollector extends DataCollector implements Renderable
{
/**
* @return array
*/
public function collect()
{
$vars = array('_GET', '_POST', '_SESSION', '_COOKIE', '_SERVER');
@@ -29,11 +32,17 @@ class RequestDataCollector extends DataCollector implements Renderable
return $data;
}
/**
* @return string
*/
public function getName()
{
return 'request';
}
/**
* @return array
*/
public function getWidgets()
{
return array(

View File

@@ -187,6 +187,10 @@ class TimeDataCollector extends DataCollector implements Renderable
return microtime(true) - $this->requestStartTime;
}
/**
* @return array
* @throws DebugBarException
*/
public function collect()
{
$this->requestEndTime = microtime(true);
@@ -203,11 +207,17 @@ class TimeDataCollector extends DataCollector implements Renderable
);
}
/**
* @return string
*/
public function getName()
{
return 'time';
}
/**
* @return array
*/
public function getWidgets()
{
return array(