{"action":"created","issue":{"url":"https://api.github.com/repos/drush-ops/drush/issues/1036","labels_url":"https://api.github.com/repos/drush-ops/drush/issues/1036/labels{/name}","comments_url":"https://api.github.com/repos/drush-ops/drush/issues/1036/comments","events_url":"https://api.github.com/repos/drush-ops/drush/issues/1036/events","html_url":"https://github.com/drush-ops/drush/issues/1036","id":51033400,"number":1036,"title":"Allow altering of cache class even if site alias is not used.","user":{"login":"laurentiu1981","id":1889170,"avatar_url":"https://avatars.githubusercontent.com/u/1889170?v=3","gravatar_id":"","url":"https://api.github.com/users/laurentiu1981","html_url":"https://github.com/laurentiu1981","followers_url":"https://api.github.com/users/laurentiu1981/followers","following_url":"https://api.github.com/users/laurentiu1981/following{/other_user}","gists_url":"https://api.github.com/users/laurentiu1981/gists{/gist_id}","starred_url":"https://api.github.com/users/laurentiu1981/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laurentiu1981/subscriptions","organizations_url":"https://api.github.com/users/laurentiu1981/orgs","repos_url":"https://api.github.com/users/laurentiu1981/repos","events_url":"https://api.github.com/users/laurentiu1981/events{/privacy}","received_events_url":"https://api.github.com/users/laurentiu1981/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2014-12-04T21:44:46Z","updated_at":"2015-05-06T13:27:27Z","closed_at":null,"body":"Is there any way to force a specific drushrc.php config file for a drush command in versions of drush greater than 6.3?\r\n\r\nOnce you removed these lines: https://github.com/drush-ops/drush/blob/6.2.0/includes/sitealias.inc#L279-L282, \r\ncombined with this line in bootstrap.inc:\r\nhttps://github.com/drush-ops/drush/blob/6.x/includes/bootstrap.inc#L505\r\nright before the line that loads the config... you avoided any way in setting a default cache class for drush.\r\n\r\nThat's because at some point you are looking for cached aliases, so **drush_cache_get** is called and cache object is initialized, that's a static variable:\r\nhttps://github.com/drush-ops/drush/blob/6.x/includes/cache.inc#L40-L51\r\nHaving no config loaded... default DrushJSONCache class is used to create cache object.\r\n \r\nPreviously a default config file was set in sitealias.inc (sites/default/drushrc.php) when you looked up for aliases, see again: https://github.com/drush-ops/drush/blob/6.2.0/includes/sitealias.inc#L279-L282\r\n\r\nNow... even if I alter the default cache class in drushrc.php, by using \r\n```\r\n$options['cache-default-class'] = 'CustomCacheClass';\r\n```\r\nor\r\n```\r\n$options['cache-class-default'] = 'CustomCacheClass';\r\n```\r\nthe default class will be DrushJSONCache initially.\r\n\r\nDo you see any way to alter the cache class even if I don't use site aliases?\r\n\r\nE.g. By running: **drush** **sitefolder** **command** everything is fine, but if I run only **drush** **command** from root folder of drupal, the cache class is not altered early enough."},"comment":{"url":"https://api.github.com/repos/drush-ops/drush/issues/comments/99458326","html_url":"https://github.com/drush-ops/drush/issues/1036#issuecomment-99458326","issue_url":"https://api.github.com/repos/drush-ops/drush/issues/1036","id":99458326,"user":{"login":"greg-1-anderson","id":612191,"avatar_url":"https://avatars.githubusercontent.com/u/612191?v=3","gravatar_id":"","url":"https://api.github.com/users/greg-1-anderson","html_url":"https://github.com/greg-1-anderson","followers_url":"https://api.github.com/users/greg-1-anderson/followers","following_url":"https://api.github.com/users/greg-1-anderson/following{/other_user}","gists_url":"https://api.github.com/users/greg-1-anderson/gists{/gist_id}","starred_url":"https://api.github.com/users/greg-1-anderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greg-1-anderson/subscriptions","organizations_url":"https://api.github.com/users/greg-1-anderson/orgs","repos_url":"https://api.github.com/users/greg-1-anderson/repos","events_url":"https://api.github.com/users/greg-1-anderson/events{/privacy}","received_events_url":"https://api.github.com/users/greg-1-anderson/received_events","type":"User","site_admin":false},"created_at":"2015-05-06T13:27:27Z","updated_at":"2015-05-06T13:27:27Z","body":"Maybe it would work to tie this functionality to the site-local Drush feature -- that is, if Drush is included in the composer.json of the Drupal site it is associated with (or just exists inside the Drupal root), then we identify the Drupal site early and lock it in.  See #1340."}}