Problem/Motivation
file_progress_implementation() is a legacy function that is redundant as we only support one file upload progress method, the uploadprogress pecl extension.
Steps to reproduce
Proposed resolution
Deprecate file_progress_implementation() and replace with extension_loaded('uploadprogress').
Remaining tasks
User interface changes
API changes
file_progress_implementation() is deprecated and replaced with extension_loaded('uploadprogress').
Data model changes
Release notes snippet
Issue fork drupal-3397575
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
kim.pepperComment #4
smustgrave commentedCR reads well with before/after example.
Seems all 5 instances of file_progress_implementation has been replaced.
Comment #5
longwaveI think we can improve usage of the new API in a couple of places, and is there the need for another API method, e.g.
::isAvailable()or similar that checks that some form of upload progress is available? Then the callers don't really need to know anything about the internals.Comment #6
kim.pepperRe: #5 Good idea! Added and implemented in a few places.
Comment #7
kim.pepperComment #8
smustgrave commentedAll threads do appear to be resolved. Wonder if it's too late for 10.2 though?
Comment #9
kim.pepperUpdated deprecation message to 10.3.0.
Comment #10
alexpottI feel like I've got to ask a couple of questions...
1. Is the static cache around extension_loaded() worth it. As far as I can see the answer is no. Locally
extension_loaded('uploadprogress');is as cheap as$a = 1 + 1;.2. Can't we just deprecate the function as replace with
extension_loaded('uploadprogress');- we only support one implementation - as far as I know there is no plan to support another.Comment #12
kim.pepperMakes total sense.
Comment #14
kim.pepperI'm preeetty sure the
Drupal.Tests.Core.DependencyInjection.YamlFileLoaderTestfail is not related to this issue.Comment #15
kim.pepperHad to rebase to fix the test fail. Updated the issue summary, so I think we are good for reviews now.
Comment #16
smustgrave commentedAppears to have open threads.
Have not re-reviewed yet.
Comment #17
longwaveThere is a second upload progress implementation that #1561866: Add support for built-in PHP session upload progress is trying to add support for, although it seems tricky and may never be completed.
Comment #18
longwaveComment #19
kim.pepperPersonally, I would rather not implement a new API just in case another implementation could be added in the future. I have made the mistake of over-abstracting in the past.
Comment #20
alexpott+1 to #19 - especially when there is #2833968: Upload progress using jQuery.form plugin instead of 3rd party PHP libraries which potentially removes all of this...
Comment #21
alexpottAnother thought - if we implement #1561866: Add support for built-in PHP session upload progress might it replace the uploadprogress implementation?
Comment #22
kim.pepperPECL upload progress is still supported and works on php 8+. Although it has the same limitation of not supporting fastcgi as session upload progress. Not sure if there is a reason for supporting one or the other.
In any case, I think we can continue with deprecating
file_progress_implementation()and replacing withextension_loaded('uploadprogress')as that is what core currently supports. If and when we add another implementation, we can create an new API then.Comment #23
kim.pepperAddressed feedback so back to NR.
Comment #24
kim.pepperAlso added a test. Not sure if we can test the
extension_loaded('uploadprogress')call. I guess we'll see what the gitlab ci images have installed.Comment #25
smustgrave commentedFollows up appear to have been opened and all threads resolved.
Comment #26
alexpottAdd a couple of comments to the MR that need adddressing.
Comment #27
kim.pepperComment #28
alexpottThanks for continuing to push on this @kim.pepper - I've hopefully explained myself a bit more on the MR.
Comment #30
sourabhjainComment #31
smustgrave commentedAdditional feedback has been addressed.
Comment #32
alexpottCommitted 0f7d46f and pushed to 11.x. Thanks!
Comment #34
kim.pepperThanks! Updated the issue summary.