+ */
+class SqliteProfilerStorage extends PdoProfilerStorage
+{
+ /**
+ * @throws \RuntimeException When neither of SQLite3 or PDO_SQLite extension is enabled
+ */
+ protected function initDb()
+ {
+ if (null === $this->db || $this->db instanceof \SQLite3) {
+ if (0 !== strpos($this->dsn, 'sqlite')) {
+ throw new \RuntimeException(sprintf('Please check your configuration. You are trying to use Sqlite with an invalid dsn "%s". The expected format is "sqlite:/path/to/the/db/file".', $this->dsn));
+ }
+ if (class_exists('SQLite3')) {
+ $db = new \SQLite3(substr($this->dsn, 7, strlen($this->dsn)), \SQLITE3_OPEN_READWRITE | \SQLITE3_OPEN_CREATE);
+ if (method_exists($db, 'busyTimeout')) {
+ // busyTimeout only exists for PHP >= 5.3.3
+ $db->busyTimeout(1000);
+ }
+ } elseif (class_exists('PDO') && in_array('sqlite', \PDO::getAvailableDrivers(), true)) {
+ $db = new \PDO($this->dsn);
+ } else {
+ throw new \RuntimeException('You need to enable either the SQLite3 or PDO_SQLite extension for the profiler to run properly.');
+ }
+
+ $db->exec('PRAGMA temp_store=MEMORY; PRAGMA journal_mode=MEMORY;');
+ $db->exec('CREATE TABLE IF NOT EXISTS sf_profiler_data (token STRING, data STRING, ip STRING, method STRING, url STRING, time INTEGER, parent STRING, created_at INTEGER)');
+ $db->exec('CREATE INDEX IF NOT EXISTS data_created_at ON sf_profiler_data (created_at)');
+ $db->exec('CREATE INDEX IF NOT EXISTS data_ip ON sf_profiler_data (ip)');
+ $db->exec('CREATE INDEX IF NOT EXISTS data_method ON sf_profiler_data (method)');
+ $db->exec('CREATE INDEX IF NOT EXISTS data_url ON sf_profiler_data (url)');
+ $db->exec('CREATE INDEX IF NOT EXISTS data_parent ON sf_profiler_data (parent)');
+ $db->exec('CREATE UNIQUE INDEX IF NOT EXISTS data_token ON sf_profiler_data (token)');
+
+ $this->db = $db;
+ }
+
+ return $this->db;
+ }
+
+ protected function exec($db, $query, array $args = array())
+ {
+ if ($db instanceof \SQLite3) {
+ $stmt = $this->prepareStatement($db, $query);
+ foreach ($args as $arg => $val) {
+ $stmt->bindValue($arg, $val, is_int($val) ? \SQLITE3_INTEGER : \SQLITE3_TEXT);
+ }
+
+ $res = $stmt->execute();
+ if (false === $res) {
+ throw new \RuntimeException(sprintf('Error executing SQLite query "%s"', $query));
+ }
+ $res->finalize();
+ } else {
+ parent::exec($db, $query, $args);
+ }
+ }
+
+ protected function fetch($db, $query, array $args = array())
+ {
+ $return = array();
+
+ if ($db instanceof \SQLite3) {
+ $stmt = $this->prepareStatement($db, $query, true);
+ foreach ($args as $arg => $val) {
+ $stmt->bindValue($arg, $val, is_int($val) ? \SQLITE3_INTEGER : \SQLITE3_TEXT);
+ }
+ $res = $stmt->execute();
+ while ($row = $res->fetchArray(\SQLITE3_ASSOC)) {
+ $return[] = $row;
+ }
+ $res->finalize();
+ $stmt->close();
+ } else {
+ $return = parent::fetch($db, $query, $args);
+ }
+
+ return $return;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function buildCriteria($ip, $url, $start, $end, $limit, $method)
+ {
+ $criteria = array();
+ $args = array();
+
+ if ($ip = preg_replace('/[^\d\.]/', '', $ip)) {
+ $criteria[] = 'ip LIKE :ip';
+ $args[':ip'] = '%'.$ip.'%';
+ }
+
+ if ($url) {
+ $criteria[] = 'url LIKE :url ESCAPE "\"';
+ $args[':url'] = '%'.addcslashes($url, '%_\\').'%';
+ }
+
+ if ($method) {
+ $criteria[] = 'method = :method';
+ $args[':method'] = $method;
+ }
+
+ if (!empty($start)) {
+ $criteria[] = 'time >= :start';
+ $args[':start'] = $start;
+ }
+
+ if (!empty($end)) {
+ $criteria[] = 'time <= :end';
+ $args[':end'] = $end;
+ }
+
+ return array($criteria, $args);
+ }
+
+ protected function close($db)
+ {
+ if ($db instanceof \SQLite3) {
+ $db->close();
+ }
+ }
+}
diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php b/src/Symfony/Component/HttpProfiler/Tests/DataCollector/ConfigDataCollectorTest.php
similarity index 94%
rename from src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php
rename to src/Symfony/Component/HttpProfiler/Tests/DataCollector/ConfigDataCollectorTest.php
index 0c7396158631..111e10acae6e 100644
--- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php
+++ b/src/Symfony/Component/HttpProfiler/Tests/DataCollector/ConfigDataCollectorTest.php
@@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Tests\DataCollector;
+namespace Symfony\Component\HttpProfiler\Tests\DataCollector;
-use Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector;
+use Symfony\Component\HttpProfiler\DataCollector\ConfigDataCollector;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpFoundation\Request;
diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php b/src/Symfony/Component/HttpProfiler/Tests/DataCollector/ExceptionDataCollectorTest.php
similarity index 89%
rename from src/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php
rename to src/Symfony/Component/HttpProfiler/Tests/DataCollector/ExceptionDataCollectorTest.php
index ebea3ea6e1fc..6138fff7299e 100644
--- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php
+++ b/src/Symfony/Component/HttpProfiler/Tests/DataCollector/ExceptionDataCollectorTest.php
@@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Tests\DataCollector;
+namespace Symfony\Component\HttpProfiler\Tests\DataCollector;
-use Symfony\Component\HttpKernel\DataCollector\ExceptionDataCollector;
+use Symfony\Component\HttpProfiler\DataCollector\ExceptionDataCollector;
use Symfony\Component\HttpKernel\Exception\FlattenException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php b/src/Symfony/Component/HttpProfiler/Tests/DataCollector/LoggerDataCollectorTest.php
similarity index 94%
rename from src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php
rename to src/Symfony/Component/HttpProfiler/Tests/DataCollector/LoggerDataCollectorTest.php
index 7cd4d06c7ad6..e38e12972223 100644
--- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php
+++ b/src/Symfony/Component/HttpProfiler/Tests/DataCollector/LoggerDataCollectorTest.php
@@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Tests\DataCollector;
+namespace Symfony\Component\HttpProfiler\Tests\DataCollector;
-use Symfony\Component\HttpKernel\DataCollector\LoggerDataCollector;
+use Symfony\Component\HttpProfiler\DataCollector\LoggerDataCollector;
use Symfony\Component\HttpKernel\Debug\ErrorHandler;
class LoggerDataCollectorTest extends \PHPUnit_Framework_TestCase
diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/MemoryDataCollectorTest.php b/src/Symfony/Component/HttpProfiler/Tests/DataCollector/MemoryDataCollectorTest.php
similarity index 93%
rename from src/Symfony/Component/HttpKernel/Tests/DataCollector/MemoryDataCollectorTest.php
rename to src/Symfony/Component/HttpProfiler/Tests/DataCollector/MemoryDataCollectorTest.php
index 340b42881688..149ec16ced42 100644
--- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/MemoryDataCollectorTest.php
+++ b/src/Symfony/Component/HttpProfiler/Tests/DataCollector/MemoryDataCollectorTest.php
@@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Tests\DataCollector;
+namespace Symfony\Component\HttpProfiler\Tests\DataCollector;
-use Symfony\Component\HttpKernel\DataCollector\MemoryDataCollector;
+use Symfony\Component\HttpProfiler\DataCollector\MemoryDataCollector;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php b/src/Symfony/Component/HttpProfiler/Tests/DataCollector/RequestDataCollectorTest.php
similarity index 85%
rename from src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php
rename to src/Symfony/Component/HttpProfiler/Tests/DataCollector/RequestDataCollectorTest.php
index 02a85b9cd8ba..d842d33d460f 100644
--- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php
+++ b/src/Symfony/Component/HttpProfiler/Tests/DataCollector/RequestDataCollectorTest.php
@@ -9,11 +9,11 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Tests\DataCollector;
+namespace Symfony\Component\HttpProfiler\Tests\DataCollector;
use Symfony\Component\HttpKernel\HttpKernel;
use Symfony\Component\HttpKernel\HttpKernelInterface;
-use Symfony\Component\HttpKernel\DataCollector\RequestDataCollector;
+use Symfony\Component\HttpProfiler\DataCollector\RequestDataCollector;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@@ -65,7 +65,7 @@ public function testControllerInspection()
'"Regular" callable',
array($this, 'testControllerInspection'),
array(
- 'class' => 'Symfony\Component\HttpKernel\Tests\DataCollector\RequestDataCollectorTest',
+ 'class' => 'Symfony\Component\HttpProfiler\Tests\DataCollector\RequestDataCollectorTest',
'method' => 'testControllerInspection',
'file' => __FILE__,
'line' => $r1->getStartLine()
@@ -85,15 +85,15 @@ function () { return 'foo'; },
array(
'Static callback as string',
- 'Symfony\Component\HttpKernel\Tests\DataCollector\RequestDataCollectorTest::staticControllerMethod',
- 'Symfony\Component\HttpKernel\Tests\DataCollector\RequestDataCollectorTest::staticControllerMethod',
+ 'Symfony\Component\HttpProfiler\Tests\DataCollector\RequestDataCollectorTest::staticControllerMethod',
+ 'Symfony\Component\HttpProfiler\Tests\DataCollector\RequestDataCollectorTest::staticControllerMethod',
),
array(
'Static callable with instance',
array($this, 'staticControllerMethod'),
array(
- 'class' => 'Symfony\Component\HttpKernel\Tests\DataCollector\RequestDataCollectorTest',
+ 'class' => 'Symfony\Component\HttpProfiler\Tests\DataCollector\RequestDataCollectorTest',
'method' => 'staticControllerMethod',
'file' => __FILE__,
'line' => $r2->getStartLine()
@@ -102,9 +102,9 @@ function () { return 'foo'; },
array(
'Static callable with class name',
- array('Symfony\Component\HttpKernel\Tests\DataCollector\RequestDataCollectorTest', 'staticControllerMethod'),
+ array('Symfony\Component\HttpProfiler\Tests\DataCollector\RequestDataCollectorTest', 'staticControllerMethod'),
array(
- 'class' => 'Symfony\Component\HttpKernel\Tests\DataCollector\RequestDataCollectorTest',
+ 'class' => 'Symfony\Component\HttpProfiler\Tests\DataCollector\RequestDataCollectorTest',
'method' => 'staticControllerMethod',
'file' => __FILE__,
'line' => $r2->getStartLine()
@@ -115,7 +115,7 @@ function () { return 'foo'; },
'Callable with instance depending on __call()',
array($this, 'magicMethod'),
array(
- 'class' => 'Symfony\Component\HttpKernel\Tests\DataCollector\RequestDataCollectorTest',
+ 'class' => 'Symfony\Component\HttpProfiler\Tests\DataCollector\RequestDataCollectorTest',
'method' => 'magicMethod',
'file' => 'n/a',
'line' => 'n/a'
@@ -124,9 +124,9 @@ function () { return 'foo'; },
array(
'Callable with class name depending on __callStatic()',
- array('Symfony\Component\HttpKernel\Tests\DataCollector\RequestDataCollectorTest', 'magicMethod'),
+ array('Symfony\Component\HttpProfiler\Tests\DataCollector\RequestDataCollectorTest', 'magicMethod'),
array(
- 'class' => 'Symfony\Component\HttpKernel\Tests\DataCollector\RequestDataCollectorTest',
+ 'class' => 'Symfony\Component\HttpProfiler\Tests\DataCollector\RequestDataCollectorTest',
'method' => 'magicMethod',
'file' => 'n/a',
'line' => 'n/a'
diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/TimeDataCollectorTest.php b/src/Symfony/Component/HttpProfiler/Tests/DataCollector/TimeDataCollectorTest.php
similarity index 91%
rename from src/Symfony/Component/HttpKernel/Tests/DataCollector/TimeDataCollectorTest.php
rename to src/Symfony/Component/HttpProfiler/Tests/DataCollector/TimeDataCollectorTest.php
index b5d64bffe350..ff6500259f1d 100644
--- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/TimeDataCollectorTest.php
+++ b/src/Symfony/Component/HttpProfiler/Tests/DataCollector/TimeDataCollectorTest.php
@@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Tests\DataCollector;
+namespace Symfony\Component\HttpProfiler\Tests\DataCollector;
-use Symfony\Component\HttpKernel\DataCollector\TimeDataCollector;
+use Symfony\Component\HttpProfiler\DataCollector\TimeDataCollector;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/ProfilerListenerTest.php b/src/Symfony/Component/HttpProfiler/Tests/EventListener/ProfilerListenerTest.php
similarity index 94%
rename from src/Symfony/Component/HttpKernel/Tests/EventListener/ProfilerListenerTest.php
rename to src/Symfony/Component/HttpProfiler/Tests/EventListener/ProfilerListenerTest.php
index d43bbfefd19f..341cd2d67f9e 100644
--- a/src/Symfony/Component/HttpKernel/Tests/EventListener/ProfilerListenerTest.php
+++ b/src/Symfony/Component/HttpProfiler/Tests/EventListener/ProfilerListenerTest.php
@@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Tests\EventListener;
+namespace Symfony\Component\HttpProfiler\Tests\EventListener;
-use Symfony\Component\HttpKernel\EventListener\ProfilerListener;
+use Symfony\Component\HttpProfiler\EventListener\ProfilerListener;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
@@ -28,11 +28,11 @@ class ProfilerListenerTest extends \PHPUnit_Framework_TestCase
*/
public function testEventsWithoutRequestStack()
{
- $profile = $this->getMockBuilder('Symfony\Component\HttpKernel\Profiler\Profile')
+ $profile = $this->getMockBuilder('Symfony\Component\HttpProfiler\Profile')
->disableOriginalConstructor()
->getMock();
- $profiler = $this->getMockBuilder('Symfony\Component\HttpKernel\Profiler\Profiler')
+ $profiler = $this->getMockBuilder('Symfony\Component\HttpProfiler\Profiler')
->disableOriginalConstructor()
->getMock();
$profiler->expects($this->once())
@@ -60,11 +60,11 @@ public function testEventsWithoutRequestStack()
*/
public function testKernelTerminate()
{
- $profile = $this->getMockBuilder('Symfony\Component\HttpKernel\Profiler\Profile')
+ $profile = $this->getMockBuilder('Symfony\Component\HttpProfiler\Profile')
->disableOriginalConstructor()
->getMock();
- $profiler = $this->getMockBuilder('Symfony\Component\HttpKernel\Profiler\Profiler')
+ $profiler = $this->getMockBuilder('Symfony\Component\HttpProfiler\Profiler')
->disableOriginalConstructor()
->getMock();
diff --git a/src/Symfony/Component/HttpKernel/Tests/Profiler/ProfilerTest.php b/src/Symfony/Component/HttpProfiler/Tests/ProfilerTest.php
similarity index 81%
rename from src/Symfony/Component/HttpKernel/Tests/Profiler/ProfilerTest.php
rename to src/Symfony/Component/HttpProfiler/Tests/ProfilerTest.php
index ede7c3f14b0d..69e9131203f5 100644
--- a/src/Symfony/Component/HttpKernel/Tests/Profiler/ProfilerTest.php
+++ b/src/Symfony/Component/HttpProfiler/Tests/ProfilerTest.php
@@ -9,11 +9,11 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Tests\Profiler;
+namespace Symfony\Component\HttpProfiler\Tests;
-use Symfony\Component\HttpKernel\DataCollector\RequestDataCollector;
-use Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage;
-use Symfony\Component\HttpKernel\Profiler\Profiler;
+use Symfony\Component\HttpProfiler\DataCollector\RequestDataCollector;
+use Symfony\Component\HttpProfiler\Storage\SqliteProfilerStorage;
+use Symfony\Component\HttpProfiler\Profiler;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@@ -41,7 +41,7 @@ public function testCollect()
$profiler->add($collector);
$profile = $profiler->collect($request, $response);
- $profile = $profiler->loadProfile($profile->getToken());
+ $profile = $profiler->load($profile->getToken());
$this->assertEquals(array('foo' => 'bar'), $profiler->get('request')->getRequestQuery()->all());
@unlink($tmp);
diff --git a/src/Symfony/Component/HttpKernel/Tests/Profiler/AbstractProfilerStorageTest.php b/src/Symfony/Component/HttpProfiler/Tests/Storage/AbstractProfilerStorageTest.php
similarity index 97%
rename from src/Symfony/Component/HttpKernel/Tests/Profiler/AbstractProfilerStorageTest.php
rename to src/Symfony/Component/HttpProfiler/Tests/Storage/AbstractProfilerStorageTest.php
index 4657ff1d7648..500a5abce84c 100644
--- a/src/Symfony/Component/HttpKernel/Tests/Profiler/AbstractProfilerStorageTest.php
+++ b/src/Symfony/Component/HttpProfiler/Tests/Storage/AbstractProfilerStorageTest.php
@@ -8,9 +8,10 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Tests\Profiler;
+namespace Symfony\Component\HttpProfiler\Tests\Storage;
-use Symfony\Component\HttpKernel\Profiler\Profile;
+use Symfony\Component\HttpProfiler\Profile;
+use Symfony\Component\HttpProfiler\Storage\ProfilerStorageInterface;
abstract class AbstractProfilerStorageTest extends \PHPUnit_Framework_TestCase
{
@@ -238,7 +239,7 @@ public function testDuplicates()
$profile->setUrl('http://example.net/');
$profile->setMethod('GET');
- ///three duplicates
+ // three duplicates
$this->getStorage()->write($profile);
$this->getStorage()->write($profile);
$this->getStorage()->write($profile);
@@ -247,7 +248,7 @@ public function testDuplicates()
}
/**
- * @return \Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface
+ * @return ProfilerStorageInterface
*/
abstract protected function getStorage();
}
diff --git a/src/Symfony/Component/HttpKernel/Tests/Profiler/FileProfilerStorageTest.php b/src/Symfony/Component/HttpProfiler/Tests/Storage/FileProfilerStorageTest.php
similarity index 90%
rename from src/Symfony/Component/HttpKernel/Tests/Profiler/FileProfilerStorageTest.php
rename to src/Symfony/Component/HttpProfiler/Tests/Storage/FileProfilerStorageTest.php
index 3c2d04c0d4f1..7a45d48e4cd9 100644
--- a/src/Symfony/Component/HttpKernel/Tests/Profiler/FileProfilerStorageTest.php
+++ b/src/Symfony/Component/HttpProfiler/Tests/Storage/FileProfilerStorageTest.php
@@ -9,10 +9,11 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Tests\Profiler;
+namespace Symfony\Component\HttpProfiler\Tests\Storage;
-use Symfony\Component\HttpKernel\Profiler\FileProfilerStorage;
-use Symfony\Component\HttpKernel\Profiler\Profile;
+use Symfony\Component\HttpProfiler\Storage\FileProfilerStorage;
+use Symfony\Component\HttpProfiler\Storage\ProfilerStorageInterface;
+use Symfony\Component\HttpProfiler\Profile;
class FileProfilerStorageTest extends AbstractProfilerStorageTest
{
@@ -52,7 +53,7 @@ protected function setUp()
}
/**
- * @return \Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface
+ * @return ProfilerStorageInterface
*/
protected function getStorage()
{
diff --git a/src/Symfony/Component/HttpKernel/Tests/Profiler/MemcacheProfilerStorageTest.php b/src/Symfony/Component/HttpProfiler/Tests/Storage/MemcacheProfilerStorageTest.php
similarity index 76%
rename from src/Symfony/Component/HttpKernel/Tests/Profiler/MemcacheProfilerStorageTest.php
rename to src/Symfony/Component/HttpProfiler/Tests/Storage/MemcacheProfilerStorageTest.php
index f582dff79993..44aab62ffe42 100644
--- a/src/Symfony/Component/HttpKernel/Tests/Profiler/MemcacheProfilerStorageTest.php
+++ b/src/Symfony/Component/HttpProfiler/Tests/Storage/MemcacheProfilerStorageTest.php
@@ -9,10 +9,11 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Tests\Profiler;
+namespace Symfony\Component\HttpProfiler\Tests\Storage;
-use Symfony\Component\HttpKernel\Profiler\MemcacheProfilerStorage;
-use Symfony\Component\HttpKernel\Tests\Profiler\Mock\MemcacheMock;
+use Symfony\Component\HttpProfiler\Storage\MemcacheProfilerStorage;
+use Symfony\Component\HttpProfiler\Storage\ProfilerStorageInterface;
+use Symfony\Component\HttpProfiler\Tests\Storage\Mock\MemcacheMock;
class MemcacheProfilerStorageTest extends AbstractProfilerStorageTest
{
@@ -40,7 +41,7 @@ protected function tearDown()
}
/**
- * @return \Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface
+ * @return ProfilerStorageInterface
*/
protected function getStorage()
{
diff --git a/src/Symfony/Component/HttpKernel/Tests/Profiler/MemcachedProfilerStorageTest.php b/src/Symfony/Component/HttpProfiler/Tests/Storage/MemcachedProfilerStorageTest.php
similarity index 76%
rename from src/Symfony/Component/HttpKernel/Tests/Profiler/MemcachedProfilerStorageTest.php
rename to src/Symfony/Component/HttpProfiler/Tests/Storage/MemcachedProfilerStorageTest.php
index 565ac35f33a8..aaa734bd8bdf 100644
--- a/src/Symfony/Component/HttpKernel/Tests/Profiler/MemcachedProfilerStorageTest.php
+++ b/src/Symfony/Component/HttpProfiler/Tests/Storage/MemcachedProfilerStorageTest.php
@@ -9,10 +9,11 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Tests\Profiler;
+namespace Symfony\Component\HttpProfiler\Tests\Storage;
-use Symfony\Component\HttpKernel\Profiler\MemcachedProfilerStorage;
-use Symfony\Component\HttpKernel\Tests\Profiler\Mock\MemcachedMock;
+use Symfony\Component\HttpProfiler\Storage\MemcachedProfilerStorage;
+use Symfony\Component\HttpProfiler\Storage\ProfilerStorageInterface;
+use Symfony\Component\HttpProfiler\Tests\Storage\Mock\MemcachedMock;
class MemcachedProfilerStorageTest extends AbstractProfilerStorageTest
{
@@ -40,7 +41,7 @@ protected function tearDown()
}
/**
- * @return \Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface
+ * @return ProfilerStorageInterface
*/
protected function getStorage()
{
diff --git a/src/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcacheMock.php b/src/Symfony/Component/HttpProfiler/Tests/Storage/Mock/MemcacheMock.php
similarity index 98%
rename from src/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcacheMock.php
rename to src/Symfony/Component/HttpProfiler/Tests/Storage/Mock/MemcacheMock.php
index 9ff962c5b75e..a5b52b97d5d7 100644
--- a/src/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcacheMock.php
+++ b/src/Symfony/Component/HttpProfiler/Tests/Storage/Mock/MemcacheMock.php
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Tests\Profiler\Mock;
+namespace Symfony\Component\HttpProfiler\Tests\Storage\Mock;
/**
* MemcacheMock for simulating Memcache extension in tests.
diff --git a/src/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcachedMock.php b/src/Symfony/Component/HttpProfiler/Tests/Storage/Mock/MemcachedMock.php
similarity index 98%
rename from src/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcachedMock.php
rename to src/Symfony/Component/HttpProfiler/Tests/Storage/Mock/MemcachedMock.php
index d28d54211d11..38a9a80f4285 100644
--- a/src/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcachedMock.php
+++ b/src/Symfony/Component/HttpProfiler/Tests/Storage/Mock/MemcachedMock.php
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Tests\Profiler\Mock;
+namespace Symfony\Component\HttpProfiler\Tests\Storage\Mock;
/**
* MemcachedMock for simulating Memcached extension in tests.
diff --git a/src/Symfony/Component/HttpKernel/Tests/Profiler/Mock/RedisMock.php b/src/Symfony/Component/HttpProfiler/Tests/Storage/Mock/RedisMock.php
similarity index 98%
rename from src/Symfony/Component/HttpKernel/Tests/Profiler/Mock/RedisMock.php
rename to src/Symfony/Component/HttpProfiler/Tests/Storage/Mock/RedisMock.php
index 4a89e2db8872..e179bab77402 100644
--- a/src/Symfony/Component/HttpKernel/Tests/Profiler/Mock/RedisMock.php
+++ b/src/Symfony/Component/HttpProfiler/Tests/Storage/Mock/RedisMock.php
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Tests\Profiler\Mock;
+namespace Symfony\Component\HttpProfiler\Tests\Storage\Mock;
/**
* RedisMock for simulating Redis extension in tests.
diff --git a/src/Symfony/Component/HttpKernel/Tests/Profiler/MongoDbProfilerStorageTest.php b/src/Symfony/Component/HttpProfiler/Tests/Storage/MongoDbProfilerStorageTest.php
similarity index 93%
rename from src/Symfony/Component/HttpKernel/Tests/Profiler/MongoDbProfilerStorageTest.php
rename to src/Symfony/Component/HttpProfiler/Tests/Storage/MongoDbProfilerStorageTest.php
index 15fe98695fae..b7549e5aaff8 100644
--- a/src/Symfony/Component/HttpKernel/Tests/Profiler/MongoDbProfilerStorageTest.php
+++ b/src/Symfony/Component/HttpProfiler/Tests/Storage/MongoDbProfilerStorageTest.php
@@ -9,11 +9,12 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Tests\Profiler;
+namespace Symfony\Component\HttpProfiler\Tests\Storage;
-use Symfony\Component\HttpKernel\Profiler\MongoDbProfilerStorage;
-use Symfony\Component\HttpKernel\Profiler\Profile;
-use Symfony\Component\HttpKernel\DataCollector\DataCollector;
+use Symfony\Component\HttpProfiler\Storage\ProfilerStorageInterface;
+use Symfony\Component\HttpProfiler\Storage\MongoDbProfilerStorage;
+use Symfony\Component\HttpProfiler\Profile;
+use Symfony\Component\HttpProfiler\DataCollector\DataCollector;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@@ -147,7 +148,7 @@ public function testUtf8()
}
/**
- * @return \Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface
+ * @return ProfilerStorageInterface
*/
protected function getStorage()
{
diff --git a/src/Symfony/Component/HttpKernel/Tests/Profiler/RedisProfilerStorageTest.php b/src/Symfony/Component/HttpProfiler/Tests/Storage/RedisProfilerStorageTest.php
similarity index 76%
rename from src/Symfony/Component/HttpKernel/Tests/Profiler/RedisProfilerStorageTest.php
rename to src/Symfony/Component/HttpProfiler/Tests/Storage/RedisProfilerStorageTest.php
index 91354ae93548..19bb04997e25 100644
--- a/src/Symfony/Component/HttpKernel/Tests/Profiler/RedisProfilerStorageTest.php
+++ b/src/Symfony/Component/HttpProfiler/Tests/Storage/RedisProfilerStorageTest.php
@@ -9,10 +9,11 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Tests\Profiler;
+namespace Symfony\Component\HttpProfiler\Tests\Storage;
-use Symfony\Component\HttpKernel\Profiler\RedisProfilerStorage;
-use Symfony\Component\HttpKernel\Tests\Profiler\Mock\RedisMock;
+use Symfony\Component\HttpProfiler\Storage\RedisProfilerStorage;
+use Symfony\Component\HttpProfiler\Storage\ProfilerStorageInterface;
+use Symfony\Component\HttpProfiler\Tests\Storage\Mock\RedisMock;
class RedisProfilerStorageTest extends AbstractProfilerStorageTest
{
@@ -40,7 +41,7 @@ protected function tearDown()
}
/**
- * @return \Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface
+ * @return ProfilerStorageInterface
*/
protected function getStorage()
{
diff --git a/src/Symfony/Component/HttpKernel/Tests/Profiler/SqliteProfilerStorageTest.php b/src/Symfony/Component/HttpProfiler/Tests/Storage/SqliteProfilerStorageTest.php
similarity index 83%
rename from src/Symfony/Component/HttpKernel/Tests/Profiler/SqliteProfilerStorageTest.php
rename to src/Symfony/Component/HttpProfiler/Tests/Storage/SqliteProfilerStorageTest.php
index 43546c1a16ec..0fdd9bd08272 100644
--- a/src/Symfony/Component/HttpKernel/Tests/Profiler/SqliteProfilerStorageTest.php
+++ b/src/Symfony/Component/HttpProfiler/Tests/Storage/SqliteProfilerStorageTest.php
@@ -9,9 +9,10 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Tests\Profiler;
+namespace Symfony\Component\HttpProfiler\Tests\Storage;
-use Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage;
+use Symfony\Component\HttpProfiler\Storage\SqliteProfilerStorage;
+use Symfony\Component\HttpProfiler\Storage\ProfilerStorageInterface;
class SqliteProfilerStorageTest extends AbstractProfilerStorageTest
{
@@ -41,7 +42,7 @@ protected function setUp()
}
/**
- * @return \Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface
+ * @return ProfilerStorageInterface
*/
protected function getStorage()
{
diff --git a/src/Symfony/Component/HttpProfiler/composer.json b/src/Symfony/Component/HttpProfiler/composer.json
new file mode 100644
index 000000000000..31e6da14997b
--- /dev/null
+++ b/src/Symfony/Component/HttpProfiler/composer.json
@@ -0,0 +1,38 @@
+{
+ "name": "symfony/http-profiler",
+ "type": "library",
+ "description": "Symfony HttpProfiler Component",
+ "keywords": [],
+ "homepage": "http://symfony.com",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ }
+ ],
+ "require": {
+ "php": ">=5.3.3",
+ "symfony/http-foundation": "~2.4"
+ },
+ "require-dev": {
+ "symfony/http-kernel": "~2.5",
+ "symfony/config": "~2.0"
+ },
+ "suggest": {
+ },
+ "autoload": {
+ "psr-0": { "Symfony\\Component\\HttpProfiler\\": "" }
+ },
+ "target-dir": "Symfony/Component/HttpProfiler",
+ "minimum-stability": "dev",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.5-dev"
+ }
+ }
+}
diff --git a/src/Symfony/Component/HttpProfiler/phpunit.xml.dist b/src/Symfony/Component/HttpProfiler/phpunit.xml.dist
new file mode 100644
index 000000000000..3b86bc024951
--- /dev/null
+++ b/src/Symfony/Component/HttpProfiler/phpunit.xml.dist
@@ -0,0 +1,29 @@
+
+
+
+
+
+ ./Tests/
+
+
+
+
+
+ ./
+
+ ./Tests
+ ./vendor
+
+
+
+
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy