Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intention or bug? File::move does not update path #1782

Closed
hwiesmann opened this issue Mar 2, 2019 · 2 comments
Closed

Intention or bug? File::move does not update path #1782

hwiesmann opened this issue Mar 2, 2019 · 2 comments

Comments

@hwiesmann
Copy link

Describe the bug
After a call to File::move(...) File::getRealPath() still returns the path of the file's previous location. This does not make sense, I believe, because that location is invalid. Therefore, I tend to call this a bug.

CodeIgniter 4 version
CodeIgniter4 Alpha 4

Affected module(s)
File

Expected behaviour, and steps to reproduce if appropriate

This reproduces the bug(?):

log_message('debug',$file->getRealPath());
$file->move($newDirectory,$newName);
log_message('debug',$file->getRealPath()); // expected to be $newDirectory.$newName
@lonnieezell
Copy link
Member

Yes, that sounds like a bug!

@jim-parry jim-parry added this to the 4.0.0-beta.2 milestone Mar 5, 2019
@atishhamte
Copy link
Contributor

Here we need to update the reference of $file object to new file as this refers to old file object

lonnieezell added a commit that referenced this issue Mar 23, 2019
File::move now returns new file instance for relocated file. Fixes #1782
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants