update 1.0.8.0
Commits for version update
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user