PathController
in package
Handles, validates, and assembles the paths used for I/O.
Table of Contents
- $buildPath : string
- HTML Build Path
- $sourcePath : string
- Document Source Path
- __construct() : mixed
- assembleAbsolutePath() : string
- Construct an absolute path from a pre-sanitized relative path.
- getBuildPath() : string
- Get the Build Path.
- getSourcePath() : string
- Get the Source Path.
- resolveAbsolutePaths() : void
- Set the paths to absolute paths, if enabled in config.
- sanitizeRelativePath() : string
- Sanitize relative path.
Properties
$buildPath
HTML Build Path
public
string
$buildPath
The directory where the compiled HTML is output (relative to the Laravel root)
The default directory is
$sourcePath
Document Source Path
public
string
$sourcePath
The directory where the source Markdown files are stored (relative to the Laravel root)
The default directory is
Methods
__construct()
public
__construct() : mixed
Return values
mixed —assembleAbsolutePath()
Construct an absolute path from a pre-sanitized relative path.
private
assembleAbsolutePath(string $sanitizedPath) : string
Parameters
- $sanitizedPath : string
Return values
string —an absolute path to the specified directory within the Laravel installation
getBuildPath()
Get the Build Path.
private
getBuildPath() : string
Retrieves the build path from the config, or falls back to the default. It returns an absolute path not ending in a directory separator.
Tags
Return values
string —getSourcePath()
Get the Source Path.
private
getSourcePath() : string
Retrieves the source path from the config, or falls back to the default. It returns an absolute path not ending in a directory separator.
Tags
Return values
string —resolveAbsolutePaths()
Set the paths to absolute paths, if enabled in config.
private
resolveAbsolutePaths() : void
Return values
void —sanitizeRelativePath()
Sanitize relative path.
private
sanitizeRelativePath(string $path) : string
Sanitizes by ensuring the string does not start or end with a slash and that it does not point to an outside directory.
Parameters
- $path : string
-
a path relative to the Laravel installation to sanitize
Return values
string —the path without directory separators in the beginning and end