original_string: function isRuleRegistered($name, $autoRegister = false)
      {
          if (is_scalar($name) && isset($GLOBALS['_HTML_QuickForm_registered_rules'][$name])) {
              return true;
          } elseif (!$autoRegister) {
              return false;
          }
          // automatically register the rule if requested
          include_once 'HTML/QuickForm/RuleRegistry.php';
          $ruleName = false;
          if (is_object($name) && is_a($name, 'html_quickform_rule')) {
              $ruleName = !empty($name->name)? $name->name: strtolower(get_class($name));
          } elseif (is_string($name) && class_exists($name)) {
              $parent = strtolower($name);
              do {
                  if ('html_quickform_rule' == strtolower($parent)) {
                      $ruleName = strtolower($name);
                      break;
                  }
              } while ($parent = get_parent_class($parent));
          }
          if ($ruleName) {
              $registry =& HTML_QuickForm_RuleRegistry::singleton();
              $registry->registerRule($ruleName, null, $name);
          }
          return $ruleName;
      }
code: function isRuleRegistered($name, $autoRegister = false)
      {
          if (is_scalar($name) && isset($GLOBALS['_HTML_QuickForm_registered_rules'][$name])) {
              return true;
          } elseif (!$autoRegister) {
              return false;
          }
          // automatically register the rule if requested
          include_once 'HTML/QuickForm/RuleRegistry.php';
          $ruleName = false;
          if (is_object($name) && is_a($name, 'html_quickform_rule')) {
              $ruleName = !empty($name->name)? $name->name: strtolower(get_class($name));
          } elseif (is_string($name) && class_exists($name)) {
              $parent = strtolower($name);
              do {
                  if ('html_quickform_rule' == strtolower($parent)) {
                      $ruleName = strtolower($name);
                      break;
                  }
              } while ($parent = get_parent_class($parent));
          }
          if ($ruleName) {
              $registry =& HTML_QuickForm_RuleRegistry::singleton();
              $registry->registerRule($ruleName, null, $name);
          }
          return $ruleName;
      }
code_tokens: function isRuleRegistered ( $ name , $ autoRegister = false ) { if ( is_scalar ( $ name ) && isset ( $ GLOBALS [ '_HTML_QuickForm_registered_rules' ] [ $ name ] ) ) { return true ; } elseif ( ! $ autoRegister ) { return false ; } // automatically register the rule if requested include_once 'HTML/QuickForm/RuleRegistry.php' ; $ ruleName = false ; if ( is_object ( $ name ) && is_a ( $ name , 'html_quickform_rule' ) ) { $ ruleName = ! empty ( $ name -> name ) ? $ name -> name : strtolower ( get_class ( $ name ) ) ; } elseif ( is_string ( $ name ) && class_exists ( $ name ) ) { $ parent = strtolower ( $ name ) ; do { if ( 'html_quickform_rule' == strtolower ( $ parent ) ) { $ ruleName = strtolower ( $ name ) ; break ; } } while ( $ parent = get_parent_class ( $ parent ) ) ; } if ( $ ruleName ) { $ registry = & HTML_QuickForm_RuleRegistry :: singleton ( ) ; $ registry -> registerRule ( $ ruleName , null , $ name ) ; } return $ ruleName ; }
docstring: Returns whether or not the given rule is supported
  
  @param     string   $name    Validation rule name
  @param     bool     Whether to automatically register subclasses of HTML_QuickForm_Rule
  @since     1.0
  @access    public
  @return    mixed    true if previously registered, false if not, new rule name if auto-registering worked
docstring_tokens: Returns whether or not the given rule is supported