Generates the index route.

@param ResourceConfiguration $config
@return void
512248
protected function generateGetAll(ResourceConfiguration $config)
    {
        $that = $this;

        $this->slim->get($this->baseRoute($config), function () use ($that) {
            $that->executeRoute('index', func_get_args());
        });
    }
1074386
protected function generatePut(ResourceConfiguration $config)
    {
        $that = $this;

        $this->slim->put("{$this->baseRoute($config)}/:id", function () use ($that) {
            $that->executeRoute('update', func_get_args());
        });
    }
255005
public function loadReadOnlyRoutes($service, $resource, $serviceConfig)
    {

        $actionOptions = ActionUtils::getRouteOptions($service, $serviceConfig);
        $this->routes->add($resource . '.options', $actionOptions);

        $actionOptionsNoSlash = ActionUtils::getRouteOptions($service, $serviceConfig);
        $actionOptionsNoSlash->setPath(substr($actionOptionsNoSlash->getPath(), 0, -1));
        $this->routes->add($resource . '.optionsNoSlash', $actionOptionsNoSlash);

        $actionHead = ActionUtils::getRouteHead($service, $serviceConfig);
        $this->routes->add($resource . '.head', $actionHead);

        $actionHead = ActionUtils::getRouteHead($service, $serviceConfig, [], true);
        $this->routes->add($resource . '.idHead', $actionHead);

        $actionGet = ActionUtils::getRouteGet($service, $serviceConfig);
        $this->routes->add($resource . '.get', $actionGet);

        $actionAll = ActionUtils::getRouteAll($service, $serviceConfig);
        $this->routes->add($resource . '.all', $actionAll);

        $actionOptions = ActionUtils::getCanonicalSchemaRoute($service, $serviceConfig, 'collection');
        $this->routes->add($resource . '.canonicalSchema', $actionOptions);

        $actionOptions = ActionUtils::getCanonicalSchemaRoute($service, $serviceConfig, 'collection', true);
        $this->routes->add($resource . '.canonicalSchemaOptions', $actionOptions);

        $actionOptions = ActionUtils::getCanonicalSchemaRoute($service, $serviceConfig);
        $this->routes->add($resource . '.canonicalIdSchema', $actionOptions);

        $actionOptions = ActionUtils::getCanonicalSchemaRoute($service, $serviceConfig, 'item', true);
        $this->routes->add($resource . '.canonicalIdSchemaOptions', $actionOptions);

        $actionOptions = ActionUtils::getRouteOptions($service, $serviceConfig, [], true);
        $this->routes->add($resource . '.idOptions', $actionOptions);
    }
619381
public function run(Config $config): ResultInterface
    {
        return get_option('permalink_structure')
            ? ResultFactory::makeSuccess($this)
            : ResultFactory::makeFailure($this, 'Permalink structure not defined');
    }
363413
protected function newResource(ResourceConfiguration $config)
    {
        return new Resource(
            $this->newRepository($config),
            $this->newValidator($config),
            $this->newSecurity(),
            $this,
            $config
        );
    }
521779
protected function generateGetSingle(ResourceConfiguration $config)
    {
        $that = $this;

        $this->slim->get("{$this->baseRoute($config)}/:id", function () use ($that) {
            $that->executeRoute('show', func_get_args());
        });
    }
312492
public function createRouter(App $app, array $config = []): Router
    {
        $routes = $this->mergeRoutes($app, $this->buildRoutes($config));
        
        return new PathRouter(...$this->generateRouterData($routes));
    }
115093
public function build(array $config)
    {
        $router = new Router();
        foreach ($config as $name => $route) {
            if ($route instanceof RouteInterface) {
                $router->register($name, $route);
                continue;
            }

            $route = $this->applyDefaults($route);

            $router->register(
                $name,
                $this->createDefinition($route)
            );
        }

        return $router;
    }
616650
public function generateAppBased($config, $bar)
    {
        if (!$config['options-serviceOnly'] && !$config['options-apiOnly']) {
            $this->crudGenerator->createController($config);
            $this->crudGenerator->createViews($config);
            $this->crudGenerator->createRoutes($config);

            if ($config['options-withFacade']) {
                $this->crudGenerator->createFacade($config);
            }
        }
        $bar->advance();
    }
896808
public function generate(array $config)
    {
        $defaultHTTPCodes = $this->getDefaultHTTPCodes($config);
        $defaultOptions = $this->getDefaultOptions($config);

        return $this->createUrlChainFromConfig(
            $config,
            $defaultHTTPCodes,
            $defaultOptions
        );
    }
