PathNormalizingMiddleware
in package
implements
MiddlewareInterface
FinalYes
Table of Contents
Interfaces
Methods
- __invoke() : Configuration
- normalizeCachePath() : Path
- makeDsnRelativeToConfig() : Configuration
- Transforms relative dsn to relative path of working dir.
- normalizePath() : string
- normalizePaths() : Configuration
- pathToGlobPattern() : string
Methods
__invoke()
public
__invoke(Configuration $configuration[, UriInterface|null $uri = null ]) : Configuration
Parameters
- $configuration : Configuration
- $uri : UriInterface|null = null
Return values
ConfigurationnormalizeCachePath()
public
normalizeCachePath(UriInterface|null $uri, Path $cachePath) : Path
Parameters
- $uri : UriInterface|null
- $cachePath : Path
Return values
PathmakeDsnRelativeToConfig()
Transforms relative dsn to relative path of working dir.
private
makeDsnRelativeToConfig(Configuration $configuration, UriInterface|null $uri) : Configuration
The dsn defined in the config might be relative. If it is relative it is relative to the location of the config file. The config file could be outside the working directory. But we want to read from the current working dir.
Eg. the config is read from './config/phpdoc.xml' The defined source is '../src'
In this case the src dir on the same level as the config dir is read.
Absolute DSNs are untouched.
Parameters
- $configuration : Configuration
- $uri : UriInterface|null
Return values
ConfigurationnormalizePath()
private
normalizePath(string $path) : string
Parameters
- $path : string
Return values
stringnormalizePaths()
private
normalizePaths(Configuration $configuration) : Configuration
Parameters
- $configuration : Configuration
Return values
ConfigurationpathToGlobPattern()
private
pathToGlobPattern(string $path) : string
Parameters
- $path : string