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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
50 - 43 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2020 The PHP Group
All rights reserved.
Last updated: Fri Oct 30 09:01:25 2020 UTC