Quote a raw string.

@param mixed $value Raw string

@return string           Quoted string
10464
protected function _quote($value)
    {
        if (is_int($value) || is_float($value)) {
            return $value;
        }
        $this->_connect();
        return "'" . $this->_connection->real_escape_string($value) . "'";
    }
124811
protected static function highlightQuote($value)
    {
        if (self::is_cli()) {
            return self::$cli_quote . $value . "\x1b[0m";
        } else {
            return '<span ' . self::$quote_attributes . '>' . $value . '</span>';
        }
    }
953348
protected function quote($value)
    {
        if ($value === null) {
            return 'NULL';
        }

        if (is_array($value)) {
            return join(', ', array_map([$this, 'quote'], $value));
        }

        return is_string($value)
            ? ('"' . $this->server->real_escape_string($value) . '"')
            : (is_float($value) ? (float)$value : (int)$value);
    }
630664
public function escape($value)
    {
        if (is_numeric($value)) {
            return $value;
        }

        return is_string($value) ? htmlspecialchars($value, ENT_QUOTES | ENT_SUBSTITUTE, $this->charset, false) : $value;
    }
999349
public function quote($value)
    {
        if (is_array($value)) {
            $result = [];
            foreach ($value as $single) {
                $result[] = $this->quote($single);
            }
            return sprintf(
                '(%s)',
                implode(', ', $result)
            );
        } else {
            return $this->pdo->quote($value);
        }
    }
684737
protected function pregQuote($value, $delimiter = '/')
    {
        if (is_array($value) || is_object($value)) {
            foreach ($value as &$_value) {
                $_value = $this->pregQuote($_value, $delimiter);
            } // unset($_value); // Housekeeping.
            return $value;
        }
        return preg_quote((string) $value, (string) $delimiter);
    }
1132327
public static function getStringRepresentation($value)
    {
        if (is_scalar($value) || $value === null) {
            $stringRepresentation = is_string($value) && !mb_check_encoding($value, 'UTF-8')
                ? 'non UTF-8 string'
                : var_export($value, true);
        } elseif (is_array($value)) {
            $stringRepresentation = 'array';
        } elseif (is_resource($value)) {
            $stringRepresentation = 'resource of type (' . get_resource_type($value) . ')';
        } else {
            $stringRepresentation = 'instance of ' . get_class($value);
        }
        return $stringRepresentation;
    }
541490
public function quoteIdentifier($value)
    {
        $quote = false;
        switch ($this->getConfig()->get(Formatter::CFG_QUOTE_IDENTIFIER_STRATEGY)) {
            case Formatter::QUOTE_IDENTIFIER_AUTO:
                $quote = ReservedWords::isReserved($value);
                break;

            case Formatter::QUOTE_IDENTIFIER_ALWAYS:
                $quote = true;
                break;
        }

        return $quote ? '`'.$value.'`' : $value;
    }
1282555
public function quote($value)
    {
        if ($value === null) {
            return 'NULL';
        }
        if ($value instanceof DateTimeInterface) {
            return $this->pdo->quote($value->format('Y-m-d H:i:s'));
        }
        if (is_array($value)) {
            return implode(',', array_map([$this, 'quote'], $value));
        }
        if (is_bool($value)) {
            return $this->pdo->quote($value ? 1 : 0);
        }

        return $this->pdo->quote($value);
    }
373490
public function esc(?string $value): string
    {
        if ($value === null) {
            return 'NULL';
        }

        $value = substr($this->pdo->quote($value), 1, -1);

        return $value;
    }
189492
private function escape($value)
    {
        if (1 !== preg_match($this->escapeCharacterPattern, $value)) {
            return htmlspecialchars($value, ENT_QUOTES);
        }

        return str_replace(
            $this->controlCharacters, $this->escapeCharacters, htmlspecialchars($value, ENT_QUOTES)
        );
    }
788906
public function escape_string($value)
    {
        if ($this->pdo) {
            return substr($this->pdo->quote($value), 1, -1);
        }
        return $value;
    }
522573
protected function _quote($value)
    {
        if (is_int($value)) {
            return $value;
        } elseif (is_float($value)) {
            return sprintf('%F', $value);
        }
        return "'" . addcslashes($value, "\000\n\r\\'\"\032") . "'";
    }
206628
protected function formatValue($value)
    {
        if (PHP_VERSION_ID < 50400) {
            return str_replace('\/', '/', json_encode($value));
        }

        return json_encode($value, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
    }
1020776
public function unescapeDoubleQuotedString($value)
    {
        $callback = function ($match) {
            return $this->unescapeCharacter($match[0]);
        };

        // evaluate the string
        return preg_replace_callback('/'.self::REGEX_ESCAPED_CHARACTER.'/u', $callback, $value);
    }
1198606
protected function _quote($value)
    {
        if (is_int($value)) {
            return $value;
        } elseif (is_float($value)) {
            return sprintf('%F', $value);
        }

        return "'" . str_replace("'", "''", $value) . "'";
    }
1046346
public function quote($value)
    {
        if (is_array($value)) {
            foreach ($value as $k => $v) {
                $value[$k] = $this->quote($v);
            }

            return $value;
        }
        if (is_null($value)) {
            return $value;
        }

        return $this->db->quoteValue($value);
    }