The
config_path
function returns the fully qualified path to your application's config
directory. You may also use the config_path
function to generate a fully qualified path to a given file within the application's configuration directory:<?php $path = config_path();
$path = config_path('app.php');
<?php protected function writeSiteConfig($config)
{
$contents = File::get($path = config_path('statamic/sites.php'));
$newConfig = $this->newSiteConfigs->map(function ($config, $site) {
<?php }
$filesystemsPath = config_path('filesystems.php');
$config = $this->files->get($filesystemsPath);
$diskRegex = "/\s{8}['\"]{$disk}['\"]\X*\s{8}\],?+\n\n?+/mU";
$updatedConfig = preg_replace($diskRegex, '', $config);
<?php protected function resetStatamicConfigs()
{
$this->files->cleanDirectory(config_path('statamic'));
$this->files->copyDirectory(__DIR__.'/../../../config', config_path('statamic'));
$this->files->copy(__DIR__.'/stubs/config/stache.php.stub', config_path('statamic/stache.php'));
<?php {
$this->files->cleanDirectory(config_path('statamic'));
$this->files->copyDirectory(__DIR__.'/../../../config', config_path('statamic'));
$this->files->copy(__DIR__.'/stubs/config/stache.php.stub', config_path('statamic/stache.php'));
$this->files->copy(__DIR__.'/stubs/config/users.php.stub', config_path('statamic/users.php'));
<?php $this->files->cleanDirectory(config_path('statamic'));
$this->files->copyDirectory(__DIR__.'/../../../config', config_path('statamic'));
$this->files->copy(__DIR__.'/stubs/config/stache.php.stub', config_path('statamic/stache.php'));
$this->files->copy(__DIR__.'/stubs/config/users.php.stub', config_path('statamic/users.php'));
$this->info('Statamic configs reset successfully.');
<?php $this->files->copyDirectory(__DIR__.'/../../../config', config_path('statamic'));
$this->files->copy(__DIR__.'/stubs/config/stache.php.stub', config_path('statamic/stache.php'));
$this->files->copy(__DIR__.'/stubs/config/users.php.stub', config_path('statamic/users.php'));
$this->info('Statamic configs reset successfully.');
<?php private function hasPublishedConfig()
{
return $this->app['files']->exists(config_path('graphql.php'));
}
private function addMiddleware()
<?php $str = '<?php return '.VarExporter::export($config).';';
File::put(config_path('statamic/editions.php'), $str);
}
}
<?php $this->mergeConfigFrom($origin, $filename);
$this->publishes([
$origin => config_path("{$filename}.php"),
], "{$filename}-config");
return $this;
<?php $this->loadViewsFrom("{$this->root}/resources/views", 'statamic');
collect($this->configFiles)->each(function ($config) {
$this->publishes(["{$this->root}/config/$config.php" => config_path("statamic/$config.php")], 'statamic');
});
$this->publishes([
<?php public static function enablePro()
{
$path = config_path('statamic/editions.php');
$contents = File::get($path);
<?php public function it_overwrites_files()
{
$this->assertFileExists(config_path('filesystems.php'));
$this->assertFileDoesntHaveContent('bobsled_pics', config_path('filesystems.php'));
$this->installCoolRunnings();
<?php public function it_overwrites_files()
{
$this->assertFileExists(config_path('filesystems.php'));
$this->assertFileDoesntHaveContent('bobsled_pics', config_path('filesystems.php'));
$this->installCoolRunnings();
<?php $this->installCoolRunnings();
$this->assertFileHasContent('bobsled_pics', config_path('filesystems.php'));
}