Bake Module configuration files.

@param string $name Module name
@return void
429281
private function bakeModuleConfig(string $name) : void
    {
        $options = [
            'path' => Configure::read('CsvMigrations.modules.path') . $name . DS . 'config' . DS,
            'ext' => 'json'
        ];

        $this->bake('config.dist', 'Module/config/config', [], '', $options);
        $this->bake('fields.dist', 'Module/config/fields', [], '', $options);
        $this->bake(
            'menus.dist',
            'Module/config/menus',
            ['label' => Inflector::humanize($name), 'url' => DS . Inflector::dasherize($name) . DS],
            '',
            $options
        );
    }
1151024
public function yield(string $name): void
    {
        if (empty($this->sections[$name])) {
            // do nothing
        } else {
            echo $this->sections[$name];
        }
    }
651565
private function build(string $name): BuildCommand
    {
        /*
         * We prepare the application for a build, moving it to production. Then,
         * after compile all the code to a single file, we move the built file
         * to the builds folder with the correct permissions.
         */
        $this->prepare()
            ->compile($name)
            ->clear();

        $this->output->writeln(
            sprintf('    Compiled successfully: <fg=green>%s</>', $this->app->buildsPath($name))
        );

        return $this;
    }
1171184
public function set(string $name, ResponseCookieInterface $responseCookie): void
    {
        $this->responseCookies[$name] = $responseCookie;
    }
1085272
public function clear($name)
    {
        if (!in_array($name, $this->clearedCookies, true)) {
            $this->clearedCookies[] = $name;
            foreach ($this->cookies as $index => $value) {
                if ($value->getName() === $name) {
                    unset($this->cookies[$index]);
                }
            }
            $this->cookies = array_values($this->cookies);
        }
    }
1195952
public function &load(string $name) : ModularAbstract
    {
        $modular =& $this->internalGetModular($name);
        if (!$this->hasLoaded($name)) {
            $modular->init();
            $this->loadedModular[$this->sanitizeModularName($name)] = true;
        }

        return $modular;
    }
173283
public static function createMigration(string $name): void
    {
        $directory = Application::getApplicationPath('migrations');

        if (!is_dir($directory)) {
            Directory::mkdir($directory, 0755);
        }

        $timestamp = time();
        $className = Util::camelCase($name, null, false);
        $phpClassName = "Migration_{$timestamp}_{$className}";
        $fileName = "{$timestamp}_{$className}.php";
        $fullPath = Application::getApplicationPath("migrations/{$fileName}");

        $migrationFileContent = file_get_contents(__DIR__ . '/MigrationTemplate.php');
        $migrationFileContent = str_replace('templateClassName', $phpClassName, $migrationFileContent);
        $migrationFileContent = str_replace('templateClassGenerated', date('r'), $migrationFileContent);

        if (file_put_contents($fullPath, $migrationFileContent) === false) {
            throw new Application\Exception("Unable to write to migration file on path={$fullPath}");
        }

        Log::info("Created DB migration with name: {$name}");
        Log::info("You may now open application/migrations/{$fileName} and add your migration code");
    }
1120483
public function target($name)
    {
        if (!$this->config->hasTarget($name)) {
            throw new RuntimeException("The target named '$name' does not exist.");
        }
        $ext = $this->config->getExt($name);

        $themed = $this->config->isThemed($name);
        $filters = $this->config->targetFilters($name);
        $target = $this->config->cachePath($ext) . $name;

        $files = [];
        $scanner = $this->scanner($this->config->paths($ext, $name));
        $paths = $scanner->paths();

        $required = $this->config->requires($name);
        if ($required) {
            $compiler = $this->cachedCompiler();
            foreach ($required as $dependency) {
                $files[] = new Target($this->target($dependency), $compiler);
            }
        }

        foreach ($this->config->files($name) as $file) {
            if (preg_match('#^https?://#', $file)) {
                $files[] = new Remote($file);
            } else {
                if (preg_match('/(.*\/)(\*.*?)$/U', $file, $matches)) {
                    $path = $scanner->find($matches[1]);
                    if ($path === false) {
                        throw new RuntimeException("Could not locate folder $file for $name in any configured path.");
                    }
                    $glob = new Glob($path, $matches[2]);
                    $files = array_merge($files, $glob->files());
                } elseif (preg_match(static::CALLBACK_PATTERN, $file, $matches)) {
                    $callback = new Callback($matches[1], $matches[2], $scanner);
                    $files = array_merge($files, $callback->files());
                } else {
                    $path = $scanner->find($file);
                    if ($path === false) {
                        throw new RuntimeException("Could not locate $file for $name in any configured path.");
                    }
                    $files[] = new Local($path);
                }
            }
        }
        return new AssetTarget($target, $files, $filters, $paths, $themed);
    }
2919
public function loadConfigs(...$names)
    {
        /** @var Config $config */
        $config = $this->make(Config::class);
        foreach ($names as $name) {
            $config->load($name);
        }
    }
234605
public function section($name)
    {
        if (isset($this->sections[$name])) {
            $section = $this->sections[$name];
            unset($this->sections[$name]);
        } else {
            $section = new Section($name);
        }

        $this->sections[$name] = $section;

        $section->start();
    }
69564
protected function createJsonConfig($name)
    {
        if ($this->files->exists($path = $this->getJsonPath())) {
            $this->error('Widget json config already exists!');

            return;
        }

        $stub = $this->files->get($this->getJsonStubPath());
        $stub = $this->replaceNamespace($stub, $name)->replaceClass($stub, $name);
        $stub = $this->replaceFQCN($stub, $name);
        $stub = $this->replaceView($stub);

        $this->files->put($path, $stub);

        $this->info('Json config created successfully.');
    }
1097122
protected function setConfigurationFile(string $name, array $headers)
    {
        $this->info('Set plugin configuration...');

        $prefix = trim($headers['plugin_prefix'], '\/_-');
        $from = $this->path($name.'/config/prefix_plugin.php');
        $to = $this->path($name.'/config/'.$prefix.'_plugin.php');

        $this->files->move($from, $to);
        $this->replaceFileContent($to, $headers);
    }
488936
public function removeConfiguration(string $name): void
	{
		unset($this->configurations[$name], $this->connections[$name]);
	}
28089
protected function buildClass($name)
    {
        $stub = parent::buildClass($name);

        $this->createJsonConfig($name);

        return $stub;
    }
907458
public function package(string $name): void
    {
        $files = $this->app->make('files');

        if (\method_exists($this->app, 'vendorPath')) {
            $vendorPath = \rtrim($this->app->vendorPath(), '/');
        } else {
            $basePath = \rtrim($this->app->basePath(), '/');
            $vendorPath = "{$basePath}/vendor";
        }

        $paths = [
            "{$vendorPath}/{$name}/resources/database/migrations/",
            "{$vendorPath}/{$name}/database/migrations/",
            "{$vendorPath}/{$name}/migrations/",
        ];

        foreach ($paths as $path) {
            if ($files->isDirectory($path)) {
                $this->run($path);
            }
        }
    }
1012625
private function loadLanguageFile($name)
    {
        /** @var System $system */
        $system = $this->framework->getAdapter(System::class);
        $system->loadLanguageFile($name);
    }
1207732
public function set( $name, $value )
	{
		$parts = explode( '/', trim( $name, '/' ) );
		$this->_config = $this->_set( $this->_config, $parts, $value );
	}