PhpSerialize.php

Same filename in other branches
  1. 9 core/lib/Drupal/Component/Serialization/PhpSerialize.php
  2. 8.9.x core/lib/Drupal/Component/Serialization/PhpSerialize.php
  3. 10 core/lib/Drupal/Component/Serialization/PhpSerialize.php

Namespace

Drupal\Component\Serialization

File

core/lib/Drupal/Component/Serialization/PhpSerialize.php

View source
<?php

namespace Drupal\Component\Serialization;


/**
 * Default serialization for serialized PHP.
 */
class PhpSerialize implements ObjectAwareSerializationInterface {
    
    /**
     * {@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';
    }

}

Classes

Title Deprecated Summary
PhpSerialize Default serialization for serialized PHP.

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