Load block composition from JSON file. More...
Public Member Functions | |
__construct ($storage_opts, $context, $alias, $is_write_allowed) | |
Constructor will get options from core.json.php file. More... | |
isReadOnly () | |
Returns true if there is no way that this storage can modify or create blocks. More... | |
createBlockInstance ($block) | |
Create instance of requested block and give it loaded configuration. More... | |
describeBlock ($block) | |
Describe block for documentation generator. More... | |
loadBlock ($block) | |
Load block configuration. More... | |
storeBlock ($block, $config) | |
Store block configuration. | |
deleteBlock ($block) | |
Delete block configuration. | |
blockMTime ($block) | |
Get time (unix timestamp) of last modification of the block. | |
Public Member Functions inherited from ClassBlockStorage | |
__construct ($storage_opts, $context, $alias, $is_write_allowed) | |
Constructor will get options from core.json.php file. More... | |
isReadOnly () | |
Returns true if there is no way that this storage can modify or create blocks. More... | |
createBlockInstance ($block) | |
Create instance of requested block and give it loaded configuration. More... | |
describeBlock ($block) | |
Describe block for documentation generator. More... | |
loadBlock ($block) | |
Load block configuration. More... | |
storeBlock ($block, $config) | |
Store block configuration. | |
deleteBlock ($block) | |
Delete block configuration. | |
blockMTime ($block) | |
Get time (unix timestamp) of last modification of the block. | |
getKnownBlocks (&$blocks=array()) | |
List all available blocks in this storage. More... | |
Protected Attributes | |
$is_write_allowed | |
Is block storage allowed to store blocks? | |
$filename_match_regexp = '/^[\/a-zA-Z0-9_]+\.json\.php$/' | |
Regular expression to match files containing block classes. More... | |
$filename_to_block_regexp = '/^\/([\/a-zA-Z0-9_-]+)\.json\.php$/' | |
Regular expression to match files containing block classes. More... | |
$default_block_class = "\\Cascade\\Core\\ProxyBlock" | |
Default class used to process a block, when no shebang is not specified. | |
$shebang_classes = array() | |
List of interpreters. More... | |
$context = null | |
Default context from cascade. | |
Protected Attributes inherited from ClassBlockStorage | |
$filename_match_regexp = '/^[\/a-zA-Z0-9_]+\.php$/' | |
Regular expression to match files containing block classes. | |
$filename_to_block_regexp ='/^\/([\/a-zA-Z0-9_-]+)\.php$/' | |
Regular expression to convert filename to block name. | |
Load block composition from JSON file.
Shebang is alias for a class. Instance of this class is then used to interpret loaded block configuration.
/
__construct | ( | $storage_opts, | |
$context, | |||
$alias, | |||
$is_write_allowed | |||
) |
Constructor will get options from core.json.php file.
Arguments: $storage_opts - Options loaded from config file $context - Common default context (dependency injection container) passed to all storages, and later also to all blocks.
Implements IBlockStorage.
isReadOnly | ( | ) |
Returns true if there is no way that this storage can modify or create blocks.
When creating or modifying block, first storage that returns true will be used.
Implements IBlockStorage.
createBlockInstance | ( | $block | ) |
Create instance of requested block and give it loaded configuration.
No further initialisation here, that is job for cascade controller. Returns created instance or false.
Implements IBlockStorage.
describeBlock | ( | $block | ) |
Describe block for documentation generator.
Documentation structure is mostly the same as JSON file where block is stored. Only few fileds must be filled before it is complete. And inputs and outputs are completely different.
/
Implements IBlockStorage.
loadBlock | ( | $block | ) |
Load block configuration.
Returns false if block is not found.
Implements IBlockStorage.
|
protected |
Regular expression to match files containing block classes.
|
protected |
Regular expression to match files containing block classes.
|
protected |
List of interpreters.
Block can specify this alias and change how it will be interpreted.