Constructs a Binary String valued Field that is not tokenized nor indexed,
but is stored in the index, for return with hits.

@param  string $name
@param  string $value
@param  string $encoding
@return Zend_Search_Lucene_Field
329087
public static function binary($name, $value)
    {
        return new self($name, $value, '', true, false, false, true);
    }
910600
public static function title($value, $encoding = null)
    {
        $options  = [];
        $encoding = $encoding ?: static::$encoding;

        if ($encoding) {
            $options['encoding'] = $encoding;
        }

        return StaticFilter::execute(
            static::camelCaseToUnderscore($value), Filter\UpperCaseWords::class, $options
        );
    }
789567
public static function ensureLeft($string, $search, $encoding = null)
    {
        if (static::startsWith($string, $search, true, $encoding)) {
            return $string;
        }

        return $search . $string;
    }
744868
public function input(string $name, $value = null)
    {
        if ($value !== null) {
            !$this->all && $this->inputs();

            Arrays::set($this->input, $name, $value);
            $this->cache = [];

            return $value;
        }

        if (isset($this->input[$name])) {
            return $this->input[$name];
        }

        if (\array_key_exists($name, $this->cache)) {
            return $this->cache[$name];
        }

        if ($this->all) {
            $found = Arrays::get($this->input, $name);
        } else {
            if ($this->serverRequest->getMethod() !== 'GET') {
                $found = $this->request($name);
            }

            $found = $found ?? $this->query($name);
        }

        return $this->cache[$name] = $found;
    }
814424
private function createAttributeValue($name, $value)
    {
        $factory = "create{$name}";

        if ($value instanceof JsonSerializable) {
            $value = $value->jsonSerialize();
        }

        $value = $this->{$factory}($value);

        if (!($value instanceof JsonSerializable || is_array($value))) {
            throw new DomainException('Invalid value factory');
        }

        return $value;
    }
758341
public function outputFormat($value, $name)
    {
        $checkZero = str_replace('0', '', $value);

        if (empty($checkZero)) {
            return '0';
        }
        if (preg_match('/^bytes([0-9]*)/', $name, $match) === 1) {
            $size = intval($match[1]);
            $length = 2 * $size;
            $value = mb_substr($value, 0, $length);
        }
        return '0x' . $value;
    }
883564
final protected function setAttribute($name, $value)
    {
        if ($value !== null && $this->hasAttributeValueFactory($name)) {
            $this->internalCache[$name] = $this->createAttributeValue($name, $value);

            if ($this->internalCache[$name] instanceof JsonSerializable) {
                $value = $this->internalCache[$name]->jsonSerialize();
            } elseif (is_array($this->internalCache[$name])) {
                $value = array_map(
                    function ($value) {
                        if ($value instanceof JsonSerializable) {
                            $value = $value->jsonSerialize();
                        }

                        return $value;
                    },
                    $this->internalCache[$name]
                );
            } else {
                $value = $this->internalCache[$name];
            }
        }

        $this->data[$name] = $value;

        return $this;
    }
761798
public function outputFormat($value, $name)
    {
        $strLen = mb_substr($value, 0, 64);
        $strValue = mb_substr($value, 64);
        $match = [];

        if (preg_match('/^[0]+([a-f0-9]+)$/', $strLen, $match) === 1) {
            $strLen = BigNumberFormatter::format('0x' . $match[1])->toString();
        }
        $strValue = mb_substr($strValue, 0, (int) $strLen * 2);

        return Utils::hexToBin($strValue);
    }
964621
public static function getx($name,$expire,$value=null){
        $content = self::get($name);
        if($content !== null) {
            return $content;
        }
        return self::setx($name,$expire,$value);
    }
935745
@Deprecated
    public static String encode(String name, String value) {
        return io.netty.handler.codec.http.cookie.ClientCookieEncoder.LAX.encode(name, value);
    }
1092623
private void encodeLiteral(ByteBuf out, CharSequence name, CharSequence value, IndexType indexType,
                               int nameIndex) {
        boolean nameIndexValid = nameIndex != -1;
        switch (indexType) {
            case INCREMENTAL:
                encodeInteger(out, 0x40, 6, nameIndexValid ? nameIndex : 0);
                break;
            case NONE:
                encodeInteger(out, 0x00, 4, nameIndexValid ? nameIndex : 0);
                break;
            case NEVER:
                encodeInteger(out, 0x10, 4, nameIndexValid ? nameIndex : 0);
                break;
            default:
                throw new Error("should not reach here");
        }
        if (!nameIndexValid) {
            encodeStringLiteral(out, name);
        }
        encodeStringLiteral(out, value);
    }
