Nette 2.3.0 beta: Nette\Caching\Storages\FileStorage
Upozornění: Tohle vlákno je hodně staré a informace nemusí být platné pro současné Nette.
- motorcb
- Člen | 552
Upgradoval jsem na Nette 2.3.0 beta. A tracy mi hlásí tuto chybu:
Nette\DI\ServiceCreationException
Service ‚55_App_Router_CachedDatabaseRouterHelper‘: Service of type Nette\Caching\Storages\FileStorage needed by App\Router\CachedDatabaseRouterHelper::__construct() not found. Did you register it in configuration file?
config.neon:
services:
- App\Factory\ContainerLocatorFactory
- App\RouterFactory
- App\Router\CachedDatabaseRouterHelper
- App\Factory\SearchFactory
CachedDatabaseRouterHelper.php:
<?php
namespace App\Router;
use App;
use Nette;
class CachedDatabaseRouterHelper extends Nette\Object
{
/** @var App\Model\User*/
protected $userRepository;
protected $cache;
public function __construct( App\Model\User $userRepository, Nette\Caching\Storages\FileStorage $storage )
{
$this->userRepository= $userRepository;
$this->cache = new Nette\Caching\Cache( $storage, 'CachedDatabaseRouterHelper' ); // Klidně té Cache dej lepší namespace… ;)
}
//moje funkce...
}
Co je špatně?