views_streaming_data-8.x-1.x-dev/views_streaming_data.module

views_streaming_data.module
<?php

/**
 * @file
 * Contains hooks and related functions for the Views Streaming Data module.
 */

use Drupal\Core\Routing\RouteMatchInterface;

/**
 * Implements hook_views_plugins_row_alter().
 */
function views_streaming_data_views_plugins_row_alter(array &$plugins) {
  // Add ours as an allowed display type.
  $plugins['data_field']['display_types'][] = 'streaming_data';
}

/**
 * Implements hook_help().
 */
function views_streaming_data_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.views_streaming_data':
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('This module provides a views display type for CSV and JSON for exporting large result sets using a streaming Response and limiting the amount of memory consumed by the entity system. The goal is to allow exporting 100k and larger result sets without running out of PHP memory.') . '</p>';
      $output .= '<p>' . t('Obviously, this requires hacks and tweaks including possibly skipping some of the normal views hooks so that the views result can be iterated rather than loading the full SQL result set into memory initially. Live preview is skipped. Some other contributed modules that interact with views may be incompatible with this approach.') . '</p>';
      $output .= '<p>';
      $output .= t('Visit the <a href=":project_link">Views Streaming Data project pages</a> on Drupal.org for more information.', [
        ':project_link' => 'https://www.drupal.org/project/views_streaming_data',
      ]);
      $output .= '</p>';

      return $output;
  }
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc