Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* the struct */
- FINAL CLASS tri4mQtLoader_Struct EXTENDS tri4m_Struct
- {
- public function __construct()
- {
- $this->tStructure_define('theme', [
- tri4m_Struct_Prop::TYPE => array('string'),
- tri4m_Struct_Prop::INITIAL => 'ajax-loader.gif'
- ]);
- $this->tStructure_define('transition', [
- tri4m_Struct_Prop::TYPE => array('string'),
- tri4m_Struct_Prop::INITIAL => 'deck',
- tri4m_Struct_Prop::WHITELIST => array('deck', 'replace') // ~enum
- ]);
- $this->tStructure_define('Hello', [
- tri4m_Struct_Prop::TYPE => array('string'),
- tri4m_Struct_Prop::INITIAL => 'World'
- ]);
- }
- }
- /** validate plugin settings... */
- // load struct
- $this->__Struct = new $this->__pluginBaseNameStruct;
- // load and validate current settings from db
- foreach($this->__Struct as $key => $value)
- {
- $this->__WordpressDbOptions[$key] = $this->getWordpressSetting($key);
- try
- {
- // struct-setter-test
- $this->__Struct->setValue($key, $this->__WordpressDbOptions[$key]);
- }
- catch(Exception $E)
- {
- // reset to inittial
- if($E->hasCatched('tri4m_ArgumentComparisonException'))
- {
- $this->resetWordpressSetting($key);
- $this->__WordpressDbOptions[$key] = $this->getWordpressSetting($key);
- $this->__Struct->setValue($key, $this->__WordpressDbOptions[$key]);
- $this->e($E
- ->solveAddress()
- ->setSolvedReason('Reset value to initial-value "'.$this->__WordpressDbOptions[$key].'".')
- ->toMessage()
- );
- };
- }
- }
- /** output options page:
- tri4mQtLoader
- ERRORS 510:500:521:500
- ADDRESS 000000007f4ff5a1000000005ba1d7eb:000000007f4ff5a0000000005ba1d7eb:000000007f4ff5a7000000005ba1d7eb:000000007f4ff5a6000000005ba1d7eb
- SOLVED Problem was solved with: Reset value to initial-value "deck".
- REVIEW
- OUTER 000000007f4ff5a6000000005ba1d7eb: SOLVED tri4m_CoreStructure_MethodCallException (ERROR 510): 'tri4mQtLoader_Struct'::'transition': Unable to set value 'deckdfbdfb'. Problem was solved with: Reset value to initial-value "deck".
- INNER 000000007f4ff5a7000000005ba1d7eb: SOLVED tri4m_ArgumentOutOfRangeException (ERROR 500): Argument $'__value' at offset 1[0b1|0x1|0o1] for 'A_tri4m_CoreStructure::tStructure_set'() is out of range. Problem was solved with: Unknown Solution.
- INNER 000000007f4ff5a0000000005ba1d7eb: SOLVED tri4m_CoreStructure_MethodCallException (ERROR 521): 'tri4mQtLoader_Struct'::'transition': Value 'deckdfbdfb' is not acceptable. Problem was solved with: Unknown Solution.
- INNER 000000007f4ff5a1000000005ba1d7eb: SOLVED tri4m_ArgumentNotWhitelistedException (ERROR 500): Argument $'__value' at offset 1[0b1|0x1|0o1] for 'A_tri4m_CoreStructure::tStructure_iStructure_isAcceptable'() is not whitelisted. Problem was solved with: Unknown Solution.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement