Cascade Core  v0.12-1-g22cbbeb
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
ProxyBlock Class Reference

Block class for proxy blocks created by JsonBlockStorage. More...

Inheritance diagram for ProxyBlock:
Inheritance graph

Public Member Functions

 main ()
 Body of the block. More...
 
- Public Member Functions inherited from Block
 main ()
 Body of the block. More...
 
 id ()
 Get block id without namespaces.
 
 fullId ()
 Get full block id (including all parent namespaces).
 
 blockName ()
 Get block type.
 
 status ()
 Get block state.
 
 statusMessage ()
 Get status message - usually contains an error message why block failed.
 
 getCascadeController ()
 Get CascadeController which owns this block.
 
 getTimestamps ()
 Get profiler data. More...
 
 visibleBlockNames ()
 List all visible block names already in cascade (for debugging only) More...
 
 cc_init ($parent, $id, $full_id, $cascade_controller, $block_name, $context, $initial_status=self::QUEUED, $initial_status_message=null)
 
 cc_connect (array $in_connections, array $in_values)
 
 cc_registerBlock ($block)
 
 cc_resolveBlockName ($block_name)
 
 cc_execute ()
 
 cc_getOutput ($name)
 
 cc_connections ()
 
 cc_outputs ()
 
 cc_outputCache ()
 
 cc_forwardedOutputs ()
 
 cc_outputExists ($name, $accept_wildcard=true)
 
 cc_getNamespace ()
 
 cc_executionTime ()
 
 cc_dumpNamespace ($level=1)
 
 cc_describeBlock ()
 
 getOutput ($name)
 Calculate output value on demand. More...
 

Static Public Member Functions

static createFromShebang ($block_config, $shebang_config, Context $context, $block_type)
 Create block proxy.
 

Public Attributes

const force_exec = true
 Block must be always executed.
 
- Public Attributes inherited from Block
const force_exec = false
 Default value of 'force_exec' flag. More...
 
const QUEUED = 0x00
 The block is waiting for execution.
 
const RUNNING = 0x01
 The block or its dependencies are being evaluated.
 
const ZOMBIE = 0x02
 The block is finished, exist only to maintain its outputs.
 
const DISABLED = 0x04
 The block is disabled, its 'enable' input is false.
 
const FAILED = 0x08
 The block has failed, because its inputs cannot be connected, or its dependencies cannot be solved, or it threw an exception. More...
 

Protected Member Functions

 preprocessConfiguration ($conf)
 Preprocess configuration before it is interpreted by proxy itself. More...
 
- Protected Member Functions inherited from Block
 in ($name)
 Get value from input.
 
 inAll ()
 Get values from all inputs.
 
 inputNames ()
 Get all input names, excluding common inputs (enable and *)
 
 collectNumericInputs ()
 Collect values from numeric inputs - works well with vsprintf() More...
 
 out ($name, $value)
 Set value to output.
 
 outAll ($values)
 Set all output values. More...
 
 outForward ($name, $source_block, $source_name=null)
 Forward output from another block. More...
 
 templateAdd ($id_suffix, $template, $data=array())
 Add output object to template subsystem.
 
 templateAddToSlot ($id_suffix, $slot, $weight, $template, $data=array())
 Add output object to template subsystem (with slot and weight)
 
 templateSetPageTitle ($title, $format=null)
 Set page title.
 
 templateSetType ($type)
 Set output type.
 
 templateOptionSet ($slot, $option, $value)
 Set slot option.
 
 templateOptionAppend ($slot, $option, $value)
 Append value to slot option (which is list)
 
 cascadeAdd ($id, $block, $force_exec=null, $in_connections=array(), $in_values=array(), $context=null)
 Add block to cascade.
 
 cascadeAddFromArray ($array_of_blocks, $context=null)
 Add array of blocks to cascade (calls cascadeAdd() for each item). More...
 
 cascadeGetErrors ()
 Get errors from cascade controller (errors can occur when cascade_add or cascade_add_from_ini is called)
 
 auth ()
 Get auth object from cascade controller.
 
 authIsBlockAllowed ($block_name, &$details=null)
 Check if block is allowed before cascade controller loads it.
 

Protected Attributes

 $inputs
 Block inputs. More...
 
 $outputs
 Block outputs. More...
 
- Protected Attributes inherited from Block
 $inputs
 List of inputs and their default values. More...
 
 $connections
 List of default input connections (all inputs mentioned here must be present in $inputs array too) More...
 
 $outputs
 List of outputs (no default values) More...
 
 $context
 Global context. More...
 

Policy handlers

 policy__require_block ($arg, &$conf)
 Deny entire block if specified block is not available.
 
 policy__dummy_if_denied ($arg, &$conf)
 Silently replace denied blocks with dummy. More...
 
 policy__skip_if_denied ($arg, &$conf)
 Silently skip denied blocks. More...
 

Additional Inherited Members

- Static Public Attributes inherited from Block
static $STATUS_NAMES
 Map block state constants to strings. More...
 

Detailed Description

Block class for proxy blocks created by JsonBlockStorage.

Load JSON file and insert its content to cascade. Used filename is determined from block name, becouse cascade controller uses this block when block specified by JSON file should be inserted.

Section "copy-inputs" specifies which inputs will be copied without change to which outputs. Keys are outputs, values are inputs.

Section "outputs" specifies values on outputs and/or output forwarding. Syntax is same as when connecting inputs, but keys are output names.

There are three policies which specify behaviour when block is denied. They are specified in "policy" section in form: policy[] = list of blocks. See policy handlers section for description of policies.

Member Function Documentation

main ( )

Body of the block.

The method called when block is evaluated.

Here is the call graph for this function:

preprocessConfiguration (   $conf)
protected

Preprocess configuration before it is interpreted by proxy itself.

Receives original configuration and returns modified version.

Here is the caller graph for this function:

policy__dummy_if_denied (   $arg,
$conf 
)
finalprotected

Silently replace denied blocks with dummy.

Useful when other blocksare connected to these.

Todo:

Here is the call graph for this function:

policy__skip_if_denied (   $arg,
$conf 
)
finalprotected

Silently skip denied blocks.

When nothing needs these.

Todo:

Here is the call graph for this function:

Member Data Documentation

$inputs
protected
Initial value:
= array(
'*' => null,
)

Block inputs.

$outputs
protected
Initial value:
= array(
'*' => true,
)

Block outputs.