{"action":"created","issue":{"url":"https://api.github.com/repos/flarum/core/issues/837","repository_url":"https://api.github.com/repos/flarum/core","labels_url":"https://api.github.com/repos/flarum/core/issues/837/labels{/name}","comments_url":"https://api.github.com/repos/flarum/core/issues/837/comments","events_url":"https://api.github.com/repos/flarum/core/issues/837/events","html_url":"https://github.com/flarum/core/issues/837","id":137337041,"number":837,"title":"Cache clean command","user":{"login":"Luceos","id":504687,"avatar_url":"https://avatars.githubusercontent.com/u/504687?v=3","gravatar_id":"","url":"https://api.github.com/users/Luceos","html_url":"https://github.com/Luceos","followers_url":"https://api.github.com/users/Luceos/followers","following_url":"https://api.github.com/users/Luceos/following{/other_user}","gists_url":"https://api.github.com/users/Luceos/gists{/gist_id}","starred_url":"https://api.github.com/users/Luceos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Luceos/subscriptions","organizations_url":"https://api.github.com/users/Luceos/orgs","repos_url":"https://api.github.com/users/Luceos/repos","events_url":"https://api.github.com/users/Luceos/events{/privacy}","received_events_url":"https://api.github.com/users/Luceos/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/flarum/core/labels/Backend","name":"Backend","color":"eeeeee"},{"url":"https://api.github.com/repos/flarum/core/labels/Feature","name":"Feature","color":"009800"}],"state":"open","locked":false,"assignee":{"login":"franzliedke","id":249125,"avatar_url":"https://avatars.githubusercontent.com/u/249125?v=3","gravatar_id":"","url":"https://api.github.com/users/franzliedke","html_url":"https://github.com/franzliedke","followers_url":"https://api.github.com/users/franzliedke/followers","following_url":"https://api.github.com/users/franzliedke/following{/other_user}","gists_url":"https://api.github.com/users/franzliedke/gists{/gist_id}","starred_url":"https://api.github.com/users/franzliedke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/franzliedke/subscriptions","organizations_url":"https://api.github.com/users/franzliedke/orgs","repos_url":"https://api.github.com/users/franzliedke/repos","events_url":"https://api.github.com/users/franzliedke/events{/privacy}","received_events_url":"https://api.github.com/users/franzliedke/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/flarum/core/milestones/5","html_url":"https://github.com/flarum/core/milestones/0.1.0-beta.6","labels_url":"https://api.github.com/repos/flarum/core/milestones/5/labels","id":1488954,"number":5,"title":"0.1.0-beta.6","description":"","creator":{"login":"tobscure","id":128862,"avatar_url":"https://avatars.githubusercontent.com/u/128862?v=3","gravatar_id":"","url":"https://api.github.com/users/tobscure","html_url":"https://github.com/tobscure","followers_url":"https://api.github.com/users/tobscure/followers","following_url":"https://api.github.com/users/tobscure/following{/other_user}","gists_url":"https://api.github.com/users/tobscure/gists{/gist_id}","starred_url":"https://api.github.com/users/tobscure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobscure/subscriptions","organizations_url":"https://api.github.com/users/tobscure/orgs","repos_url":"https://api.github.com/users/tobscure/repos","events_url":"https://api.github.com/users/tobscure/events{/privacy}","received_events_url":"https://api.github.com/users/tobscure/received_events","type":"User","site_admin":false},"open_issues":72,"closed_issues":4,"state":"open","created_at":"2016-01-07T07:07:44Z","updated_at":"2016-04-03T12:03:55Z","due_on":"2016-05-12T14:30:00Z","closed_at":null},"comments":4,"created_at":"2016-02-29T18:49:21Z","updated_at":"2016-04-03T21:48:36Z","closed_at":null,"body":"Let's re-add some cache cleaning through the artisan command.\r\n\r\nThis will prevent possible \"oops\" issues with users deleting the wrong folders. Folders/files to clear:\r\n\r\n- assets/*.js\r\n- assets/*.css\r\n- storage/cache/* (recursive)"},"comment":{"url":"https://api.github.com/repos/flarum/core/issues/comments/205061120","html_url":"https://github.com/flarum/core/issues/837#issuecomment-205061120","issue_url":"https://api.github.com/repos/flarum/core/issues/837","id":205061120,"user":{"login":"tobscure","id":128862,"avatar_url":"https://avatars.githubusercontent.com/u/128862?v=3","gravatar_id":"","url":"https://api.github.com/users/tobscure","html_url":"https://github.com/tobscure","followers_url":"https://api.github.com/users/tobscure/followers","following_url":"https://api.github.com/users/tobscure/following{/other_user}","gists_url":"https://api.github.com/users/tobscure/gists{/gist_id}","starred_url":"https://api.github.com/users/tobscure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobscure/subscriptions","organizations_url":"https://api.github.com/users/tobscure/orgs","repos_url":"https://api.github.com/users/tobscure/repos","events_url":"https://api.github.com/users/tobscure/events{/privacy}","received_events_url":"https://api.github.com/users/tobscure/received_events","type":"User","site_admin":false},"created_at":"2016-04-03T21:48:36Z","updated_at":"2016-04-03T21:48:36Z","body":"@franzliedke Looking good. Whenever we enable/disable an extension or change the theme we don't just delete *.js and *.css files, we actually use the asset compiler classes to specifically delete the compiled assets. This is safer in case there are any userspace CSS/JS files dropped into the assets directory.\r\n\r\nIt's done by setting up per-client event listeners:\r\nhttps://github.com/flarum/core/blob/master/src/Forum/ForumServiceProvider.php#L145\r\nhttps://github.com/flarum/core/blob/master/src/Admin/AdminServiceProvider.php#L68\r\n\r\nPerhaps the best thing to do here would be to make the cache:clear command fire an event (CacheWasCleared), and then add a listener to the Forum/AdminServiceProviders as above.\r\n\r\nIn addition to assets and the cache store, the command should also clear:\r\n\r\n* The `storage/formatter` directory, which is used [here](https://github.com/flarum/core/blob/master/src/Formatter/Formatter.php#L112). This should also be set up as an event listener in FormatterServiceProvider – the deletion itself should probably be added into the Formatter@flush method.\r\n\r\n* The `storage/tmp` directory (actually, should we be garbage collecting this?)\r\n\r\nRegarding the button in the admin interface, for now let's just add it to the Basics page. Then we can just make it fire the CacheWasCleared event, no?"}}