Zend Framework

Zend_File_Transfer_Abstract_Http::getProgress does not mark transfer as completed for APC

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Cannot Reproduce
  • Affects Version/s: 1.9.6
  • Fix Version/s: 1.10.0
  • Component/s: Zend_File_Transfer
  • Labels:
    None

Description

The done flag is never being changed to 1. I verified the code and it seems it's only done for the branch using the fileprogress extension.

I could fix it locally. (see patch)

The same fix can be done as a workaround by making the same verification after the call. Zend_File_Transfer_Adapter_Http::getProgress( $id );
$upload['done'] = $upload['total'] == $upload['current'];

However, I am wondering is this change to done should not be made as part of receive() instead.

Activity

Hide
Louis-Philippe Huberdeau added a comment -

Patch to apply the same done check to both extensions.

Show
Louis-Philippe Huberdeau added a comment - Patch to apply the same done check to both extensions.
Hide
Thomas Weidner added a comment -

I can not verify this behaviour.

For APC the key "done" is part of the return value from apc_fetch.
It is part of APC's upload cache. See http://www.php.net/manual/en/apc.configuration.php#ini.apc.rfc1867 for details.

When you are not getting this return value within your environment then there is something completly wrong.

For the fileupload extension we simulate this key, therefor it is set explicitly for this extension.

Show
Thomas Weidner added a comment - I can not verify this behaviour. For APC the key "done" is part of the return value from apc_fetch. It is part of APC's upload cache. See http://www.php.net/manual/en/apc.configuration.php#ini.apc.rfc1867 for details. When you are not getting this return value within your environment then there is something completly wrong. For the fileupload extension we simulate this key, therefor it is set explicitly for this extension.
Hide
Louis-Philippe Huberdeau added a comment -

I don't know what the expected behavior is, but I can confirm that using APC 3.1.3pl1, 'done' is not being set to 1.

The initial sample of the feature by Rasmus sets the flag manually.
http://progphp.com/progress.phps

Show
Louis-Philippe Huberdeau added a comment - I don't know what the expected behavior is, but I can confirm that using APC 3.1.3pl1, 'done' is not being set to 1. The initial sample of the feature by Rasmus sets the flag manually. http://progphp.com/progress.phps
Hide
Thomas Weidner added a comment -

Reading the example you gave from Rasmus the "done" key is NOT set manually.

Wether while the upload is in progress, nor when it has been finished the key is set manually.

When in your beta-release of APC, the done key is not set you can not rely on it. Note that within default PHP installations (where APC is delivered) there is no problem.

Show
Thomas Weidner added a comment - Reading the example you gave from Rasmus the "done" key is NOT set manually. Wether while the upload is in progress, nor when it has been finished the key is set manually. When in your beta-release of APC, the done key is not set you can not rely on it. Note that within default PHP installations (where APC is delivered) there is no problem.
Hide
Thomas Weidner added a comment -

Closing as non-issue according to the given informations

Show
Thomas Weidner added a comment - Closing as non-issue according to the given informations
Hide
Louis-Philippe Huberdeau added a comment -

I made additional tests. The issue is not present when using APC 3.0.19.

Show
Louis-Philippe Huberdeau added a comment - I made additional tests. The issue is not present when using APC 3.0.19.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: