PHP Class Bolt\Configuration\ResourceManager

Intended to simplify the ability to override resource location
Author: Ross Riley, [email protected]
Mostra file Open project: bolt/bolt Class Usage Examples

Public Properties

Property Type Description
$app Silex\Application
$theApp Silex\Application
$urlPrefix string

Protected Properties

Property Type Description
$classLoader Composer\Autoload\ClassLoader | null
$pathManager Eloquent\Pathogen\FileSystem\Factory\FileSystemPathFactory
$paths Eloquent\Pathogen\AbsolutePathInterface[]
$request string[]
$requestObject Symfony\Component\HttpFoundation\Request
$root Eloquent\Pathogen\AbsolutePathInterface
$urls array
$verifier LowLevelChecks | null

Public Methods

Method Description
__construct ( ArrayAccess $container ) Constructor initialises on the app root path.
findRelativePath ( string $frompath, string $topath ) : string Find the relative file system path between two file system paths.
getApp ( ) : Silex\Application Get the Bolt\Application object.
getClassLoader ( ) : Composer\Autoload\ClassLoader Get the Composer autoload ClassLoader.
getPath ( string $name ) : string Gets a path as a string.
getPathObject ( string $name ) : Eloquent\Pathogen\AbsolutePathInterface Gets a path as a PathInterface.
getPaths ( ) : PathsProxy Just don't use this.
getRequest ( string $name ) : string Get a request parameter.
getUrl ( string $name, boolean $includeBasePath = true ) : string Get a URL path definition.
getVerifier ( ) : Bolt\Configuration\Validation\ValidatorInterface Get the LowlevelChecks object.
hasPath ( string $name ) : boolean Checks if the given name has a path associated with it
initialize ( )
initializeConfig ( array $config ) Takes a loaded config array and uses it to initialize settings that depend on it.
initializeRequest ( Silex\Application $app, Request $request = null ) Takes a Request object and uses it to initialize settings that depend on the request.
postInitialize ( )
setApp ( Silex\Application $app ) Don't use!
setPath ( string $name, string $value ) : Eloquent\Pathogen\RelativePathInterface | Eloquent\Pathogen\AbsolutePathInterface Set a resource path.
setRequest ( string $name, string $value ) Set a parameter that describes the request.
setThemePath ( array $generalConfig ) This currently gets special treatment because of the processing order.
setUrl ( string $name, string $value ) Set a URL path definition.
setVerifier ( Bolt\Configuration\Validation\ValidatorInterface | null $verifier ) Set the LowlevelChecks object.
useLoader ( Composer\Autoload\ClassLoader $loader ) : Eloquent\Pathogen\RelativePathInterface | Eloquent\Pathogen\AbsolutePathInterface
verify ( )
verifyDb ( )

Method Details

__construct() public method

Constructor initialises on the app root path.
public __construct ( ArrayAccess $container )
$container ArrayAccess ArrayAccess compatible DI container that must contain one of: 'classloader' of instance a ClassLoader will use introspection to find root path or 'rootpath' will be treated as an existing directory as string. Optional ones: 'request' - Symfony\Component\HttpFoundation\Request

findRelativePath() public method

Find the relative file system path between two file system paths.
public findRelativePath ( string $frompath, string $topath ) : string
$frompath string Path to start from
$topath string Path we want to end up in
return string Path leading from $frompath to $topath

getApp() public static method

Get the Bolt\Application object.
public static getApp ( ) : Silex\Application
return Silex\Application

getClassLoader() public method

Get the Composer autoload ClassLoader.
public getClassLoader ( ) : Composer\Autoload\ClassLoader
return Composer\Autoload\ClassLoader

getPath() public method

Subdirectories are automatically parsed to correct filesystem. For example: $bar = getPath('root/foo/bar');
public getPath ( string $name ) : string
$name string Name of path
return string

getPathObject() public method

Subdirectories are automatically parsed to correct filesystem. For example: $bar = getPath('root/foo/bar');
public getPathObject ( string $name ) : Eloquent\Pathogen\AbsolutePathInterface
$name string Name of path
return Eloquent\Pathogen\AbsolutePathInterface

getPaths() public method

