class PhpSerialize

Same name in other branches
  1. 9 core/lib/Drupal/Component/Serialization/PhpSerialize.php \Drupal\Component\Serialization\PhpSerialize
  2. 10 core/lib/Drupal/Component/Serialization/PhpSerialize.php \Drupal\Component\Serialization\PhpSerialize
  3. 11.x core/lib/Drupal/Component/Serialization/PhpSerialize.php \Drupal\Component\Serialization\PhpSerialize

Default serialization for serialized PHP.

Hierarchy

Expanded class hierarchy of PhpSerialize

1 file declares its use of PhpSerialize
GarbageCollectionTest.php in core/tests/Drupal/KernelTests/Core/KeyValueStore/GarbageCollectionTest.php
1 string reference to 'PhpSerialize'
core.services.yml in core/core.services.yml
core/core.services.yml
1 service uses PhpSerialize
serialization.phpserialize in core/core.services.yml
Drupal\Component\Serialization\PhpSerialize

File

core/lib/Drupal/Component/Serialization/PhpSerialize.php, line 8

Namespace

Drupal\Component\Serialization
View source
class PhpSerialize implements SerializationInterface {
    
    /**
     * {@inheritdoc}
     */
    public static function encode($data) {
        return serialize($data);
    }
    
    /**
     * {@inheritdoc}
     */
    public static function decode($raw) {
        return unserialize($raw);
    }
    
    /**
     * {@inheritdoc}
     */
    public static function getFileExtension() {
        return 'serialized';
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
PhpSerialize::decode public static function Decodes data from the serialization format. Overrides SerializationInterface::decode
PhpSerialize::encode public static function Encodes data into the serialization format. Overrides SerializationInterface::encode
PhpSerialize::getFileExtension public static function Gets the file extension for this serialization format. Overrides SerializationInterface::getFileExtension

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.