Advertisement
fruffl

prot. props Bootstrapper

Feb 5th, 2013
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 18.16 KB | None | 0 0
  1. <?PHP
  2.     NAMESPACE ILLI\Core;
  3.     USE ILLI\Core\Exception;
  4.     USE ILLI\Util\Inflector;
  5.     USE ILLI\Util\String;
  6.     USE ILLI\Core\Proto\I_Boot;
  7.    
  8.     CLASS Proto EXTENDS \ILLI\Core\A_Proto IMPLEMENTS \ILLI\Core\I_Proto
  9.     {
  10.         private static $__defaultOptions =
  11.         [
  12.             I_Proto::DI_RUN         => TRUE,
  13.             I_Proto::DI_MAIN        => '__main',
  14.             I_Proto::DI_CLASS       => [],
  15.             I_Proto::DI_DELEGATE        => [],
  16.             I_Proto::DI_FILTER      => [],
  17.             I_Proto::DI_METHOD      => [],
  18.             I_Proto::DI_OBSERVER        => [],
  19.             I_Proto::DI_METHOD_PROTO    => [],
  20.             I_Proto::DI_SIGNAL      => [],
  21.             I_Proto::DI_TO =>
  22.             [
  23.                 'string'        => 'toString',
  24.                 'array'         => 'toArray'
  25.             ]
  26.         ];
  27.        
  28.         protected $__initConfig = [];
  29.        
  30.         USE \ILLI\Core\Proto\T_Boot;
  31.        
  32.         /**
  33.          * bootstrap static protected vars and store default class-setup in a static dict
  34.          * default strapping:
  35.          *  ::$propertyConfigurable: a list of accessible/configurable properties including constructor-options
  36.          *  ::$propertyDefaults: the default Values of defined class-properties
  37.          *  ::$propertyAspectable: a list of injectable class-properties (observer, signal, facade, strategy etc.)
  38.          *
  39.          * @discus: diff for constructor-configurable and runtime-configurable:
  40.          *      unset from whitelist on @__exec() ??
  41.          */
  42.         final public function __construct(array $__options = [])
  43.         {
  44.             // $obj->$prop not exist:
  45.             //  bypass property... public $obj->$commonProp is evil: the value is avail in __initConfig and never modifiable from outside
  46.            
  47.             // modify prop:
  48.             //  not defined as CONFIGURABLE -> not public -> not modifiable
  49.            
  50.             // __construct(array $__options):
  51.             //  not defined as CONFIGURABLE: $__options[prop] is stored in __initConfig[prop] -> bypass $obj->$prop
  52.            
  53.             // DEFAULT VALUE, construct $__options, modify prop:
  54.             //  not defined as ASPECTABLE: use direct access
  55.            
  56.             // @__boot
  57.             //  ON_LOOKUP | ON_COMPLETE => static results
  58.             //  ON_INIT $obj::__construct-event
  59.             $__boot =
  60.             [
  61.                 // DEFAULT VALUE
  62.                 //  the default values
  63.                 // static $obj::$__DEFINE_propDef
  64.                 I_Proto::DEFINE_DEFAULTS =>
  65.                 [
  66.                     // merge DEF -> value: called class overwrites base-class except $__defaultOptions (extend)
  67.                     // write $c to static cache
  68.                     I_Boot::ON_LOOKUP => function($c, $n, array $l)
  69.                     {
  70.                         array_walk($l, function($v, $p) use (&$c, $n)
  71.                         {
  72.                             $c[$p] = $this->Core_Proto_T_Boot_handleLookup($p, $n, $c) +
  73.                             [
  74.                                 I_Proto::BOOT_IDX_DEFAULT_VALUE => $v
  75.                             ];
  76.                            
  77.                             $m = &$c[$p][I_Proto::BOOT_IDX_DEFAULT_VALUE];
  78.                            
  79.                             if(isset($m)
  80.                             && isset(self::$__defaultOptions[$p])
  81.                             && is_array($m)
  82.                             && is_array($v))
  83.                                 $m = $this->extend(TRUE, $v, $m);
  84.                         });
  85.                        
  86.                         return $c;
  87.                     },
  88.                     // load $c from static cache
  89.                     // save merged defaults in __initConfig on __construct()
  90.                     I_Boot::ON_INIT => function($c)
  91.                     {
  92.                         array_walk($c, function($s, $p)
  93.                         {
  94.                             $this->__initConfig[$p] = $s[I_Proto::BOOT_IDX_DEFAULT_VALUE];
  95.                         });
  96.                        
  97.                         return $c;
  98.                     }
  99.                 ],
  100.                 // ASPECTABLE PROP
  101.                 //  aspProperty is injectable
  102.                 //  [$prop => false] overwrites parent::$prop to bypass asp
  103.                 //  [$prop => flag] overwrites parent::$prop: 'array', 'property' OR ['myFunc1', 'myFunc2'] OR 'myFunc1|myFunc2'
  104.                 //  inject-accessor is the camelized version of property-name + event-name: aspectable{:Event}{:Property}() -> aspectableSetParam
  105.                 //  protected accessor is property({:event}, {:property}[, {:value}])
  106.                 //  public accessor is property{:Event}([{:property}, {:value}]) @see CONFIGURABLE
  107.                 //  to apply asp-events for DEFAULT-values register all events before calling @__exec()! ($__option[__run] = FALSE)
  108.                 // static $obj::$__DEFINE_propAsp
  109.                 I_Proto::DEFINE_ASPECTABLE =>
  110.                 [
  111.                     // merge ASP -> flag: called class extends base-class
  112.                     // write $c to static cache
  113.                     I_Boot::ON_LOOKUP => function($c, $n, $l)
  114.                     {
  115.                         $d =
  116.                         [
  117.                             I_Proto::ASP_TYPE_PROP  => [I_Proto::ASP_FN_PRFX_SET, I_Proto::ASP_FN_PRFX_RESTORE],
  118.                             I_Proto::ASP_TYPE_ARRAY => [I_Proto::ASP_FN_PRFX_SET, I_Proto::ASP_FN_PRFX_RESTORE, I_Proto::ASP_FN_PRFX_ADD, I_Proto::ASP_FN_PRFX_REMOVE, I_Proto::ASP_FN_PRFX_CLEAR],
  119.                         ];
  120.                        
  121.                         array_walk($l, function($v, $p) use (&$c, $n, $d)
  122.                         {
  123.                             if(is_integer($p))
  124.                             {
  125.                                 $p = $v;
  126.                                 $v = TRUE;
  127.                             }
  128.                            
  129.                             $c[$p] = $this->Core_Proto_T_Boot_handleLookup($p, $n, $c) +
  130.                             [
  131.                                 I_Proto::BOOT_IDX_ASP_ENABLED       => is_string($v) ? TRUE : $v,
  132.                                 I_Proto::BOOT_IDX_ASP_DI_LIST       => $a = is_string($u = is_bool($v) ? I_Proto::ASP_TYPE_PROP : $v) ? isset($d[$u]) ? $d[$u] : explode('|', $u) : $u,
  133.                                 I_Proto::BOOT_IDX_ASP_DI_INIT_NAME  => !isset($a[0]) ? isset($d[$u]) ? $d[$u][0] : I_Proto::ASP_FN_PRFX_SET : $a[0],
  134.                                 I_Proto::BOOT_IDX_ASP_DI_NAMES      => [],
  135.                                 I_Proto::BOOT_IDX_ASP_DI_DISABLED   => [],
  136.                                 I_Proto::BOOT_IDX_ASP_DI_ENABLED    => []
  137.                             ];
  138.                         });
  139.                        
  140.                         return $c;
  141.                     },
  142.                     // create accessor tuplet
  143.                     // write $c to static cache
  144.                     I_Boot::ON_COMPLETE => function($c)
  145.                     {
  146.                         array_walk($c, function(&$s, $p)
  147.                         {
  148.                             if(FALSE === $s[I_Boot::BOOT_IDX_EXISTS]
  149.                             || FALSE === $s[I_Proto::BOOT_IDX_ASP_ENABLED])
  150.                                 return;
  151.                            
  152.                             array_walk($s[I_Proto::BOOT_IDX_ASP_DI_LIST], function($a) use (&$s, $p)
  153.                             {
  154.                                 $s[I_Proto::BOOT_IDX_ASP_DI_NAMES] += [$a => $m = String::insert(I_Proto::ASP_TPL_FN_NAME, ['aspFnPrefix' => Inflector::camelize($a), 'propertyName' => Inflector::camelize($p)])];
  155.                                 $s[(($e = method_exists($this, $m)) ? I_Proto::BOOT_IDX_ASP_DI_ENABLED : I_Proto::BOOT_IDX_ASP_DI_DISABLED)] += [$a => ($e ? $m : $p)];
  156.                             });
  157.                         });
  158.                        
  159.                         return $c;
  160.                     }
  161.                 ],
  162.                 // CONFIGURABLE
  163.                 //  comProperty is a runtimeProperty
  164.                 //  accessible from public scope
  165.                 //  accessibble from __construct
  166.                 //  [$prop => flag] overwrites parent::$prop: behavior (merge, extend...)
  167.                 //  public accessor is property{:Event}([{:property}, {:value}])
  168.                 // static $obj::$__DEFINE_propCom
  169.                 I_Proto::DEFINE_CONFIGURABLE =>
  170.                 [
  171.                     // merge CONFIGURABLE -> flag: called class extends base-class
  172.                     // write $c to static cache
  173.                     I_Boot::ON_LOOKUP => function($c, $n, array $l)
  174.                     {
  175.                         array_walk($l, function($v, $p) use (&$c, $n)
  176.                         {
  177.                             if(is_integer($p))
  178.                             {
  179.                                 $p = $v;
  180.                                 $v = FALSE;
  181.                             }
  182.                            
  183.                             $c[$p] = $this->Core_Proto_T_Boot_handleLookup($p, $n, $c) +
  184.                             [
  185.                                 I_Proto::BOOT_IDX_CONFIG_FLAG => $v
  186.                             ];
  187.                         });
  188.                        
  189.                         return $c;
  190.                     }
  191.                 ]
  192.             ];
  193.            
  194.             // @__dest
  195.             //  finalizer
  196.             $__dest = function()
  197.             {
  198.                 $this->__initConfig[I_Proto::DI_RUN] = TRUE;
  199.                 unset($this->__initConfig[I_Proto::DI_BOOT_EXEC]);
  200.             };
  201.            
  202.             // @__init
  203.             //  write property-value
  204.             $__init = isset($__options[I_Proto::DI_BOOT_INIT]) && is_callable($__options[I_Proto::DI_BOOT_INIT])
  205.                 ? function($p, $v) use ($__options)
  206.                 {
  207.                     $__options[I_Proto::DI_BOOT_INIT]($p, $v, self::$__Core_Proto_T_Boot_Static[get_called_class()]);
  208.                 }
  209.                 // write $obj->$prop when prop is not defined as ASP
  210.                 // write $obj->$prop when prop is defined as direct-access
  211.                 // write $obj->$prop when prop ASP is disabled
  212.                 // delegate to $obj->property{:Event}($value)
  213.                 : function($p, $v)
  214.                 {
  215.                     $a = self::$__Core_Proto_T_Boot_Static[get_called_class()][I_Proto::DEFINE_ASPECTABLE];
  216.                    
  217.                     if(!isset($a[$p]))
  218.                         return $this->$p = $v;
  219.                    
  220.                     $s = $a[$p];
  221.                    
  222.                     if(FALSE === $s[I_Proto::BOOT_IDX_ASP_ENABLED])
  223.                         return $this->$p = $v;
  224.                    
  225.                        
  226.                     if(!isset($s[I_Proto::BOOT_IDX_ASP_DI_INIT_NAME]))
  227.                         throw new Exception('The default handle is "set". No handler found.');
  228.                    
  229.                     $u = $s[I_Proto::BOOT_IDX_ASP_DI_INIT_NAME];
  230.                    
  231.                     if(isset($s[I_Proto::BOOT_IDX_ASP_DI_DISABLED][$u]))
  232.                         return $this->$p = $v;
  233.                        
  234.                     if(isset($s[I_Proto::BOOT_IDX_ASP_DI_ENABLED][$u]))
  235.                         return $this->$s[I_Proto::BOOT_IDX_ASP_DI_ENABLED][$u]($v);
  236.                        
  237.                     throw new Exception('Setter {:u} not avail.', compact('u'));
  238.                 };
  239.            
  240.             // @__exec
  241.             //  load default property-values from DEFAULTS
  242.             //  load accessible properties from CONFIGURABLE
  243.             //  handle data by CONFIGURABLE-flag
  244.             //  write initial property-values using @__init
  245.             //  unset accessible properties from __initConfig
  246.             $__exec = isset($__options[I_Proto::DI_BOOT_EXEC]) && is_callable($__options[I_Proto::DI_BOOT_EXEC])
  247.                 ? function() use ($__init, $__dest, $__options)
  248.                 {
  249.                     $__options[I_Proto::DI_BOOT_EXEC]($__init, self::$__Core_Proto_T_Boot_Static[get_called_class()]);
  250.                     $__dest();
  251.                 }
  252.                 : function() use ($__init, $__dest)
  253.                 {
  254.                     $_ = self::$__Core_Proto_T_Boot_Static[get_called_class()];
  255.                     $c = $_[I_Proto::DEFINE_CONFIGURABLE];
  256.                     $d = $_[I_Proto::DEFINE_DEFAULTS];
  257.                     $i = &$this->__initConfig;
  258.                     $t = [];
  259.            
  260.                     // load DEFAULT VALUE when prop exists as $obj->$prop
  261.                     array_walk($d, function($s, $p) use (&$t)
  262.                     {
  263.                         if(FALSE === $s[I_Boot::BOOT_IDX_EXISTS])
  264.                             return;
  265.                            
  266.                         $t[$p] = $s[I_Proto::BOOT_IDX_DEFAULT_VALUE];
  267.                     });
  268.                    
  269.                     // load CONFIGURABLE when prop exists in __initConfig
  270.                     // load CONFIGURABLE when prop exists as $obj->$prop
  271.                     // handle __initConfig[prop] by CONFIGURABLE-flag
  272.                     array_walk($c, function($s, $p) use (&$i, &$t)
  273.                     {
  274.                         if(FALSE === isset($i[$p])
  275.                         || FALSE === $s[I_Boot::BOOT_IDX_EXISTS])
  276.                             return;
  277.                            
  278.                         $v = $i[$p];
  279.                        
  280.                         switch(TRUE):
  281.                             case is_array($v) && is_array($this->$p):
  282.                                 switch($s[I_Proto::BOOT_IDX_CONFIG_FLAG]):
  283.                                     case I_Proto::CONFIG_HANDLE_ARR_ADD:
  284.                                         $v = $this->$p + $v;
  285.                                         break;
  286.                                     case I_Proto::CONFIG_HANDLE_ARR_EXTEND:
  287.                                         $v = $this->extend($this->$p, $v);
  288.                                         break;
  289.                                     case I_Proto::CONFIG_HANDLE_ARR_MERGE:
  290.                                         $v = array_merge($this->$p, $v);
  291.                                         break;
  292.                                     case I_Proto::CONFIG_HANDLE_ARR_RECURSIVE:
  293.                                         $v = $this->extend(TRUE, $this->$p, $v);
  294.                                         break;
  295.                                 endswitch;
  296.                                 break;
  297.                             case is_string($v) && is_string($this->$p):
  298.                                 switch($s[I_Proto::BOOT_IDX_CONFIG_FLAG]):
  299.                                     case I_Proto::CONFIG_HANDLE_STR_APPEND:
  300.                                         $v = $this->$p.$v;
  301.                                         break;
  302.                                     case I_Proto::CONFIG_HANDLE_STR_PREPEND:
  303.                                         $v = $v.$this->$p;
  304.                                         break;
  305.                                 endswitch;
  306.                                 break;
  307.                         endswitch;
  308.                        
  309.                         $t[$p] = &$v;
  310.                     });
  311.                    
  312.                     // $__init()
  313.                     array_walk($t, function(&$v, $p) use (&$i, $__init)
  314.                     {
  315.                         unset($i[$p]);
  316.                         $__init($p, $v);
  317.                     });
  318.                    
  319.                     $__dest();
  320.                 };
  321.                
  322.             // *magic*
  323.            
  324.             $this->Core_Proto_T_Boot_emit($this->extend(TRUE, (isset($__options[I_Proto::DI_BOOT_LOAD]) ? $__options[I_Proto::DI_BOOT_LOAD] : []), $__boot));
  325.            
  326.             unset($__options[I_Proto::DI_BOOT_LOAD]);
  327.             unset($__options[I_Proto::DI_BOOT_EXEC]);
  328.             unset($__options[I_Proto::DI_BOOT_INIT]);
  329.            
  330.             $this->__initConfig = $this->extend(TRUE, $this->__initConfig, self::$__defaultOptions, $__options);
  331.            
  332.             TRUE === $this->__initConfig[I_Proto::DI_RUN]
  333.                 ? $__exec()
  334.                 : $this->__initConfig[I_Proto::DI_BOOT_EXEC] = $__exec; // @see ::run()
  335.            
  336.             unset($__boot);
  337.             unset($__init);
  338.             unset($__exec);
  339.             unset($__dest);
  340.         }
  341.        
  342.         public function run()
  343.         {
  344.             if(isset($this->__initConfig[I_Proto::DI_BOOT_EXEC]))
  345.                 $this->__initConfig[I_Proto::DI_BOOT_EXEC]();
  346.                
  347.             return $this;
  348.         }
  349.        
  350.         public function extend()
  351.         {
  352.             $a = func_get_args();
  353.             $t = $a[0];
  354.             $i = 1;
  355.             $l = count($a);
  356.             $r = FALSE;
  357.            
  358.             if(is_bool($t))
  359.             {
  360.                 $r = $t;
  361.                 $t = isset($a[1]) ? $a[1] : [];
  362.                 $i = 2;
  363.             }
  364.            
  365.             if(FALSE === is_array($t)
  366.             && FALSE === is_object($t)
  367.             && FALSE === is_string($t))
  368.                 $t = [];
  369.                
  370.             if($l === $i)
  371.             {
  372.                 $t = $this;
  373.                 --$i;
  374.             }
  375.            
  376.             for( ; $i < $l; $i++)
  377.             {
  378.                 if(NULL === ($o = $a[$i]))
  379.                     continue;
  380.                
  381.                 foreach($o as $p => $v)
  382.                 {
  383.                     switch(TRUE):
  384.                         case is_array($t):
  385.                             $t[$p] = (TRUE === $r && is_array($v) && isset($t[$p]) && is_array($t[$p]))
  386.                                 ? $this->extend($r, $t[$p], $v)
  387.                                 : $v;
  388.                             break;
  389.                         case is_object($t):
  390.                             $t->$p = (TRUE === $r && is_array($v) && isset($t->$p) && is_array($t->$p))
  391.                                 ? $this->extend($r, $t->$p, $v)
  392.                                 : $v;
  393.                             break;
  394.                         case is_string($t):
  395.                             if(FALSE === class_exists($t))
  396.                                 throw new Exception('Class {:t} not found.', compact('t'));
  397.                                
  398.                             if(FALSE === property_exists($t, $p))
  399.                                 throw new Exception('Property {:t}::${:p} not found.', compact('t', 'p'));
  400.                                
  401.                             $t::$$p = (TRUE === $r && is_array($v) && is_array($t::${$p}))
  402.                                 ? $this->extend($r, $t::$$p, $v)
  403.                                 : $v;
  404.                             break;
  405.                         default:
  406.                             throw new Exception('Target not writable.');
  407.                     endswitch;
  408.                 }
  409.             }
  410.            
  411.             return $t;
  412.         }
  413.        
  414.         // test
  415.         public function propertySet($property, $value)
  416.         {
  417.             $_ = self::$__Core_Proto_T_Boot_Static[get_called_class()];
  418.             $c = $_[I_Proto::DEFINE_CONFIGURABLE];
  419.            
  420.             if(!isset($c[$property]))
  421.                 throw new Exception('{:property} is not public.', compact('property'));
  422.                
  423.             $this->$property = $value; // stub
  424.             return $this;
  425.         }
  426.        
  427.         public function dump()
  428.         {
  429.             return self::$__Core_Proto_T_Boot_Static;
  430.         }
  431.     }
  432.  
  433. <?PHP
  434.     NAMESPACE ILLI\Core\Proto;
  435.     USE ILLI\Core\Exception;
  436.     USE ILLI\Core\Proto\I_Boot;
  437.     USE SplFixedArray;
  438.    
  439.     TRAIT T_Boot
  440.     {
  441.         private static $__Core_Proto_T_Boot_Static = [];
  442.        
  443.         protected function Core_Proto_T_Boot_handleLookup($propertyName, $lookupClassName, $classCache)
  444.         {
  445.             if(FALSE === isset($classCache[$propertyName]))
  446.                 return
  447.                 [
  448.                     I_Boot::BOOT_IDX_EXISTS     => isset($this->$propertyName) || property_exists($this, $propertyName),
  449.                     I_Boot::BOOT_IDX_DEFINED    => $lookupClassName,
  450.                     I_Boot::BOOT_IDX_REDEFINED  => FALSE,
  451.                     I_Boot::BOOT_IDX_INSPECT    => $lookupClassName.'::$'.$propertyName
  452.                 ];
  453.                
  454.             $r = $classCache[$propertyName];
  455.            
  456.             if(FALSE === $r[I_Boot::BOOT_IDX_REDEFINED])
  457.             {
  458.                 $r[I_Boot::BOOT_IDX_REDEFINED]  = $r[I_Boot::BOOT_IDX_DEFINED];
  459.                 $r[I_Boot::BOOT_IDX_INSPECT]    = $r[I_Boot::BOOT_IDX_DEFINED].'::$'.$propertyName;
  460.             }
  461.            
  462.             $r[I_Boot::BOOT_IDX_DEFINED] = $lookupClassName;
  463.            
  464.             return $r;
  465.         }
  466.        
  467.         protected function Core_Proto_T_Boot_emit(array $__lookupTable = [])
  468.         {
  469.             array_walk($__lookupTable, function($t, $p)
  470.             {
  471.                 if(is_integer($p))
  472.                 {
  473.                     $p = $t;
  474.                     $t = [];
  475.                 }
  476.                
  477.                 $l = get_called_class();
  478.                 $s = &self::$__Core_Proto_T_Boot_Static[$l][$p];
  479.                
  480.                 if(isset($s))
  481.                     goto _init;
  482.                    
  483.                 $c = [];
  484.                
  485.                 do
  486.                 {
  487.                     if(FALSE === isset($l::$$p))
  488.                         continue;
  489.                        
  490.                     $c = is_callable($h = isset($t[I_Boot::ON_LOOKUP]) ? $t[I_Boot::ON_LOOKUP] : NULL)
  491.                         ? $h($c, $l, $l::$$p)
  492.                         : $l::$$p;
  493.                 }
  494.                 while($l = get_parent_class($l));
  495.                
  496.                 $c = is_callable($h = isset($t[I_Boot::ON_COMPLETE]) ? $t[I_Boot::ON_COMPLETE] : NULL)
  497.                     ? $h($c)
  498.                     : $c;
  499.                
  500.                 array_walk($c, function($v, $p) use (&$s)
  501.                 {
  502.                     $s[$p] = SplFixedArray::fromArray($v, TRUE);
  503.                 });
  504.                
  505.                 _init:
  506.                
  507.                 if(is_callable($h = isset($t[I_Boot::ON_INIT]) ? $t[I_Boot::ON_INIT] : NULL))
  508.                     $h($s);
  509.             });
  510.            
  511.             return $this;
  512.         }
  513.     }
  514.  
  515. <?PHP
  516.     NAMESPACE ILLI\Core\Proto;
  517.  
  518.     INTERFACE I_Boot
  519.     {
  520.         // offsets in SplFixedArray
  521.         CONST BOOT_IDX_EXISTS       = 0;
  522.         CONST BOOT_IDX_DEFINED      = 1;
  523.         CONST BOOT_IDX_REDEFINED    = 2;
  524.         CONST BOOT_IDX_INSPECT      = 3;
  525.        
  526.         // events
  527.         CONST ON_LOOKUP         = 'ILLI\Core\Proto\I_Boot::ON_LOOKUP';
  528.         CONST ON_COMPLETE       = 'ILLI\Core\Proto\I_Boot::ON_COMPLETE';
  529.         CONST ON_INIT           = 'ILLI\Core\Proto\I_Boot::ON_INIT';
  530.     }
  531.  
  532. <?PHP
  533.     NAMESPACE ILLI\Core;
  534.  
  535.     INTERFACE I_Proto
  536.     {
  537.         // offsets in SplFixedArray
  538.         CONST BOOT_IDX_ASP_DI_LIST      = 4;
  539.         CONST BOOT_IDX_ASP_ENABLED      = 5;
  540.         CONST BOOT_IDX_ASP_DI_INIT_NAME     = 6;
  541.         CONST BOOT_IDX_ASP_DI_NAMES     = 7;
  542.         CONST BOOT_IDX_ASP_DI_DISABLED      = 8;
  543.         CONST BOOT_IDX_ASP_DI_ENABLED       = 9;
  544.         CONST BOOT_IDX_CONFIG_FLAG      = 4;
  545.         CONST BOOT_IDX_DEFAULT_VALUE        = 4;
  546.        
  547.         // bootstrapping properties
  548.         CONST DEFINE_ASPECTABLE         = '__DEFINE_propAsp';
  549.         CONST DEFINE_CONFIGURABLE       = '__DEFINE_propCom';
  550.         CONST DEFINE_DEFAULTS           = '__DEFINE_propDef';
  551.        
  552.         // default options
  553.         CONST DI_BOOT_LOAD          = 'ILLI\Core\I_Proto::DI_BOOT_LOAD';
  554.         CONST DI_BOOT_INIT          = 'ILLI\Core\I_Proto::DI_BOOT_INIT';
  555.         CONST DI_BOOT_EXEC          = 'ILLI\Core\I_Proto::DI_BOOT_EXEC';
  556.         CONST DI_RUN                = 'ILLI\Core\I_Proto::DI_RUN';
  557.         CONST DI_MAIN               = 'ILLI\Core\I_Proto::DI_MAIN';
  558.         CONST DI_CLASS              = 'ILLI\Core\I_Proto::DI_CLASS';
  559.         CONST DI_DELEGATE           = 'ILLI\Core\I_Proto::DI_DELEGATE';
  560.         CONST DI_FILTER             = 'ILLI\Core\I_Proto::DI_FILTER';
  561.         CONST DI_METHOD             = 'ILLI\Core\I_Proto::DI_METHOD';
  562.         CONST DI_METHOD_FACADE          = 'ILLI\Core\I_Proto::DI_METHOD_FACADE';
  563.         CONST DI_METHOD_PROTO           = 'ILLI\Core\I_Proto::DI_METHOD_PROTO';
  564.         CONST DI_OBSERVER           = 'ILLI\Core\I_Proto::DI_OBSERVER';
  565.         CONST DI_SIGNAL             = 'ILLI\Core\I_Proto::DI_SIGNAL';
  566.         CONST DI_TO             = 'ILLI\Core\I_Proto::DI_TO';
  567.        
  568.         // asp type handle def
  569.         CONST ASP_TYPE_ARRAY            = 'ILLI\Core\I_Proto::ASP_TYPE_ARRAY';
  570.         CONST ASP_TYPE_PROP         = 'ILLI\Core\I_Proto::ASP_TYPE_PROP';
  571.        
  572.         // asp method handle names
  573.         CONST ASP_FN_PRFX_ADD           = 'add';
  574.         CONST ASP_FN_PRFX_CLEAR         = 'clear';
  575.         CONST ASP_FN_PRFX_GET           = 'get';
  576.         CONST ASP_FN_PRFX_REMOVE        = 'remove';
  577.         CONST ASP_FN_PRFX_RESTORE       = 'restore';
  578.         CONST ASP_FN_PRFX_SET           = 'set';
  579.        
  580.         // default aspectable method name
  581.         CONST ASP_TPL_FN_NAME           = 'aspectable{:aspFnPrefix}{:propertyName}';
  582.        
  583.         // config flag handle names
  584.         CONST CONFIG_HANDLE_ARR_ADD     = 'ILLI\Core\I_Proto::CONFIG_HANDLE_ARR_ADD';
  585.         CONST CONFIG_HANDLE_ARR_EXTEND      = 'ILLI\Core\I_Proto::CONFIG_HANDLE_ARR_EXTEND';
  586.         CONST CONFIG_HANDLE_ARR_MERGE       = 'ILLI\Core\I_Proto::CONFIG_HANDLE_ARR_MERGE';
  587.         CONST CONFIG_HANDLE_ARR_RECURSIVE   = 'ILLI\Core\I_Proto::CONFIG_HANDLE_ARR_RECURSIVE';
  588.         CONST CONFIG_HANDLE_STR_APPEND      = 'ILLI\Core\I_Proto::CONFIG_HANDLE_STR_APPEND';
  589.         CONST CONFIG_HANDLE_STR_PREPEND     = 'ILLI\Core\I_Proto::CONFIG_HANDLE_STR_PREPEND';
  590.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement