update 1.0.8.0
Commits for version update
This commit is contained in:
2
vendor/maximebf/debugbar/composer.json
vendored
2
vendor/maximebf/debugbar/composer.json
vendored
@@ -36,7 +36,7 @@
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.11-dev"
|
||||
"dev-master": "1.12-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -31,6 +31,13 @@ class CacheCacheCollector extends MonologCollector
|
||||
{
|
||||
protected $logger;
|
||||
|
||||
/**
|
||||
* CacheCacheCollector constructor.
|
||||
* @param Cache|null $cache
|
||||
* @param Logger|null $logger
|
||||
* @param bool $level
|
||||
* @param bool $bubble
|
||||
*/
|
||||
public function __construct(Cache $cache = null, Logger $logger = null, $level = Logger::DEBUG, $bubble = true)
|
||||
{
|
||||
parent::__construct(null, $level, $bubble);
|
||||
@@ -45,6 +52,9 @@ class CacheCacheCollector extends MonologCollector
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Cache $cache
|
||||
*/
|
||||
public function addCache(Cache $cache)
|
||||
{
|
||||
$backend = $cache->getBackend();
|
||||
@@ -55,6 +65,9 @@ class CacheCacheCollector extends MonologCollector
|
||||
$this->addLogger($backend->getLogger());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'cache';
|
||||
|
@@ -34,6 +34,11 @@ class DoctrineCollector extends DataCollector implements Renderable, AssetProvid
|
||||
{
|
||||
protected $debugStack;
|
||||
|
||||
/**
|
||||
* DoctrineCollector constructor.
|
||||
* @param $debugStackOrEntityManager
|
||||
* @throws DebugBarException
|
||||
*/
|
||||
public function __construct($debugStackOrEntityManager)
|
||||
{
|
||||
if ($debugStackOrEntityManager instanceof EntityManager) {
|
||||
@@ -45,6 +50,9 @@ class DoctrineCollector extends DataCollector implements Renderable, AssetProvid
|
||||
$this->debugStack = $debugStackOrEntityManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function collect()
|
||||
{
|
||||
$queries = array();
|
||||
@@ -67,11 +75,17 @@ class DoctrineCollector extends DataCollector implements Renderable, AssetProvid
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'doctrine';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getWidgets()
|
||||
{
|
||||
return array(
|
||||
@@ -88,6 +102,9 @@ class DoctrineCollector extends DataCollector implements Renderable, AssetProvid
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getAssets()
|
||||
{
|
||||
return array(
|
||||
|
@@ -56,6 +56,9 @@ class MonologCollector extends AbstractProcessingHandler implements DataCollecto
|
||||
$logger->pushHandler($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $record
|
||||
*/
|
||||
protected function write(array $record)
|
||||
{
|
||||
$this->records[] = array(
|
||||
@@ -66,11 +69,17 @@ class MonologCollector extends AbstractProcessingHandler implements DataCollecto
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getMessages()
|
||||
{
|
||||
return $this->records;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function collect()
|
||||
{
|
||||
return array(
|
||||
@@ -79,11 +88,17 @@ class MonologCollector extends AbstractProcessingHandler implements DataCollecto
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getWidgets()
|
||||
{
|
||||
$name = $this->getName();
|
||||
|
@@ -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");
|
||||
|
@@ -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();
|
||||
|
@@ -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) {
|
||||
|
@@ -88,11 +88,17 @@ class ExceptionsCollector extends DataCollector implements Renderable
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'exceptions';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getWidgets()
|
||||
{
|
||||
return array(
|
||||
|
@@ -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(
|
||||
|
@@ -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(
|
||||
|
@@ -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();
|
||||
|
@@ -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;
|
||||
|
@@ -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';
|
||||
|
@@ -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(
|
||||
|
@@ -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(
|
||||
|
@@ -15,12 +15,19 @@ use Symfony\Component\VarDumper\Dumper\CliDumper;
|
||||
|
||||
class DataFormatter implements DataFormatterInterface
|
||||
{
|
||||
/**
|
||||
* DataFormatter constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->cloner = new VarCloner();
|
||||
$this->dumper = new CliDumper();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $data
|
||||
* @return string
|
||||
*/
|
||||
public function formatVar($data)
|
||||
{
|
||||
$output = '';
|
||||
@@ -39,6 +46,10 @@ class DataFormatter implements DataFormatterInterface
|
||||
return trim($output);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param float $seconds
|
||||
* @return string
|
||||
*/
|
||||
public function formatDuration($seconds)
|
||||
{
|
||||
if ($seconds < 0.001) {
|
||||
@@ -49,13 +60,22 @@ class DataFormatter implements DataFormatterInterface
|
||||
return round($seconds, 2) . 's';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $size
|
||||
* @param int $precision
|
||||
* @return string
|
||||
*/
|
||||
public function formatBytes($size, $precision = 2)
|
||||
{
|
||||
if ($size === 0 || $size === null) {
|
||||
return "0B";
|
||||
}
|
||||
|
||||
$sign = $size < 0 ? '-' : '';
|
||||
$size = abs($size);
|
||||
|
||||
$base = log($size) / log(1024);
|
||||
$suffixes = array('B', 'KB', 'MB', 'GB', 'TB');
|
||||
return round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)];
|
||||
return $sign . round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)];
|
||||
}
|
||||
}
|
||||
|
@@ -84,6 +84,7 @@ class DebugBar implements ArrayAccess
|
||||
*
|
||||
* @param string $name
|
||||
* @return DataCollectorInterface
|
||||
* @throws DebugBarException
|
||||
*/
|
||||
public function getCollector($name)
|
||||
{
|
||||
@@ -107,6 +108,7 @@ class DebugBar implements ArrayAccess
|
||||
* Sets the request id generator
|
||||
*
|
||||
* @param RequestIdGeneratorInterface $generator
|
||||
* @return $this
|
||||
*/
|
||||
public function setRequestIdGenerator(RequestIdGeneratorInterface $generator)
|
||||
{
|
||||
@@ -142,6 +144,7 @@ class DebugBar implements ArrayAccess
|
||||
* Sets the storage backend to use to store the collected data
|
||||
*
|
||||
* @param StorageInterface $storage
|
||||
* @return $this
|
||||
*/
|
||||
public function setStorage(StorageInterface $storage = null)
|
||||
{
|
||||
@@ -171,6 +174,7 @@ class DebugBar implements ArrayAccess
|
||||
* Sets the HTTP driver
|
||||
*
|
||||
* @param HttpDriverInterface $driver
|
||||
* @return $this
|
||||
*/
|
||||
public function setHttpDriver(HttpDriverInterface $driver)
|
||||
{
|
||||
@@ -287,6 +291,7 @@ class DebugBar implements ArrayAccess
|
||||
* @param bool $useOpenHandler
|
||||
* @param string $headerName
|
||||
* @param integer $maxHeaderLength
|
||||
* @return $this
|
||||
*/
|
||||
public function sendDataInHeaders($useOpenHandler = null, $headerName = 'phpdebugbar', $maxHeaderLength = 4096)
|
||||
{
|
||||
@@ -369,6 +374,7 @@ class DebugBar implements ArrayAccess
|
||||
* Sets the key to use in the $_SESSION array
|
||||
*
|
||||
* @param string $ns
|
||||
* @return $this
|
||||
*/
|
||||
public function setStackDataSessionNamespace($ns)
|
||||
{
|
||||
@@ -391,6 +397,7 @@ class DebugBar implements ArrayAccess
|
||||
* if a storage is enabled
|
||||
*
|
||||
* @param boolean $enabled
|
||||
* @return $this
|
||||
*/
|
||||
public function setStackAlwaysUseSessionStorage($enabled = true)
|
||||
{
|
||||
@@ -411,8 +418,8 @@ class DebugBar implements ArrayAccess
|
||||
|
||||
/**
|
||||
* Initializes the session for stacked data
|
||||
*
|
||||
* @return HttpDriverInterface
|
||||
* @throws DebugBarException
|
||||
*/
|
||||
protected function initStackSession()
|
||||
{
|
||||
@@ -430,9 +437,8 @@ class DebugBar implements ArrayAccess
|
||||
|
||||
/**
|
||||
* Returns a JavascriptRenderer for this instance
|
||||
*
|
||||
* @param string $baseUrl
|
||||
* @param string $basePathng
|
||||
* @param string $basePath
|
||||
* @return JavascriptRenderer
|
||||
*/
|
||||
public function getJavascriptRenderer($baseUrl = null, $basePath = null)
|
||||
|
@@ -19,7 +19,8 @@ interface HttpDriverInterface
|
||||
/**
|
||||
* Sets HTTP headers
|
||||
*
|
||||
* @param string $headers
|
||||
* @param array $headers
|
||||
* @return
|
||||
*/
|
||||
function setHeaders(array $headers);
|
||||
|
||||
|
@@ -60,6 +60,8 @@ class JavascriptRenderer
|
||||
|
||||
protected $enableJqueryNoConflict = true;
|
||||
|
||||
protected $useRequireJs = false;
|
||||
|
||||
protected $initialization;
|
||||
|
||||
protected $controls = array();
|
||||
@@ -143,6 +145,9 @@ class JavascriptRenderer
|
||||
if (array_key_exists('enable_jquery_noconflict', $options)) {
|
||||
$this->setEnableJqueryNoConflict($options['enable_jquery_noconflict']);
|
||||
}
|
||||
if (array_key_exists('use_requirejs', $options)) {
|
||||
$this->setUseRequireJs($options['use_requirejs']);
|
||||
}
|
||||
if (array_key_exists('controls', $options)) {
|
||||
foreach ($options['controls'] as $name => $control) {
|
||||
$this->addControl($name, $control);
|
||||
@@ -352,6 +357,28 @@ class JavascriptRenderer
|
||||
return $this->enableJqueryNoConflict;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether to use RequireJS or not
|
||||
*
|
||||
* @param boolean $enabled
|
||||
* @return $this
|
||||
*/
|
||||
public function setUseRequireJs($enabled = true)
|
||||
{
|
||||
$this->useRequireJs = $enabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if RequireJS is used
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function isRequireJsUsed()
|
||||
{
|
||||
return $this->useRequireJs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a control to initialize
|
||||
*
|
||||
@@ -710,7 +737,7 @@ class JavascriptRenderer
|
||||
*/
|
||||
public function dumpJsAssets($targetFilename = null)
|
||||
{
|
||||
$this->dumpAssets($this->getAssets('js'), $targetFilename);
|
||||
$this->dumpAssets($this->getAssets('js'), $targetFilename, $this->useRequireJs);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -718,13 +745,17 @@ class JavascriptRenderer
|
||||
*
|
||||
* @param array $files
|
||||
* @param string $targetFilename
|
||||
* @param bool $useRequireJs
|
||||
*/
|
||||
protected function dumpAssets($files, $targetFilename = null)
|
||||
protected function dumpAssets($files, $targetFilename = null, $useRequireJs = false)
|
||||
{
|
||||
$content = '';
|
||||
foreach ($files as $file) {
|
||||
$content .= file_get_contents($file) . "\n";
|
||||
}
|
||||
if ($useRequireJs) {
|
||||
$content = "define('debugbar', ['jquery'], function($){\r\n" . $content . "\r\n return PhpDebugBar; \r\n});";
|
||||
}
|
||||
if ($targetFilename !== null) {
|
||||
file_put_contents($targetFilename, $content);
|
||||
} else {
|
||||
@@ -752,7 +783,7 @@ class JavascriptRenderer
|
||||
$html .= sprintf('<script type="text/javascript" src="%s"></script>' . "\n", $file);
|
||||
}
|
||||
|
||||
if ($this->enableJqueryNoConflict) {
|
||||
if ($this->enableJqueryNoConflict && !$this->useRequireJs) {
|
||||
$html .= '<script type="text/javascript">jQuery.noConflict(true);</script>' . "\n";
|
||||
}
|
||||
|
||||
@@ -764,6 +795,8 @@ class JavascriptRenderer
|
||||
*
|
||||
* @param boolean $here Set position of HTML. True if is to current position or false for end file
|
||||
* @param boolean $initialize Whether to render the de bug bar initialization code
|
||||
* @param bool $renderStackedData
|
||||
* @param bool $head
|
||||
* @return string Return "{--DEBUGBAR_OB_START_REPLACE_ME--}" or return an empty string if $here == false
|
||||
*/
|
||||
public function renderOnShutdown($here = true, $initialize = true, $renderStackedData = true, $head = false)
|
||||
@@ -795,6 +828,8 @@ class JavascriptRenderer
|
||||
*
|
||||
* @param boolean $here Set position of HTML. True if is to current position or false for end file
|
||||
* @param boolean $initialize Whether to render the de bug bar initialization code
|
||||
* @param bool $renderStackedData
|
||||
* @param bool $head
|
||||
*/
|
||||
public function replaceTagInBuffer($here = true, $initialize = true, $renderStackedData = true, $head = false)
|
||||
{
|
||||
@@ -815,7 +850,8 @@ class JavascriptRenderer
|
||||
*
|
||||
* AJAX request should not render the initialization code.
|
||||
*
|
||||
* @param boolean $initialize Whether to render the de bug bar initialization code
|
||||
* @param boolean $initialize Whether or not to render the debug bar initialization code
|
||||
* @param boolean $renderStackedData Whether or not to render the stacked data
|
||||
* @return string
|
||||
*/
|
||||
public function render($initialize = true, $renderStackedData = true)
|
||||
@@ -835,7 +871,12 @@ class JavascriptRenderer
|
||||
$suffix = !$initialize ? '(ajax)' : null;
|
||||
$js .= $this->getAddDatasetCode($this->debugBar->getCurrentRequestId(), $this->debugBar->getData(), $suffix);
|
||||
|
||||
return "<script type=\"text/javascript\">\n$js\n</script>\n";
|
||||
if ($this->useRequireJs){
|
||||
return "<script type=\"text/javascript\">\nrequire(['debugbar'], function(PhpDebugBar){ $js });\n</script>\n";
|
||||
} else {
|
||||
return "<script type=\"text/javascript\">\n$js\n</script>\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -945,6 +986,7 @@ class JavascriptRenderer
|
||||
*
|
||||
* @param string $requestId
|
||||
* @param array $data
|
||||
* @param mixed $suffix
|
||||
* @return string
|
||||
*/
|
||||
protected function getAddDatasetCode($requestId, $data, $suffix = null)
|
||||
|
@@ -19,6 +19,7 @@ class OpenHandler
|
||||
|
||||
/**
|
||||
* @param DebugBar $debugBar
|
||||
* @throws DebugBarException
|
||||
*/
|
||||
public function __construct(DebugBar $debugBar)
|
||||
{
|
||||
@@ -32,6 +33,10 @@ class OpenHandler
|
||||
* Handles the current request
|
||||
*
|
||||
* @param array $request Request data
|
||||
* @param bool $echo
|
||||
* @param bool $sendHeader
|
||||
* @return string
|
||||
* @throws DebugBarException
|
||||
*/
|
||||
public function handle($request = null, $echo = true, $sendHeader = true)
|
||||
{
|
||||
@@ -62,6 +67,8 @@ class OpenHandler
|
||||
|
||||
/**
|
||||
* Find operation
|
||||
* @param $request
|
||||
* @return array
|
||||
*/
|
||||
protected function find($request)
|
||||
{
|
||||
@@ -87,6 +94,9 @@ class OpenHandler
|
||||
|
||||
/**
|
||||
* Get operation
|
||||
* @param $request
|
||||
* @return array
|
||||
* @throws DebugBarException
|
||||
*/
|
||||
protected function get($request)
|
||||
{
|
||||
|
@@ -15,6 +15,9 @@ namespace DebugBar;
|
||||
*/
|
||||
class PhpHttpDriver implements HttpDriverInterface
|
||||
{
|
||||
/**
|
||||
* @param array $headers
|
||||
*/
|
||||
function setHeaders(array $headers)
|
||||
{
|
||||
foreach ($headers as $name => $value) {
|
||||
@@ -22,26 +25,44 @@ class PhpHttpDriver implements HttpDriverInterface
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
function isSessionStarted()
|
||||
{
|
||||
return isset($_SESSION);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param string $value
|
||||
*/
|
||||
function setSessionValue($name, $value)
|
||||
{
|
||||
$_SESSION[$name] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @return bool
|
||||
*/
|
||||
function hasSessionValue($name)
|
||||
{
|
||||
return array_key_exists($name, $_SESSION);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @return mixed
|
||||
*/
|
||||
function getSessionValue($name)
|
||||
{
|
||||
return $_SESSION[$name];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*/
|
||||
function deleteSessionValue($name)
|
||||
{
|
||||
unset($_SESSION[$name]);
|
||||
|
@@ -15,6 +15,9 @@ namespace DebugBar;
|
||||
*/
|
||||
class RequestIdGenerator implements RequestIdGeneratorInterface
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function generate()
|
||||
{
|
||||
return md5(serialize($_SERVER) . microtime());
|
||||
|
@@ -97,7 +97,7 @@ div.phpdebugbar-closed, div.phpdebugbar-minimized{
|
||||
/* -------------------------------------- */
|
||||
|
||||
div.phpdebugbar-header, a.phpdebugbar-restore-btn {
|
||||
background: #efefef url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAUCAYAAABvVQZ0AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74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D9mLM6pk7+gqio/Hf+Ret1hLpv5Xhgh4+WwEZmey84ykO5HuuqWMwXgOA6ffzHF1NQR5jJ5FPWuxZaWCwcEEHzs0cfPeVtangwGjQdOfbVSpcXrRd0ktFZazVzLzw8rQHlpuXA4FAo/lIU0v3aPkBCCxesLh4Gyeic2c+Ov5d0xM57arsWtcF2XCxdnvpJSfgygbrr7wbJWioYRfqm5uXlH+6iqSr1eJ3P1yjuudD/cbp8BJIUQX/enBoYbjcaWQr//8ds5KeXbQG6n5biZXcABIDaYHkn+ev5sDvgbmAYW+L/5B5NrVZNHcIujAAAAAElFTkSuQmCC) no-repeat 5px 4px;
|
||||
background: #efefef url(data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2020%2020%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ccircle%20fill%3D%22%23000%22%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%229%22%2F%3E%3Cpath%20d%3D%22M6.039%208.342c.463%200%20.772.084.927.251.154.168.191.455.11.862-.084.424-.247.727-.487.908-.241.182-.608.272-1.1.272h-.743l.456-2.293h.837zm-2.975%204.615h1.22l.29-1.457H5.62c.461%200%20.84-.047%201.139-.142.298-.095.569-.254.812-.477.205-.184.37-.387.497-.608.127-.222.217-.466.27-.734.13-.65.032-1.155-.292-1.518-.324-.362-.84-.543-1.545-.543H4.153l-1.089%205.479zM9.235%206.02h1.21l-.289%201.458h1.079c.679%200%201.147.115%201.405.347.258.231.335.607.232%201.125l-.507%202.55h-1.23l.481-2.424c.055-.276.035-.464-.06-.565-.095-.1-.298-.15-.608-.15H9.98L9.356%2011.5h-1.21l1.089-5.48M15.566%208.342c.464%200%20.773.084.928.251.154.168.19.455.11.862-.084.424-.247.727-.488.908-.24.182-.607.272-1.1.272h-.742l.456-2.293h.836zm-2.974%204.615h1.22l.29-1.457h1.046c.461%200%20.84-.047%201.139-.142.298-.095.569-.254.812-.477.205-.184.37-.387.497-.608.127-.222.217-.466.27-.734.129-.65.032-1.155-.292-1.518-.324-.362-.84-.543-1.545-.543H13.68l-1.089%205.479z%22%20fill%3D%22%23FFF%22%2F%3E%3C%2Fsvg%3E) no-repeat 5px 4px / 20px 20px;
|
||||
}
|
||||
div.phpdebugbar-header {
|
||||
padding-left: 29px;
|
||||
@@ -192,19 +192,19 @@ div.phpdebugbar-minimized a.phpdebugbar-maximize-btn { display: block}
|
||||
div.phpdebugbar-minimized a.phpdebugbar-minimize-btn { display: none}
|
||||
|
||||
a.phpdebugbar-minimize-btn {
|
||||
background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAZklEQVR4nM3OMQ4CIRAF0HcFVyvXErl/6VWM7eo11gYSQiBC5f5mksl/meFfCXggznSueGNPs4UDttT5YIUznmnZwvcC7XjhUl5t4Vh8k9GtfqeFf6IeHkI9PIRqPIVyTlhm0QHzBSfMK4g2snfEAAAAAElFTkSuQmCC) no-repeat 6px 6px;
|
||||
background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201792%201792%22%20id%3D%22chevron-down%22%3E%3Cpath%20d%3D%22M1683%20808l-742%20741q-19%2019-45%2019t-45-19l-742-741q-19-19-19-45.5t19-45.5l166-165q19-19%2045-19t45%2019l531%20531%20531-531q19-19%2045-19t45%2019l166%20165q19%2019%2019%2045.5t-19%2045.5z%22%2F%3E%3C%2Fsvg%3E) no-repeat 6px 6px / 14px 14px;
|
||||
}
|
||||
|
||||
a.phpdebugbar-maximize-btn {
|
||||
background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAZklEQVR4nM3OsQmAMBCF4Z+kcA13sUxhq9sZcAHBLVzIIqBNAuG4aNLlwVXvvuOglxhgbEUW2IEbcK3oiVOFJarCEgXg+sMaWoABOL/wJtCadRqeUnkUkIYDMOeFj++Vkna0w73nBRurK28mVdKbAAAAAElFTkSuQmCC) no-repeat 6px 6px;
|
||||
background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201792%201792%22%20id%3D%22chevron-up%22%3E%3Cpath%20d%3D%22M1683%201331l-166%20165q-19%2019-45%2019t-45-19l-531-531-531%20531q-19%2019-45%2019t-45-19l-166-165q-19-19-19-45.5t19-45.5l742-741q19-19%2045-19t45%2019l742%20741q19%2019%2019%2045.5t-19%2045.5z%22%2F%3E%3C%2Fsvg%3E) no-repeat 6px 6px / 14px 14px;
|
||||
}
|
||||
|
||||
a.phpdebugbar-close-btn {
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuM4zml1AAAADDSURBVDhPxZCxCsIwFEUzuGdwCvQD7BIIcehUXDqVfGM/wsG/iG4ifkzMlRuSPLo4eeFBue8c6Iv6b4wxW557Hs0KnWa3seqDxTiOyVqbhmF4UND4Rofdruyce3rvE6bIRSo9GOI1McbLPM/vVm4l7MAQr0kpHaQsJTDE+6zrepym6SVFdNgR69M+hBTLzWCI10gJvydvBkO8ZlmWayvhJnkzGOI1+fBTCOHWPkT7YNiBId4HizxnCKy+r81uX/otSn0A7dioI/vYX+8AAAAASUVORK5CYII=) no-repeat 9px 6px;
|
||||
background: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201792%201792%22%20id%3D%22close%22%3E%3Cpath%20d%3D%22M1490%201322q0%2040-28%2068l-136%20136q-28%2028-68%2028t-68-28l-294-294-294%20294q-28%2028-68%2028t-68-28l-136-136q-28-28-28-68t28-68l294-294-294-294q-28-28-28-68t28-68l136-136q28-28%2068-28t68%2028l294%20294%20294-294q28-28%2068-28t68%2028l136%20136q28%2028%2028%2068t-28%2068l-294%20294%20294%20294q28%2028%2028%2068z%22%2F%3E%3C%2Fsvg%3E) no-repeat 9px 6px / 14px 14px;
|
||||
}
|
||||
|
||||
a.phpdebugbar-open-btn {
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAOCAYAAADJ7fe0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfdCgYULwwNKp3GAAAAGHRFWHRTb2Z0d2FyZQBwYWludC5uZXQgNC4wLjOM5pdQAAAA1UlEQVQ4T2OgKpCUlOQH4vdA/B8Jv4dKEwYgDdLS0v8NDQ3/GxsbwzGIj2YoGEO1oQJkjcRgqDZUAJKwsrJ6/v//fwdiMFQbKgAZkpGR0QR0ajy60wlgRJhBXSGhpqb2CNnZhHBkZORcqBEMDFBX2BsYGGBVjAv39vZaQ41gYIC6Ygs2hbiwr6/vdqA+DqgR4CiW19bWxqoYF87Ly4uFaocAZWXlydgU4sJ2dna3ga4QgGqHAC0trY/YFOPCKSkpDVCtCAA01QaIsaYJHFgCqpVagIEBACGlF2c3r4ViAAAAAElFTkSuQmCC) no-repeat 8px 6px;
|
||||
background: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201792%201792%22%20id%3D%22folder-open%22%3E%3Cpath%20d%3D%22M1815%20952q0%2031-31%2066l-336%20396q-43%2051-120.5%2086.5t-143.5%2035.5h-1088q-34%200-60.5-13t-26.5-43q0-31%2031-66l336-396q43-51%20120.5-86.5t143.5-35.5h1088q34%200%2060.5%2013t26.5%2043zm-343-344v160h-832q-94%200-197%2047.5t-164%20119.5l-337%20396-5%206q0-4-.5-12.5t-.5-12.5v-960q0-92%2066-158t158-66h320q92%200%20158%2066t66%20158v32h544q92%200%20158%2066t66%20158z%22%2F%3E%3C%2Fsvg%3E) no-repeat 8px 6px / 14px 14px;
|
||||
}
|
||||
|
||||
.phpdebugbar-indicator {
|
||||
|
@@ -395,8 +395,8 @@ if (typeof(PhpDebugBar) == 'undefined') {
|
||||
className: "phpdebugbar " + csscls('minimized'),
|
||||
|
||||
options: {
|
||||
bodyPaddingBottom: true,
|
||||
bodyPaddingBottomHeight: parseInt($('body').css('padding-bottom'))
|
||||
bodyMarginBottom: true,
|
||||
bodyMarginBottomHeight: parseInt($('body').css('margin-bottom'))
|
||||
},
|
||||
|
||||
initialize: function() {
|
||||
@@ -793,7 +793,16 @@ if (typeof(PhpDebugBar) == 'undefined') {
|
||||
this.$el.addClass(csscls('closed'));
|
||||
this.recomputeBottomOffset();
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the panel is closed
|
||||
*
|
||||
* @return {Boolean}
|
||||
*/
|
||||
isClosed: function() {
|
||||
return this.$el.hasClass(csscls('closed'));
|
||||
},
|
||||
|
||||
/**
|
||||
* Restore the debug bar
|
||||
*
|
||||
@@ -813,13 +822,17 @@ if (typeof(PhpDebugBar) == 'undefined') {
|
||||
},
|
||||
|
||||
/**
|
||||
* Recomputes the padding-bottom css property of the body so
|
||||
* Recomputes the margin-bottom css property of the body so
|
||||
* that the debug bar never hides any content
|
||||
*/
|
||||
recomputeBottomOffset: function() {
|
||||
if (this.options.bodyPaddingBottom) {
|
||||
var height = parseInt(this.$el.height()) + this.options.bodyPaddingBottomHeight;
|
||||
$('body').css('padding-bottom', height);
|
||||
if (this.options.bodyMarginBottom) {
|
||||
if (this.isClosed()) {
|
||||
return $('body').css('margin-bottom', this.options.bodyMarginBottomHeight || '');
|
||||
}
|
||||
|
||||
var offset = parseInt(this.$el.height()) + this.options.bodyMarginBottomHeight;
|
||||
$('body').css('margin-bottom', offset);
|
||||
}
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user