Skip to content

Commit c3e8024

Browse files
authored
Merge pull request #188 from brefphp/allow-pre-caching
Allow pre-compiling views before deployment
2 parents 33ea14c + c83f671 commit c3e8024

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/BrefServiceProvider.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ public function register()
4545

4646
Config::set('trustedproxy.proxies', ['0.0.0.0/0', '2000:0:0:0:0:0:0:0/3']);
4747

48-
Config::set('view.compiled', StorageDirectories::Path . '/framework/views');
48+
// If the views were not compiled yet, move them to a writable directory
49+
$currentCompiledPath = Config::get('view.compiled');
50+
if (! is_string($currentCompiledPath) || ! is_dir($currentCompiledPath)) {
51+
Config::set('view.compiled', StorageDirectories::Path . '/framework/views');
52+
}
53+
4954
Config::set('cache.stores.file.path', StorageDirectories::Path . '/framework/cache');
5055

5156
$this->fixAwsCredentialsConfig();

0 commit comments

Comments
 (0)