function file_progress_implementation

file_progress_implementation()

Determines the preferred upload progress implementation.

Return value

string|false A string indicating which upload progress system is available. Either "apc" or "uploadprogress". If neither are available, returns FALSE.

File

core/modules/file/file.module, line 914
Defines a "managed_file" Form API field and a "file" field for Field module.

Code

function file_progress_implementation() {
  static $implementation;
  if (!isset($implementation)) {
    $implementation = FALSE;

    // We prefer the PECL extension uploadprogress because it supports multiple
    // simultaneous uploads. APCu only supports one at a time.
    if (extension_loaded('uploadprogress')) {
      $implementation = 'uploadprogress';
    }
    elseif (extension_loaded('apc') && ini_get('apc.rfc1867')) {
      $implementation = 'apc';
    }
  }
  return $implementation;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!file!file.module/function/file_progress_implementation/8.1.x