php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #42965 copy() should support context parameters for URLs
Submitted: 2007-10-15 02:21 UTC Modified: 2010-08-17 14:19 UTC
Votes:4
Avg. Score:4.2 ± 0.4
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:0 (0.0%)
From: mmatson at apple dot com Assigned: kalle (profile)
Status: Closed Package: *General Issues
PHP Version: 5.2.4 OS: OS X 10.4.10
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mmatson at apple dot com
New email:
PHP Version: OS:

 

 [2007-10-15 02:21 UTC] mmatson at apple dot com
Description:
------------
The copy function should accept context parameters since it can accept 
URL's of the fopen wrapper variety. Specific situation where this is 
needed is when using ftp:// url's you should be able to specify 
overwrite context for the destination URL.

Reproduce code:
---------------
N/A: feature request for filesystem function

Expected result:
----------------
copy should be able to over write a destination file when using ftp:// 
url's

Actual result:
--------------
Throws error:
PHP Warning:  copy(ftp://...@host.com/testFTP/test): failed to open 
stream: Remote file already exists and overwrite context option not 
specified.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-16 23:56 UTC] kalle@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&revision=302376
Log: Fixed the context parameter on copy() to actually have an effect

# After looking at the logs, Jani did a bad merge into 5.3, so that
# the context parameter sent to copy() actually isn't used at all. This
# relatively simple patch fixes that for trunk.
#
# See FR #42965

# internals:
# This changes the php_copy_*() decls to contain an additional parameter for stream contexts
 [2010-08-16 23:57 UTC] kalle@php.net
-Status: Open +Status: Assigned -Package: Feature/Change Request +Package: *General Issues -Assigned To: +Assigned To: kalle
 [2010-08-17 14:19 UTC] kalle@php.net
-Status: Assigned +Status: Closed
 [2010-08-17 14:19 UTC] kalle@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Fixed for 5.3.4, see svn logs for more info why it wasn't working in 5.3.0-5.3.3
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 02 03:01:30 2025 UTC