Just don't use this.
Deprecation: since 3.0, to be removed in 4.0.
public getPaths ( ) : PathsProxy
return PathsProxy

getRequest() public method

Get a request parameter.
public getRequest ( string $name ) : string
$name string
return string

getUrl() public method

Get a URL path definition.
public getUrl ( string $name, boolean $includeBasePath = true ) : string
$name string
$includeBasePath boolean
return string

getVerifier() public method

Get the LowlevelChecks object.
public getVerifier ( ) : Bolt\Configuration\Validation\ValidatorInterface
return Bolt\Configuration\Validation\ValidatorInterface

hasPath() public method

Checks if the given name has a path associated with it
public hasPath ( string $name ) : boolean
$name string of path
return boolean

initialize() public method

public initialize ( )

initializeConfig() public method

Takes a loaded config array and uses it to initialize settings that depend on it.
public initializeConfig ( array $config )
$config array

initializeRequest() public method

Takes a Request object and uses it to initialize settings that depend on the request.
public initializeRequest ( Silex\Application $app, Request $request = null )
$app Silex\Application
$request Symfony\Component\HttpFoundation\Request

postInitialize() public method

public postInitialize ( )

setApp() public method

Don't use!
Deprecation: Deprecated since 3.0, to be removed in 4.0.
public setApp ( Silex\Application $app )
$app Silex\Application

setPath() public method

Set a resource path.
public setPath ( string $name, string $value ) : Eloquent\Pathogen\RelativePathInterface | Eloquent\Pathogen\AbsolutePathInterface
$name string
$value string
return Eloquent\Pathogen\RelativePathInterface | Eloquent\Pathogen\AbsolutePathInterface

setRequest() public method

e.g. 'hostname', 'protocol' or 'canonical'
public setRequest ( string $name, string $value )
$name string
$value string

setThemePath() public method

The theme path is needed before the app has constructed, so this is a shortcut to allow the Application constructor to pre-provide a theme path.
public setThemePath ( array $generalConfig )
$generalConfig array

setUrl() public method

Set a URL path definition.
public setUrl ( string $name, string $value )
$name string
$value string

setVerifier() public method

Set the LowlevelChecks object.
public setVerifier ( Bolt\Configuration\Validation\ValidatorInterface | null $verifier )
$verifier Bolt\Configuration\Validation\ValidatorInterface | null

useLoader() public method

public useLoader ( Composer\Autoload\ClassLoader $loader ) : Eloquent\Pathogen\RelativePathInterface | Eloquent\Pathogen\AbsolutePathInterface
$loader Composer\Autoload\ClassLoader
return Eloquent\Pathogen\RelativePathInterface | Eloquent\Pathogen\AbsolutePathInterface

verify() public method

Deprecation: Deprecated since 3.1, to be removed in 4.0.
public verify ( )

verifyDb() public method

Deprecation: Deprecated since 3.1, to be removed in 4.0.
public verifyDb ( )

Property Details

$app public_oe property

public Application,Silex $app
return Silex\Application

$classLoader protected_oe property

protected ClassLoader,Composer\Autoload|null $classLoader
return Composer\Autoload\ClassLoader | null

$pathManager protected_oe property

protected FileSystemPathFactory,Eloquent\Pathogen\FileSystem\Factory $pathManager
return Eloquent\Pathogen\FileSystem\Factory\FileSystemPathFactory

$paths protected_oe property

protected AbsolutePathInterface[],Eloquent\Pathogen $paths
return Eloquent\Pathogen\AbsolutePathInterface[]

$request protected_oe property

protected string[] $request
return string[]

$requestObject protected_oe property

protected Request,Symfony\Component\HttpFoundation $requestObject
return Symfony\Component\HttpFoundation\Request

$root protected_oe property

protected AbsolutePathInterface,Eloquent\Pathogen $root
return Eloquent\Pathogen\AbsolutePathInterface

$theApp public_oe static_oe property

Deprecation: Deprecated since 3.0, to be removed in 4.0.
public static Application,Silex $theApp
return Silex\Application

$urlPrefix public_oe property

public string $urlPrefix
return string

$urls protected_oe property

protected array $urls
return array

$verifier protected_oe property

protected LowLevelChecks|null $verifier
return LowLevelChecks | null