$82 GRAYBYTE WORDPRESS FILE MANAGER $73

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/php55/usr/share/pear/Symfony/Component/Serializer/Encoder/

HOME
Current File : /opt/alt/php55/usr/share/pear/Symfony/Component/Serializer/Encoder//JsonEncode.php
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Serializer\Encoder;

/**
 * Encodes JSON data
 *
 * @author Sander Coolen <sander@jibber.nl>
 */
class JsonEncode implements EncoderInterface
{
    private $options ;
    private $lastError = JSON_ERROR_NONE;

    public function __construct($bitmask = 0)
    {
        $this->options = $bitmask;
    }

    /**
     * Returns the last encoding error (if any)
     *
     * @return integer
     *
     * @see http://php.net/manual/en/function.json-last-error.php json_last_error
     */
    public function getLastError()
    {
        return $this->lastError;
    }

    /**
     * Encodes PHP data to a JSON string
     *
     * {@inheritdoc}
     */
    public function encode($data, $format, array $context = array())
    {
        $context = $this->resolveContext($context);

        $encodedJson = json_encode($data, $context['json_encode_options']);
        $this->lastError = json_last_error();

        return $encodedJson;
    }

    /**
     * {@inheritdoc}
     */
    public function supportsEncoding($format)
    {
        return JsonEncoder::FORMAT === $format;
    }

    /**
     * Merge default json encode options with context.
     *
     * @param array $context
     * @return array
     */
    private function resolveContext(array $context = array())
    {
        return array_merge(array('json_encode_options' => $this->options), $context);
    }
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
31 Aug 2024 7.05 AM
root / root
0755
ChainDecoder.php
1.985 KB
18 Dec 2019 6.24 PM
root / root
0644
ChainEncoder.php
2.468 KB
18 Dec 2019 6.24 PM
root / root
0644
DecoderInterface.php
1.188 KB
18 Dec 2019 6.24 PM
root / root
0644
EncoderInterface.php
0.926 KB
18 Dec 2019 6.24 PM
root / root
0644
JsonDecode.php
3.727 KB
18 Dec 2019 6.24 PM
root / root
0644
JsonEncode.php
1.602 KB
18 Dec 2019 6.24 PM
root / root
0644
JsonEncoder.php
1.865 KB
18 Dec 2019 6.24 PM
root / root
0644
NormalizationAwareInterface.php
0.601 KB
18 Dec 2019 6.24 PM
root / root
0644
SerializerAwareEncoder.php
0.746 KB
18 Dec 2019 6.24 PM
root / root
0644
XmlEncoder.php
13.487 KB
18 Dec 2019 6.24 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF