function file_progress_implementation

Same name in other branches
  1. 7.x modules/file/file.module \file_progress_implementation()
  2. 9 core/modules/file/file.module \file_progress_implementation()
  3. 8.9.x core/modules/file/file.module \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.

Deprecated

in drupal:10.3.0 and is removed from drupal:11.0.0. Use extension_loaded('uploadprogress') instead.

See also

https://www.drupal.org/node/3397577

1 call to file_progress_implementation()
LegacyFileModuleTest::testFileProgressDeprecation in core/modules/file/tests/src/Kernel/LegacyFileModuleTest.php
@covers ::file_progress_implementation

File

core/modules/file/file.module, line 736

Code

function file_progress_implementation() {
    @trigger_error(__FUNCTION__ . '() is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. Use extension_loaded(\'uploadprogress\') instead. See https://www.drupal.org/node/3397577', E_USER_DEPRECATED);
    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';
        }
    }
    return $implementation;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.