original_string: public function create($config, $context, $code = false)
      {
          // validate language code
          if ($code === false) {
              $code = $this->validator->validate(
                  $config->get('Core.Language'),
                  $config,
                  $context
              );
          } else {
              $code = $this->validator->validate($code, $config, $context);
          }
          if ($code === false) {
              $code = 'en'; // malformed code becomes English
          }
  
          $pcode = str_replace('-', '_', $code); // make valid PHP classname
          static $depth = 0; // recursion protection
  
          if ($code == 'en') {
              $lang = new HTMLPurifier_Language($config, $context);
          } else {
              $class = 'HTMLPurifier_Language_' . $pcode;
              $file  = $this->dir . '/Language/classes/' . $code . '.php';
              if (file_exists($file) || class_exists($class, false)) {
                  $lang = new $class($config, $context);
              } else {
                  // Go fallback
                  $raw_fallback = $this->getFallbackFor($code);
                  $fallback = $raw_fallback ? $raw_fallback : 'en';
                  $depth++;
                  $lang = $this->create($config, $context, $fallback);
                  if (!$raw_fallback) {
                      $lang->error = true;
                  }
                  $depth--;
              }
          }
          $lang->code = $code;
          return $lang;
      }
code: public function create($config, $context, $code = false)
      {
          // validate language code
          if ($code === false) {
              $code = $this->validator->validate(
                  $config->get('Core.Language'),
                  $config,
                  $context
              );
          } else {
              $code = $this->validator->validate($code, $config, $context);
          }
          if ($code === false) {
              $code = 'en'; // malformed code becomes English
          }
  
          $pcode = str_replace('-', '_', $code); // make valid PHP classname
          static $depth = 0; // recursion protection
  
          if ($code == 'en') {
              $lang = new HTMLPurifier_Language($config, $context);
          } else {
              $class = 'HTMLPurifier_Language_' . $pcode;
              $file  = $this->dir . '/Language/classes/' . $code . '.php';
              if (file_exists($file) || class_exists($class, false)) {
                  $lang = new $class($config, $context);
              } else {
                  // Go fallback
                  $raw_fallback = $this->getFallbackFor($code);
                  $fallback = $raw_fallback ? $raw_fallback : 'en';
                  $depth++;
                  $lang = $this->create($config, $context, $fallback);
                  if (!$raw_fallback) {
                      $lang->error = true;
                  }
                  $depth--;
              }
          }
          $lang->code = $code;
          return $lang;
      }
code_tokens: public function create ( $ config , $ context , $ code = false ) { // validate language code if ( $ code === false ) { $ code = $ this -> validator -> validate ( $ config -> get ( 'Core.Language' ) , $ config , $ context ) ; } else { $ code = $ this -> validator -> validate ( $ code , $ config , $ context ) ; } if ( $ code === false ) { $ code = 'en' ; // malformed code becomes English } $ pcode = str_replace ( '-' , '_' , $ code ) ; // make valid PHP classname static $ depth = 0 ; // recursion protection if ( $ code == 'en' ) { $ lang = new HTMLPurifier_Language ( $ config , $ context ) ; } else { $ class = 'HTMLPurifier_Language_' . $ pcode ; $ file = $ this -> dir . '/Language/classes/' . $ code . '.php' ; if ( file_exists ( $ file ) || class_exists ( $ class , false ) ) { $ lang = new $ class ( $ config , $ context ) ; } else { // Go fallback $ raw_fallback = $ this -> getFallbackFor ( $ code ) ; $ fallback = $ raw_fallback ? $ raw_fallback : 'en' ; $ depth ++ ; $ lang = $ this -> create ( $ config , $ context , $ fallback ) ; if ( ! $ raw_fallback ) { $ lang -> error = true ; } $ depth -- ; } } $ lang -> code = $ code ; return $ lang ; }
docstring: Creates a language object, handles class fallbacks
  @param HTMLPurifier_Config $config
  @param HTMLPurifier_Context $context
  @param bool|string $code Code to override configuration with. Private parameter.
  @return HTMLPurifier_Language
docstring_tokens: Creates a language object handles class fallbacks