ヤミRoot VoidGate
User / IP
:
216.73.216.211
Host / Server
:
146.88.233.70 / dev.loger.cm
System
:
Linux hybrid1120.fr.ns.planethoster.net 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
itrave
/
api
/
vendor
/
doctrine
/
doctrine-bundle
/
Controller
/
Viewing: ProfilerController.php
<?php namespace Doctrine\Bundle\DoctrineBundle\Controller; use Doctrine\DBAL\Connection; use Doctrine\DBAL\Platforms\SQLServerPlatform; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Profiler\Profiler; /** * ProfilerController. */ class ProfilerController implements ContainerAwareInterface { /** @var ContainerInterface */ private $container; /** * {@inheritDoc} */ public function setContainer(ContainerInterface $container = null) { $this->container = $container; } /** * Renders the profiler panel for the given token. * * @param string $token The profiler token * @param string $connectionName * @param int $query * * @return Response A Response instance */ public function explainAction($token, $connectionName, $query) { /** @var Profiler $profiler */ $profiler = $this->container->get('profiler'); $profiler->disable(); $profile = $profiler->loadProfile($token); $queries = $profile->getCollector('db')->getQueries(); if (! isset($queries[$connectionName][$query])) { return new Response('This query does not exist.'); } $query = $queries[$connectionName][$query]; if (! $query['explainable']) { return new Response('This query cannot be explained.'); } /** @var Connection $connection */ $connection = $this->container->get('doctrine')->getConnection($connectionName); try { if ($connection->getDatabasePlatform() instanceof SQLServerPlatform) { $results = $this->explainSQLServerPlatform($connection, $query); } else { $results = $this->explainOtherPlatform($connection, $query); } } catch (\Exception $e) { return new Response('This query cannot be explained.'); } return new Response($this->container->get('twig')->render('@Doctrine/Collector/explain.html.twig', [ 'data' => $results, 'query' => $query, ])); } private function explainSQLServerPlatform(Connection $connection, $query) { if (stripos($query['sql'], 'SELECT') === 0) { $sql = 'SET STATISTICS PROFILE ON; ' . $query['sql'] . '; SET STATISTICS PROFILE OFF;'; } else { $sql = 'SET SHOWPLAN_TEXT ON; GO; SET NOEXEC ON; ' . $query['sql'] . '; SET NOEXEC OFF; GO; SET SHOWPLAN_TEXT OFF;'; } $stmt = $connection->executeQuery($sql, $query['params'], $query['types']); $stmt->nextRowset(); return $stmt->fetchAll(\PDO::FETCH_ASSOC); } private function explainOtherPlatform(Connection $connection, $query) { return $connection->executeQuery('EXPLAIN ' . $query['sql'], $query['params'], $query['types']) ->fetchAll(\PDO::FETCH_ASSOC); } }
Coded With 💗 by
0x6ick