1166962
public function write(Config $config)
    {
        $pathBuildDb = Config::KEY_BUILD . '/' . Config::KEY_DB . '/';

        /** @var array $artifacts */
        $artifacts = $config->get(Config::KEY_DEPLOY . '/' . Config::KEY_ARTIFACTS);
        $artifactsExport = '';
        foreach ($artifacts as $artifactName => $artifact) {
            $artifactVarExport = $this->varExport($artifact);
            $artifactsExport .= "'$artifactName' => $artifactVarExport,\n";
        }

        /** @var array $themes */
        $themes = $config->get(Config::KEY_DEPLOY . '/' . Config::KEY_THEMES);
        $themesExport = '';
        foreach ($themes as $theme) {
            $themesExport .= $this->varExport($theme) . ",\n";
        }

        $vars = [
            '{{GIT_BIN}}' => $config->get(Config::KEY_ENV . '/' . Config::KEY_GIT_BIN),
            '{{PHP_BIN}}' => $config->get(Config::KEY_ENV . '/' . Config::KEY_PHP_BIN),
            '{{TAR_BIN}}' => $config->get(Config::KEY_ENV . '/' . Config::KEY_TAR_BIN),
            '{{MYSQL_BIN}}' => $config->get(Config::KEY_ENV . '/' . Config::KEY_MYSQL_BIN),
            '{{COMPOSER_BIN}}' => $config->get(Config::KEY_ENV . '/' . Config::KEY_COMPOSER_BIN),
            '{{DEPLOYER_BIN}}' => $config->get(Config::KEY_ENV . '/' . Config::KEY_DEPLOYER_BIN),

            '{{GIT_URL}}' => $config->get(Config::KEY_DEPLOY . '/' . Config::KEY_GIT_URL),
            "'{{ARTIFACTS}}'" => trim($artifactsExport),
            "'{{THEMES}}'" => trim($themesExport),

            '{{DB_HOST}}' => $config->get($pathBuildDb . 'db-host'),
            '{{DB_NAME}}' => $config->get($pathBuildDb . 'db-name'),
            '{{DB_USER}}' => $config->get($pathBuildDb . 'db-user'),
            '{{DB_PASSWORD}}' => $config->get($pathBuildDb . 'db-password'),
        ];

        $search = array_keys($vars);
        $replace = array_values($vars);

        $md2Template = file_get_contents(__DIR__ . '/magedeploy2.template.php');
        $configFileContent = str_replace($search, $replace, $md2Template);

        file_put_contents(Config::FILENAME, $configFileContent);
    }
616307
public function load(Config $config)
    {
        $parsed = [];

        if ($this->isFile($this->getPath())) {
            $parsed = $this->parse($this->fetch($this->getPath()));
        }

        if (!is_array($parsed)) {
            $parsed = [];
        }

        $this->apply($parsed, $config);
    }
124484
public function configureHooks(Config $config) : void
    {
        foreach (HookUtil::getHooks() as $hook) {
            $this->configureHook($config->getHookConfig($hook), $hook);
        }
    }
131933
public function initialize(array $config)
    {
        parent::initialize($config);

        $_config = [
            'context'  => __d('core', 'record'),
            'redirect' => [
                'action'     => 'index',
                'prefix'     => $this->_request->getParam('prefix'),
                'plugin'     => $this->_request->getParam('plugin'),
                'controller' => $this->_request->getParam('controller'),
            ],
            'messages' => [
                'no_action' => __d('core', 'Action not found.'),
                'no_choose' => __d('core', 'Please choose only one item.'),
            ]
        ];

        $config = Hash::merge($_config, $config);
        $this->setConfig($config);
    }
1057035
private function mapLaravelToDoctrineConfig($config)
    {
        $default = $config['database.default'];
        $connection = $config["database.connections.{$default}"];
        return App::make(DriverMapper::class)->map($connection);
    }
552109
public function configureIndex(
        IndexUUID $indexUUID,
        Config $config
    ) {
        $this->load();
        parent::configureIndex(
            $indexUUID,
            $config
        );
        $this->save();
    }
391541
public static function loadConfig($config = null)
    {
        if ($config !== null) {
            Configure::write('CakeResque', $config);
        }

        if (
            ($hasCheck = method_exists('Configure', 'check')) && !Configure::check('CakeResque') ||
            !$hasCheck && !self::checkConfig('CakeResque')
        ) {
            Configure::load('CakeResque.config');
        }
    }