Gems specific version of the snippet loader
Loads snippets like all other classes in gems first with project prefix, then gems, mutil and when all that fails it will try without prefix from the project\snippets and gems\snippets folders
package | Gems |
---|---|
subpackage | Snippets |
copyright | Copyright (c) 2011 Erasmus MC |
license | New BSD License |
since | Class available since version 1.5.5 |
inherited_from | \Gems_Loader_TargetLoaderAbstract |
__construct(mixed $source= null
, array $dirs= array()
)
mixed
Something that is or can be made into \MUtil_Registry_SourceInterface, otherwise \Zend_Registry is used.
array
prefix => pathname The inital paths to load from
__construct(mixed $container, array $dirs)
mixed
A container acting as source for \MUtil_Registry_Source
array
The directories where to look for requested classes
__get($name)
addPrefixPath(string $prefix, string $path, boolean $prepend = true
) : \MUtil_Snippets_SnippetLoaderInterface
string
string
boolean
\MUtil_Snippets_SnippetLoaderInterface
addPrefixPath(string $prefix, $path, boolean $prepend = true
) : \Gems_Loader_LoaderAbstract
string
boolean
Put path at the beginning of the stack (has no effect when prefix / dir already set)
\Gems_Loader_LoaderAbstract
(continuation pattern)afterRegistry() : void
answerRegistryRequest(string $name, mixed $resource) : boolean
string
Name of resource to set
mixed
The resource.
boolean
True if $resource was OKcheckRegistryRequestsAnswers() : boolean
boolean
False if required values are missing.getRegistryRequests() : array
Returns those object variables defined by the subclass but not at the level of this definition.
Can be overruled.
array
of string namesgetSnippet(string $filename, array $extraSourceParameters = null
) : \MUtil_Snippets_SnippetInterface
string
The name of the snippet
array
name/value pairs to add to the source for this snippet
\MUtil_Snippets_SnippetInterface
The snippetgetSource() : \MUtil_Registry_SourceInterface
\MUtil_Registry_SourceInterface
removePrefixPath(string $prefix, string $path = null
) : \MUtil_Snippets_SnippetLoaderInterface
string
string
OPTIONAL
\MUtil_Snippets_SnippetLoaderInterface
setSource(\MUtil_Registry_SourceInterface $source) : \MUtil_Snippets_SnippetLoader
\MUtil_Registry_SourceInterface
\MUtil_Snippets_SnippetLoader
(continuation pattern)_cascadedDirs(array $dirs, string $cascade, boolean $fullClassnameFallback = true
) : array
array
prefix => path
string
The sub directories to cascade to
boolean
Allows full class name specification instead of just plugin name part
array
prefix => path_getClass(string $name, string $className= null
, array $arguments= array()
) : mixed
string
The $name of the variable to store this object in.
string
Class name or null if the same as $name, prepending $this->_dirs.
array
Class initialization arguments.
mixed
Instance of $className_loadClass(string $name, boolean $create= false
, array $arguments= array()
) : mixed
filterRequestNames(string $name) : boolean
Can be overriden.
string
boolean
$verbose : boolean
false
Sometimes it is hard to find out what snippets will be loaded. Use the verbose option to see what snippets are requested and what the resulting snippet is including the full prefix (if any).
Use: \Gems_Snippets_SnippetLoader::$verbose = true; to enable.
$_dirs : array
The standard value is
But an alternative could be:
$_loader : \MUtil_Loader_PluginLoader
$cascade : string
'Snippets'
$cascade : string
null