{"action":"created","issue":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/6919","labels_url":"https://api.github.com/repos/cakephp/cakephp/issues/6919/labels{/name}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/6919/comments","events_url":"https://api.github.com/repos/cakephp/cakephp/issues/6919/events","html_url":"https://github.com/cakephp/cakephp/issues/6919","id":92326468,"number":6919,"title":"3.x Can't use dot in a cache config","user":{"login":"davidyell","id":49889,"avatar_url":"https://avatars.githubusercontent.com/u/49889?v=3","gravatar_id":"","url":"https://api.github.com/users/davidyell","html_url":"https://github.com/davidyell","followers_url":"https://api.github.com/users/davidyell/followers","following_url":"https://api.github.com/users/davidyell/following{/other_user}","gists_url":"https://api.github.com/users/davidyell/gists{/gist_id}","starred_url":"https://api.github.com/users/davidyell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidyell/subscriptions","organizations_url":"https://api.github.com/users/davidyell/orgs","repos_url":"https://api.github.com/users/davidyell/repos","events_url":"https://api.github.com/users/davidyell/events{/privacy}","received_events_url":"https://api.github.com/users/davidyell/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cakephp/cakephp/labels/Defect","name":"Defect","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/cakephp/cakephp/milestones/47","html_url":"https://github.com/cakephp/cakephp/milestones/3.0.9","labels_url":"https://api.github.com/repos/cakephp/cakephp/milestones/47/labels","id":1184300,"number":47,"title":"3.0.9","description":"Bugfixes and minor improvements for 3.0.x","creator":{"login":"markstory","id":24086,"avatar_url":"https://avatars.githubusercontent.com/u/24086?v=3","gravatar_id":"","url":"https://api.github.com/users/markstory","html_url":"https://github.com/markstory","followers_url":"https://api.github.com/users/markstory/followers","following_url":"https://api.github.com/users/markstory/following{/other_user}","gists_url":"https://api.github.com/users/markstory/gists{/gist_id}","starred_url":"https://api.github.com/users/markstory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markstory/subscriptions","organizations_url":"https://api.github.com/users/markstory/orgs","repos_url":"https://api.github.com/users/markstory/repos","events_url":"https://api.github.com/users/markstory/events{/privacy}","received_events_url":"https://api.github.com/users/markstory/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":5,"state":"open","created_at":"2015-06-28T17:20:20Z","updated_at":"2015-07-01T09:50:51Z","due_on":"2015-07-12T04:00:00Z","closed_at":null},"comments":4,"created_at":"2015-07-01T09:23:43Z","updated_at":"2015-07-01T12:01:52Z","closed_at":null,"body":"**What I did**\r\n```php\r\n\\Cake\\Cache\\Cache::config('CurrencyExchange.ratesCache', [\r\n    'className' => 'File',\r\n    'path' => CACHE,\r\n    'duration' => '+1 year',\r\n    'prefix' => 'currency_exchange_'\r\n]);\r\n```\r\n\r\n**What happened?**\r\nI got a PHP Fatal for trying to use `write()` on a non-object.\r\n\r\n**What's going on?**\r\nThe Cache class `write()` method calls `engine()` to build the cache engine, which calls `_buildEngine()`, which in turn calls [`static::$_registry->load($name, $config);`](https://github.com/cakephp/cakephp/blob/master/src/Cache/Cache.php#L135)`.\r\n\r\nIn the [`ObjectRegistry` class, the `$objectName` is parsed using `pluginSplit()`](https://github.com/cakephp/cakephp/blob/master/src/Core/ObjectRegistry.php#L72) which removes the first part of the cache config name. This means that the loaded object never matches with the config in the cache class. `CurrencyExchange.ratesCache != ratesCache`\r\n\r\n**How I got around it**\r\nI updated my cache config from `CurrencyExchange.ratesCache` to `CurrencyExchange_ratesCache`"},"comment":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/comments/117633924","html_url":"https://github.com/cakephp/cakephp/issues/6919#issuecomment-117633924","issue_url":"https://api.github.com/repos/cakephp/cakephp/issues/6919","id":117633924,"user":{"login":"lorenzo","id":37621,"avatar_url":"https://avatars.githubusercontent.com/u/37621?v=3","gravatar_id":"","url":"https://api.github.com/users/lorenzo","html_url":"https://github.com/lorenzo","followers_url":"https://api.github.com/users/lorenzo/followers","following_url":"https://api.github.com/users/lorenzo/following{/other_user}","gists_url":"https://api.github.com/users/lorenzo/gists{/gist_id}","starred_url":"https://api.github.com/users/lorenzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorenzo/subscriptions","organizations_url":"https://api.github.com/users/lorenzo/orgs","repos_url":"https://api.github.com/users/lorenzo/repos","events_url":"https://api.github.com/users/lorenzo/events{/privacy}","received_events_url":"https://api.github.com/users/lorenzo/received_events","type":"User","site_admin":false},"created_at":"2015-07-01T12:01:52Z","updated_at":"2015-07-01T12:01:52Z","body":"@robertpustulka that should be the right thing to do"}}