mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 01:03:13 +08:00
Implemented EditShortCodeAction
This commit is contained in:
@@ -8,8 +8,24 @@ use Zend\Stdlib\Glob;
|
||||
|
||||
class ConfigProvider
|
||||
{
|
||||
const ROUTES_PREFIX = '/rest/v{version:1}';
|
||||
|
||||
public function __invoke()
|
||||
{
|
||||
return Factory::fromFiles(Glob::glob(__DIR__ . '/../config/{,*.}config.php', Glob::GLOB_BRACE));
|
||||
return $this->applyRoutesPrefix(
|
||||
Factory::fromFiles(Glob::glob(__DIR__ . '/../config/{,*.}config.php', Glob::GLOB_BRACE))
|
||||
);
|
||||
}
|
||||
|
||||
private function applyRoutesPrefix(array $config): array
|
||||
{
|
||||
$routes =& $config['routes'] ?? [];
|
||||
|
||||
// Prepend the routes prefix to every path
|
||||
foreach ($routes as $key => $route) {
|
||||
$routes[$key]['path'] = self::ROUTES_PREFIX . $route['path'];
|
||||
}
|
||||
|
||||
return $config;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user