serialization.module 1.62 KB
Newer Older
1
<?php
2

3 4 5 6 7 8 9
/**
 * @file
 * Provides a service for (de)serializing data to/from formats such as JSON and XML.
 */

use Symfony\Component\HttpFoundation\Request;

10 11 12
/**
 * Implements hook_help().
 */
13 14 15
function serialization_help($route_name, Request $request) {
  switch ($route_name) {
    case 'help.page.serialization':
16 17 18 19 20 21 22 23 24 25
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('The Serialization module provides a service for serializing and deserializing data to and from formats such as JSON and XML.') . '</p>';
      $output .= '<p>' . t('Serialization is the process of converting data structures like arrays and objects into a string. This allows the data to be represented in a way that is easy to exchange and store (for example, for transmission over the Internet or for storage in a local file system). These representations can then be deserialized to get back to the original data structures.') . '</p>';
      $output .= '<p>' . t('The serializer splits this process into two parts. Normalization converts an object to a normalized array structure. Encoding takes that array and converts it to a string.') . '</p>';
      $output .= '<p>' . t('This module does not have a user interface. It is used by other modules which need to serialize data, such as <a href="!rest">REST</a>.', array('!rest' => \Drupal::url('help.page', array('name' => 'rest')))) . '</p>';
      $output .= '<p>' . t('For more information, see the <a href="!doc_url">online documentation for the Serialization module</a>.', array('!doc_url' => 'https://drupal.org/documentation/modules/serialization')) . '</p>';
      return $output;
  }
}