Skip to content

Conversation

@Nyholm
Copy link
Member

@Nyholm Nyholm commented Mar 23, 2016

Added class for normalize keys. This will fix php-cache/issues#49

@codecov-io
Copy link

Current coverage is 21.91%

Merging #56 into master will increase coverage by +0.43% as of ea08a81

@@            master     #56   diff @@
======================================
  Files           18      19     +1
  Stmts          726     730     +4
  Branches         0       0       
  Methods         85      87     +2
======================================
+ Hit            156     160     +4
  Partial          0       0       
  Missed         570     570       

Review entire Coverage Diff as of ea08a81

Powered by Codecov. Updated on successful CI builds.

@cryptiklemur
Copy link
Member

I'm not sure this is entirely the best idea.... If we go this route, it should be togglable, and disabled by default.

@Nyholm
Copy link
Member Author

Nyholm commented Mar 23, 2016

Hm, but we should do something to prevent invalid chars. See php-cache/issues#49

Im open to suggestions.

@cryptiklemur
Copy link
Member

The issue we run into, is changing people's keys on the fly, without telling them. Could lead to issues where people check for the keys, and not being able to find them.

I think, if we made this togglable, it'd be fine. So the user would specifically have to ask for cleaned keys

@Nyholm
Copy link
Member Author

Nyholm commented Mar 23, 2016

Okej. So it is the migration you are worried about? Not the solution?

I think migration is not going to be a problem. This PR is only removing invalid keys (ref). This will only avoid an exception from being thrown. Nobody will get a stored key changed.

@cryptiklemur cryptiklemur merged commit 7ecb7b4 into master Mar 26, 2016
@Nyholm Nyholm deleted the normalizer branch March 29, 2016 07:49
@PaddyLock
Copy link

PaddyLock commented Sep 1, 2016

Hi, I have recently updated my set of packages to include this fix:

"cache/doctrine-adapter": "0.5.",
"cache/psr-6-doctrine-bridge": "2.1.",
"cache/cache-bundle": "0.4.3",
"cache/adapter-bundle": "0.3.",
"cache/memcached-adapter": "0.3.",
"cache/taggable-cache": "0.4.*",
"cache/hierarchical-cache": "0.2.1",
"cache/adapter-common": "0.3.0"

However, I still get the following error when clearing my cache

Invalid key: "[Helios\CoreBundle\Entity\User$CLASSMETADATA][1]". The key contains one or more characters reserved for future extension: {}()/\@:

I have also tried with this set of packages:

"cache/psr-6-doctrine-bridge": "dev-master",
"cache/cache-bundle": "dev-master",
"cache/adapter-bundle": "dev-master",
"cache/memcached-adapter": "dev-master",

but I get this error:

Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'Cache\Adapter\Memcached\MemcachedCachePool' does not have a method 'clearTags'

My config looks like this:

cache:
  doctrine:
    enabled: true
    use_tagging: true
    metadata:
      service_id: 'cache.provider.default_memcached'
      entity_managers:   [ default ]       # the name of your entity_manager connection
      document_managers: [ default ]       # the name of your document_manager connection
    result:
      service_id: 'cache.provider.default_memcached'
      entity_managers:   [ default, read ] # you may specify multiple entity_managers
    query:
      service_id: 'cache.provider.default_memcached'
      entity_managers: [ default ]
  router:
    enabled: true
    service_id: cache.provider.default_memcached
    ttl: 86400

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid key Uncaught PHP Exception

5 participants