PathNormalizingMiddleware
in package
implements
MiddlewareInterface
Interfaces, Classes and Traits
Table of Contents
- __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
Configuration —normalizeCachePath()
public
normalizeCachePath(UriInterface|null $uri, Path $cachePath) : Path
Parameters
- $uri : UriInterface|null
- $cachePath : Path
Return values
Path —makeDsnRelativeToConfig()
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
Configuration —normalizePath()
private
normalizePath(string $path) : string
Parameters
- $path : string
Return values
string —normalizePaths()
private
normalizePaths(Configuration $configuration) : Configuration
Parameters
- $configuration : Configuration
Return values
Configuration —pathToGlobPattern()
private
pathToGlobPattern(string $path) : string
Parameters
- $path : string