Advertisement
fruffl

WP Error Solver

Dec 8th, 2012
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.92 KB | None | 0 0
  1. /* the struct */
  2.     FINAL CLASS tri4mQtLoader_Struct EXTENDS tri4m_Struct
  3.     {
  4.         public function __construct()
  5.         {
  6.             $this->tStructure_define('theme', [
  7.                 tri4m_Struct_Prop::TYPE     => array('string'),
  8.                 tri4m_Struct_Prop::INITIAL  => 'ajax-loader.gif'
  9.             ]);
  10.            
  11.             $this->tStructure_define('transition', [
  12.                 tri4m_Struct_Prop::TYPE     => array('string'),
  13.                 tri4m_Struct_Prop::INITIAL  => 'deck',
  14.                 tri4m_Struct_Prop::WHITELIST    => array('deck', 'replace') // ~enum
  15.             ]);
  16.            
  17.             $this->tStructure_define('Hello', [
  18.                 tri4m_Struct_Prop::TYPE     => array('string'),
  19.                 tri4m_Struct_Prop::INITIAL  => 'World'
  20.             ]);
  21.         }
  22.     }
  23.  
  24. /** validate plugin settings... */
  25.                 // load struct
  26.                 $this->__Struct = new $this->__pluginBaseNameStruct;
  27.                
  28.                 // load and validate current settings from db
  29.                 foreach($this->__Struct as $key => $value)
  30.                 {
  31.                     $this->__WordpressDbOptions[$key] = $this->getWordpressSetting($key);
  32.                    
  33.                     try
  34.                     {
  35.                         // struct-setter-test
  36.                         $this->__Struct->setValue($key, $this->__WordpressDbOptions[$key]);
  37.                     }
  38.                     catch(Exception $E)
  39.                     {
  40.                         // reset to inittial
  41.                         if($E->hasCatched('tri4m_ArgumentComparisonException'))
  42.                         {
  43.                             $this->resetWordpressSetting($key);
  44.                             $this->__WordpressDbOptions[$key] = $this->getWordpressSetting($key);
  45.                             $this->__Struct->setValue($key, $this->__WordpressDbOptions[$key]);
  46.                            
  47.                             $this->e($E
  48.                                 ->solveAddress()
  49.                                 ->setSolvedReason('Reset value to initial-value "'.$this->__WordpressDbOptions[$key].'".')
  50.                                 ->toMessage()
  51.                             );
  52.                         };
  53.                     }
  54.                 }
  55. /** output options page:
  56.  
  57. tri4mQtLoader
  58. ERRORS  510:500:521:500
  59. ADDRESS 000000007f4ff5a1000000005ba1d7eb:000000007f4ff5a0000000005ba1d7eb:000000007f4ff5a7000000005ba1d7eb:000000007f4ff5a6000000005ba1d7eb
  60. SOLVED  Problem was solved with: Reset value to initial-value "deck".
  61. REVIEW  
  62.     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".
  63.     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.
  64.     INNER   000000007f4ff5a0000000005ba1d7eb: SOLVED    tri4m_CoreStructure_MethodCallException (ERROR 521): 'tri4mQtLoader_Struct'::'transition': Value 'deckdfbdfb' is not acceptable. Problem was solved with: Unknown Solution.
  65.     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