-
-
Save oxyc/d5f62c41b6ed87f743d33c1b3c5a5c30 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Bootstrap; | |
use Illuminate\Config\Repository; | |
use Illuminate\Contracts\Foundation\Application; | |
use Roots\Acorn\Bootstrap\LoadConfiguration as RootsLoadConfiguration; | |
class LoadConfiguration extends RootsLoadConfiguration | |
{ | |
/** | |
* {@inheritdoc} | |
*/ | |
public function bootstrap(Application $app) | |
{ | |
parent::bootstrap($app); | |
// When `wp acorn optimize` runs it will create a cached config.php file | |
// with pre-determined values at build times. This causes issues with | |
// multisite since the config.php file uses get_theme_file_path() which | |
// needs to be dynamically evaluated per site. | |
// Here we override the cached config by re-evaluating the config files. | |
$this->loadConfigurationFiles($app, $app->make('config')); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use App\Bootstrap\LoadConfiguration; | |
use Roots\Acorn\Bootstrap\LoadConfiguration as RootsLoadConfiguration; | |
add_filter('acorn/bootstrap', function (array $bootstrap) { | |
if ($idx = array_search(RootsLoadConfiguration::class, $bootstrap)) { | |
$bootstrap[$idx] = LoadConfiguration::class; | |
} | |
return $bootstrap; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment