{"action":"created","issue":{"url":"https://api.github.com/repos/manifoldco/manifold-laravel/issues/24","repository_url":"https://api.github.com/repos/manifoldco/manifold-laravel","labels_url":"https://api.github.com/repos/manifoldco/manifold-laravel/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/manifoldco/manifold-laravel/issues/24/comments","events_url":"https://api.github.com/repos/manifoldco/manifold-laravel/issues/24/events","html_url":"https://github.com/manifoldco/manifold-laravel/pull/24","id":389099967,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3MTc2Njk3","number":24,"title":"Framework upgrade/5.7 cache rework","user":{"login":"webbtj","id":865814,"node_id":"MDQ6VXNlcjg2NTgxNA==","avatar_url":"https://avatars3.githubusercontent.com/u/865814?v=4","gravatar_id":"","url":"https://api.github.com/users/webbtj","html_url":"https://github.com/webbtj","followers_url":"https://api.github.com/users/webbtj/followers","following_url":"https://api.github.com/users/webbtj/following{/other_user}","gists_url":"https://api.github.com/users/webbtj/gists{/gist_id}","starred_url":"https://api.github.com/users/webbtj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webbtj/subscriptions","organizations_url":"https://api.github.com/users/webbtj/orgs","repos_url":"https://api.github.com/users/webbtj/repos","events_url":"https://api.github.com/users/webbtj/events{/privacy}","received_events_url":"https://api.github.com/users/webbtj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-12-10T01:51:24Z","updated_at":"2018-12-11T14:39:04Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/manifoldco/manifold-laravel/pulls/24","html_url":"https://github.com/manifoldco/manifold-laravel/pull/24","diff_url":"https://github.com/manifoldco/manifold-laravel/pull/24.diff","patch_url":"https://github.com/manifoldco/manifold-laravel/pull/24.patch"},"body":"This is to address \"load order\" issues within Laravel.\r\n\r\n### Background\r\nThe original build was intended to make Manifold configs available from the API. It was not intended that these configs could be accessed from within _other_ application configuration files, this is a restriction of Laravel and how it loads configuration files. As of version 5.7 (possibly 5.6?) configuration files are loaded alphabetically. Additionally, the configurations fetched from the Manifold API were populated in this package's service provider's boot method, which happens after \"regular\" configs are loaded.\r\n\r\nJust to be clear, Laravel does not intend for users to use the `config()` helper within config files at all, however we're going to make that a possibility with Manifold configs.\r\n\r\n### The Solution\r\nStep one is to \"name-hack\" the Manifold config file, it is now `00-manifold.php`, to ensure it loads first. Next is the `01-manifold.php` file, it should run immediately after `00-manifold.php` and it replaces the call to `Core`'s `load_configs()` originally found in the service provider boot method. This ensures that variables are populated from the Manifold API before other configs are loaded.\r\n\r\n### Caching\r\nThis was a tricky nut to crack. Originally, `load_configs()` was called from the service provider boot, which happened after configs were loaded, which made it possible to use Facades such as `Cache`, which is how we previously stored cached data from the API so as not to make server calls _every_ time the app booted. However, since we're now calling `load_configs()` much sooner, we no longer have access to any facades, nor can we even access the underlying classes for things like cache and storage because those also require the app to be fully instantiated so as to identify the storage engine to use. Because of this, we now have a custom, file-system based cache solution, exclusive to this package. This is the third file (`.manifold.cache.key`) that gets created via `vendor:publish`ing and is stored in the storage path. If, after publishing, this file cannot be written to (for example, created by the wrong user, no write permissions) everything will still function as normal, except that nothing will be cached and every app boot will require API requests."},"comment":{"url":"https://api.github.com/repos/manifoldco/manifold-laravel/issues/comments/446224945","html_url":"https://github.com/manifoldco/manifold-laravel/pull/24#issuecomment-446224945","issue_url":"https://api.github.com/repos/manifoldco/manifold-laravel/issues/24","id":446224945,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NjIyNDk0NQ==","user":{"login":"saschat","id":7301779,"node_id":"MDQ6VXNlcjczMDE3Nzk=","avatar_url":"https://avatars2.githubusercontent.com/u/7301779?v=4","gravatar_id":"","url":"https://api.github.com/users/saschat","html_url":"https://github.com/saschat","followers_url":"https://api.github.com/users/saschat/followers","following_url":"https://api.github.com/users/saschat/following{/other_user}","gists_url":"https://api.github.com/users/saschat/gists{/gist_id}","starred_url":"https://api.github.com/users/saschat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saschat/subscriptions","organizations_url":"https://api.github.com/users/saschat/orgs","repos_url":"https://api.github.com/users/saschat/repos","events_url":"https://api.github.com/users/saschat/events{/privacy}","received_events_url":"https://api.github.com/users/saschat/received_events","type":"User","site_admin":false},"created_at":"2018-12-11T14:39:04Z","updated_at":"2018-12-11T14:39:04Z","author_association":"NONE","body":"@PLaRoche I did and it still fails when the expiration is in the past. I added a comment where I think the bug lies."}}
{"actor":{"display_login":"saschat"}}