FileSource
class FileSource extends AbstractSource implements SourceInterface
File based source.
Properties
protected Processor | $processor | The query post processor implementation. |
from AbstractSource |
protected string | $basePath | The local path where the source can be found. |
|
protected Filesystem | $files | The filesystem instance. |
|
Finder | $finder |
Methods
Generate a cache key unique to this source.
Returns a single template.
Returns all templates.
Creates a new template.
Updates an existing template.
Run a delete statement against the source.
Run a delete statement against the source.
Ensure the requested file can be created in the requested directory.
Helper to make file path.
Returns the base path for this source.
Generate a paths cache key unique to this source
Get all available paths within this source
Details
in
AbstractSource at line 18
Processor
getProcessor()
Get the query post processor used by the connection.
at line 319
int|string
makeCacheKey(string $name = '')
Generate a cache key unique to this source.
at line 43
__construct($basePath, Filesystem $files)
Create a new source instance.
at line 61
mixed
select(string $dirName, string $fileName, string $extension)
Returns a single template.
at line 86
array
selectAll(string $dirName, array $options = [])
Returns all templates.
at line 156
bool
insert(string $dirName, string $fileName, string $extension, string $content)
Creates a new template.
at line 186
int
update(string $dirName, string $fileName, string $extension, string $content, string $oldFileName = null, string $oldExtension = null)
Updates an existing template.
at line 230
int
delete(string $dirName, string $fileName, string $extension)
Run a delete statement against the source.
at line 251
int
lastModified(string $dirName, string $fileName, string $extension)
Run a delete statement against the source.
at line 272
protected void
validateDirectoryForSave(string $dirName, string $fileName, string $extension)
Ensure the requested file can be created in the requested directory.
at line 307
protected string
makeFilePath($dirName, $fileName, $extension)
Helper to make file path.
at line 328
string
getBasePath()
Returns the base path for this source.
at line 338
string
getPathsCacheKey()
Generate a paths cache key unique to this source
at line 348
array
getAvailablePaths()
Get all available paths within this source