Skip to content

Commit

Permalink
Minor refactoring in sfCacheContextMissingException, added cache bloc…
Browse files Browse the repository at this point in the history
…ks to lib/doctrine/template/Cachetaggable.class.php
  • Loading branch information
fruit committed Jul 28, 2010
1 parent 9040a7f commit 30d4f18
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 36 deletions.
14 changes: 11 additions & 3 deletions lib/doctrine/template/Cachetaggable.class.php
Expand Up @@ -171,9 +171,17 @@ public function addTags ($tags)
*/
public function addTag ($tagName, $tagVersion)
{
$this
->getContentTagHandler()
->setContentTag($tagName, $tagVersion, $this->getInvokerNamespace());

try
{
$this
->getContentTagHandler()
->setContentTag($tagName, $tagVersion, $this->getInvokerNamespace());
}
catch (sfCacheDisabledException $e)
{

}
}

/**
Expand Down
Expand Up @@ -13,7 +13,7 @@
* @subpackage exception
* @author Ilya Sabelnikov <fruit.dev@gmail.com>
*/
class sfCacheContextMissingException extends sfCacheException
class sfCacheMissingContextException extends sfCacheException
{

}
2 changes: 1 addition & 1 deletion lib/util/sfCacheTaggingToolkit.class.php
Expand Up @@ -36,7 +36,7 @@ public static function getTaggingCache ()

if (! sfContext::hasInstance())
{
throw new sfCacheContextMissingException(
throw new sfCacheMissingContextException(
sprintf('Content is not initialized for "%s"', __CLASS__)
);
}
Expand Down
56 changes: 28 additions & 28 deletions test/data/config/cache_setup.yml
@@ -1,32 +1,32 @@
#-
# class: sfMemcacheCache
# param:
# prefix: sf
# persistent: true
# storeCacheInfo: false
# host: localhost
# port: 11211
# timeout: 1
# lifetime: 900
-
class: sfMemcacheCache
param:
prefix: sf
persistent: true
storeCacheInfo: false
host: localhost
port: 11211
timeout: 1
lifetime: 900
-
class: sfAPCCache
param:
lifetime: 600
#-
# class: sfSQLiteTaggingCache
# param:
# database: <?php echo sfConfig::get('sf_plugins_dir') ?>/sfCacheTaggingPlugin/test/temp/sqlite.db
#-
# class: sfSQLiteTaggingCache
# param:
# database: ":memory:"
#-
# class: sfFileTaggingCache
# param:
# cache_dir: <?php echo sfConfig::get('sf_plugins_dir') ?>/sfCacheTaggingPlugin/test/temp/file
#-
# class: sfEAcceleratorCache
# param: {}
#-
# class: sfXCacheCache
# param: {}
-
class: sfSQLiteTaggingCache
param:
database: <?php echo sfConfig::get('sf_plugins_dir') ?>/sfCacheTaggingPlugin/test/temp/sqlite.db
-
class: sfSQLiteTaggingCache
param:
database: ":memory:"
-
class: sfFileTaggingCache
param:
cache_dir: <?php echo sfConfig::get('sf_plugins_dir') ?>/sfCacheTaggingPlugin/test/temp/file
-
class: sfEAcceleratorCache
param: {}
-
class: sfXCacheCache
param: {}
3 changes: 0 additions & 3 deletions test/functional/frontend/sfDoctrineProxyCacheTest.php
Expand Up @@ -12,9 +12,6 @@

require_once sfConfig::get('sf_symfony_lib_dir') . '/vendor/lime/lime.php';

// $cc = new sfCacheClearTask(sfContext::getInstance()->getEventDispatcher(), new sfFormatter());
// $cc->run();

$t = new lime_test();

$connection = Doctrine::getConnectionByTableName('BlogPost');
Expand Down

0 comments on commit 30d4f18

Please sign in to comment.