464906
public function push($name, $value = null)
    {
        switch ($name) {
        case 'name':
            $this->setName($value);
            break;
        case 'type':
            break;
        case 'value':
            $this->setValue($value, true);
            break;
        case 'required':
            $this->required = true;
            break;
        case 'pattern':
        case 'regex':
            $this->regex = $value;
            $this->attributes['pattern'] = $value;
            break;
        case 'minlength':
            $this->minlength = $value;
            $this->attributes['minlength'] = $value;
            break;
        case 'maxlength':
            $this->maxlength = $value;
            $this->attributes['maxlength'] = $value;
            break;
        case 'mapping':
            $this->mapping = $value;
            break;
        case 'prettyname':
            $this->prettyname = $value;
            break;
        case 'readonly':
            $this->readonly = true;
            $this->attributes['readonly'] = 'readonly';
            break;
        default:
            if (preg_match('#^([a-z0-9_-]+)$#mUsi', $name)) {
                if (null !== $value) {
                    $this->setAttribute($name, $value);
                } else {
                    $this->setAttribute($name, $name);
                }
            }
        }
    }
775199
public function field(string $name, Syntax $value = null)
    {
        if ($value === null) {
            $names = explode('.', $name);
            $syntax = $this;
            foreach ($names as $field) {
                while (method_exists($syntax, 'syntax')) {
                    $syntax = $syntax->syntax();
                }
                if ($syntax instanceof ObjectSyntax && array_key_exists($field, $syntax->fields)) {
                    $syntax = $syntax->fields[$field];
                } else {
                    throw new \InvalidArgumentException("field '{$name}' not found");
                }
            }
            return $syntax;
        }

        $this->fields[$name] = $value;
        return $this;
    }
568790
private function resolveInternalValue(array $definition, array $expression, $name, $value)
    {
        $type = $definition['type'];

        switch ($type) {
            case 'boolean':
            case 'bool':
                return strtr('zend_is_true(:v)', [':v' => $value]);
            case 'int':
            case 'uint':
            case 'integer':
            case 'long':
            case 'ulong':
                // TODO: Use zval_get_long when we'll drop Zend Engine 2
                return strtr('Z_LVAL_P(:v)', [':v' => $value]);
            case 'string':
                // TODO: Use zval_get_string when we'll drop Zend Engine 2
                return strtr('Z_STRVAL_P(:v)', [':v' => $value]);
            case 'char':
            case 'uchar':
                // TODO: Use zval_get_string and zval_get_long when we'll drop Zend Engine 2
                return strtr(
                    '(Z_TYPE_P(:v) == IS_STRING ? (Z_STRLEN_P(:v) ? Z_STRVAL_P(:v)[0] : NULL) : Z_LVAL_P(:v))',
                    [':v' => $value]
                );
            case 'double':
            case 'float':
                // TODO: Use zval_get_double when we'll drop Zend Engine 2
                return strtr('Z_DVAL_P(:v)', [':v' => $value]);
            default:
                throw new CompilerException(
                    "Unknown type '{$type}' to setting global variable '{$name}'.",
                    $expression
                );
        }
    }
725217
protected function setAttributeType($name, $value)
    {

        if (array_key_exists($name, $this->casts)) {
            if (in_array($this->casts[$name], $this->castTypes)) {
                settype($value, $this->casts[$name]);
            }
        }

        return $value;
    }
853154
public static function show($value, $name, $code = null)
    {

        if (is_null($code)) $code = self::$_languageCode;

        // Lang file
        $file = "../App/Language/$code/$name.php";

        // Check if is readable
        if (is_readable($file)) {

            // Require file
            $_array = include($file);

        } else {

            // Display error
            echo \Core\Error::display("Could not load language file '$code/$name.php'");
            die;

        }

        if (!empty($_array[$value])) {
            return $_array[$value];
        } else {
            return $value;
        }
    }
880499
protected function hydrateNameValuePair($name, $value, DOMDocument $xml)
    {
        $nvp = $xml->createElement('hps:NameValuePair');
        $nvp->appendChild($xml->createElement('hps:Name', $name));
        $nvp->appendChild($xml->createElement('hps:Value', HpsInputValidation::cleanAscii($value)));
        return $nvp;
    }