/** * Constructor. * * @param t3lib_db $db The t3lib_db connection. * @param Tx_CabagExtbase_Utility_Logging $log The logging object. * @param t3lib_cache_frontend_AbstractFrontend $cache The cache to use. * @param string $tag The local tag to use while caching. */ public function __construct(t3lib_db $db, Tx_CabagExtbase_Utility_Logging $log, $cache, $tag = 'ContentRepository') { if (!$cache instanceof t3lib_cache_frontend_AbstractFrontend && !$cache instanceof \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend) { throw new Exception('Cache must be of type t3lib_cache_frontend_AbstractFrontend or \\TYPO3\\CMS\\Core\\Cache\\Frontend\\VariableFrontend, ' . get_class($cache) . ' given!', 1407143798); } $this->db = $db; $this->log = $log; $this->cache = $cache; $this->tag = $tag; $res = $db->sql_query('SELECT DATABASE();'); if (($row = $db->sql_fetch_row($res)) !== false) { $this->database = current($row); } }