public function __construct($id, $info, $extensions, $states, $rules, $mappings, $caseInsensitive, $postProcessors)
 {
     $this->_id = $id;
     $this->_info = $info;
     $this->_extensions = $extensions;
     $this->_caseInsensitive = $caseInsensitive;
     $this->_states = $this->compileStates($states);
     $this->_rules = $this->compileRules($rules);
     $this->_mappings = $mappings;
     foreach ($postProcessors as $ppkey => $ppvalue) {
         $this->_postProcessors[$ppkey] = HyperLanguage::compile($ppvalue);
     }
 }
Exemple #2
0
 public function __construct($lang)
 {
     if (is_string($lang)) {
         $this->_lang = HyperLanguage::compileFromName(strtolower($lang));
     } else {
         if ($lang instanceof HyperlightCompiledLanguage) {
             $this->_lang = $lang;
         } else {
             if ($lang instanceof HyperLanguage) {
                 $this->_lang = HyperLanguage::compile($lang);
             } else {
                 trigger_error('Invalid argument type for $lang to Hyperlight::__construct', E_USER_ERROR);
             }
         }
     }
     foreach ($this->_lang->postProcessors() as $ppkey => $ppvalue) {
         $this->_postProcessors[$ppkey] = new Hyperlight($ppvalue);
     }
     $this->reset();
 }