Skip to content
This repository was archived by the owner on Jan 8, 2024. It is now read-only.

Commit 05ea70c

Browse files
committed
Updated project structure by putting all sources in "src" directory
1 parent 1333f4a commit 05ea70c

31 files changed

+374
-19
lines changed

composer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,14 @@
2828
],
2929
"require": {
3030
"symfony/framework-bundle": "^3.4|^4.0",
31+
"symfony/console": "^3.4|^4.0",
32+
"symfony/dependency-injection": "^3.4|^4.0",
3133
"phpfastcache/phpfastcache": "^7.0"
3234
},
35+
"suggest": {
36+
"symfony/web-profiler-bundle": "To use the data collector."
37+
},
3338
"autoload": {
34-
"psr-4": { "Phpfastcache\\Bundle\\": "" }
39+
"psr-4": { "Phpfastcache\\Bundle\\": "src/" }
3540
}
3641
}
File renamed without changes.

DataCollector/CacheCollector.php renamed to src/DataCollector/CacheCollector.php

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
namespace Phpfastcache\Bundle\DataCollector;
1818

19-
use Phpfastcache\Api as phpFastCacheApi;
20-
use Phpfastcache\Bundle\phpFastCacheBundle;
21-
use Phpfastcache\Bundle\Service\Cache;
19+
use Phpfastcache\Api as PhpfastcacheApi;
20+
use Phpfastcache\Bundle\PhpfastcacheBundle;
21+
use Phpfastcache\Bundle\Service\Phpfastcache;
2222
use Phpfastcache\CacheManager;
2323
use Symfony\Component\HttpFoundation\Request;
2424
use Symfony\Component\HttpFoundation\Response;
@@ -27,7 +27,7 @@
2727
class CacheCollector extends DataCollector
2828
{
2929
/**
30-
* @var \Phpfastcache\Bundle\Service\Cache
30+
* @var \Phpfastcache\Bundle\Service\Phpfastcache
3131
*/
3232
private $cache;
3333

@@ -39,9 +39,9 @@ class CacheCollector extends DataCollector
3939
/**
4040
* CacheCollector constructor.
4141
*
42-
* @param \Phpfastcache\Bundle\Service\Cache $cache
42+
* @param \Phpfastcache\Bundle\Service\Phpfastcache $cache
4343
*/
44-
public function __construct(Cache $cache)
44+
public function __construct(Phpfastcache $cache)
4545
{
4646
$this->cache = $cache;
4747
}
@@ -66,16 +66,17 @@ public function collect(Request $request, Response $response, \Exception $except
6666
$stats[ $instanceName ] = $cache->getStats();
6767
$instances[ $instanceName ] = [
6868
'driverName' => $cache->getDriverName(),
69-
'driverConfig' => $cache->getConfig(),
69+
'driverConfig' => $cache->getConfig()->toArray(),
7070
];
7171
$driverUsed[ $cache->getDriverName() ] = get_class($cache);
7272
}
7373

7474
$this->data = [
7575
'twigCacheBlocks' => $this->twig_cache_blocks,
76-
'apiVersion' => phpFastCacheApi::getVersion(),
76+
'apiVersion' => PhpfastcacheApi::getVersion(),
77+
'pfcVersion' => PhpfastcacheApi::getPhpFastCacheVersion(),
7778
'bundleVersion' => phpFastCacheBundle::VERSION,
78-
'apiChangelog' => phpFastCacheApi::getChangelog(),
79+
'apiChangelog' => PhpfastcacheApi::getChangelog(),
7980
'driverUsed' => $driverUsed,
8081
'instances' => $instances,
8182
'stats' => $stats,
@@ -85,7 +86,8 @@ public function collect(Request $request, Response $response, \Exception $except
8586
'write' => (int) CacheManager::$WriteHits,
8687
],
8788
'coreConfig' => [
88-
'namespacePath' => CacheManager::getNamespacePath(),
89+
'driverList' => CacheManager::getDriverList(true),
90+
'namespacePath (deprecated)' => CacheManager::getNamespacePath(true),
8991
],
9092
'projectConfig' => [
9193
'twig_driver' => $this->cache->getConfig()['twig_driver'],
@@ -158,6 +160,14 @@ public function getApiVersion()
158160
return $this->data[ 'apiVersion' ];
159161
}
160162

163+
/**
164+
* @return mixed
165+
*/
166+
public function getPfcVersion()
167+
{
168+
return $this->data[ 'pfcVersion' ];
169+
}
170+
161171
/**
162172
* @return mixed
163173
*/

PhpfastcacheBundle.php renamed to src/PhpfastcacheBundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@
2323
*/
2424
class PhpfastcacheBundle extends Bundle
2525
{
26-
const VERSION = '1.0.4';
26+
const VERSION = '3.0.0-alpha';
2727
}
File renamed without changes.

0 commit comments

Comments
 (0)