1 file.module file_progress_implementation()

Determines the preferred upload progress implementation.

@since Backdrop 1.11.0: Deprecated. Upload progress is handled client-side. If uploadprogress and APC are unavailable, "client" will now always be returned, as client-side uploading is always available.

Return value

string: A string indicating which upload progress system is available. One of "uploadprogress", "apc", or "client".

File

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

Code

function file_progress_implementation() {
  static $implementation;
  if (!isset($implementation)) {
    // We prefer the PECL extension uploadprogress because it supports multiple
    // simultaneous uploads. APC only supports one at a time.
    if (extension_loaded('uploadprogress')) {
      $implementation = 'uploadprogress';
    }
    elseif (extension_loaded('apc') && ini_get('apc.rfc1867')) {
      $implementation = 'apc';
    }
    // Client-side support is always available.
    else {
      $implementation = 'client';
    }
  }
  return $implementation;
}