Esempio n. 1
0
 /**
  * @group ZF-10033
  */
 public function testSetDefaultMetadataCacheFromCacheManager()
 {
     $this->markTestSkipped('DbResource has fatal error - skip this test now.');
     return;
     $configCache = array('database' => array('frontend' => array('name' => 'Core', 'options' => array('lifetime' => 120, 'automatic_serialization' => true)), 'backend' => array('name' => 'BlackHole')));
     $resource = new CacheManagerResource($configCache);
     $resource->setBootstrap($this->bootstrap);
     $resource->init();
     //$this->bootstrap->registerPluginResource('cachemanager', $configCache);
     $config = array('bootstrap' => $this->bootstrap, 'adapter' => 'Pdo\\Sqlite', 'params' => array('dbname' => ':memory:'), 'defaultMetadataCache' => 'database');
     $resource = new DbResource($config);
     $resource->init();
     $this->assertInstanceOf('Zend\\Cache\\Frontend', \Zend\Db\Table\AbstractTable::getDefaultMetadataCache());
 }
Esempio n. 2
0
 public function testTableSetDefaultMetadataCacheRegistry()
 {
     $cache = $this->_getCache();
     \Zend\Registry::set('registered_metadata_cache', $cache);
     Table\AbstractTable::setDefaultMetadataCache('registered_metadata_cache');
     $this->assertSame($cache, Table\AbstractTable::getDefaultMetadataCache());
 }
Esempio n. 3
0
 /**
  * Gets content panel for the Debugbar
  *
  * @return string
  */
 public function getPanel()
 {
     if (!$this->_db) {
         return '';
     }
     $html = '<h4>Database queries';
     // @TODO: This is always on?
     if (AbstractTable::getDefaultMetadataCache()) {
         $html .= ' – Metadata cache ENABLED';
     } else {
         $html .= ' – Metadata cache DISABLED';
     }
     $html .= '</h4>';
     return $html . $this->getProfile();
 }