We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
・Not copy file security permissions. ・Copy directory security permissions.
public static function copy($path, $new_path, $source_area = null, $target_area = null) { $path = static::instance($source_area)->get_path($path); $new_path = static::instance($target_area ?: $source_area)->get_path($new_path); if ( ! is_file($path)) { throw new \InvalidPathException('Cannot copy file: given path: "'.$path.'" is not a file.'); } elseif (file_exists($new_path)) { throw new \FileAccessException('Cannot copy file: new path: "'.$new_path.'" already exists.'); } return copy($path, $new_path); ←←←←←←←←←←←←← Why not copy file security permissions? }
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
public static function copy($path, $new_path, $source_area = null, $target_area = null) { $path = static::instance($source_area)->get_path($path); $new_path = static::instance($target_area ?: $source_area)->get_path($new_path); if ( ! is_file($path)) { throw new \InvalidPathException('Cannot copy file: given path: "'.$path.'" is not a file.'); } elseif (file_exists($new_path)) { throw new \FileAccessException('Cannot copy file: new path: "'.$new_path.'" already exists.'); } if (copy($path, $new_path)) { return chmod($new_path, fileperms($path)); } return false; }
The text was updated successfully, but these errors were encountered:
Does that always succeed? Or is there a chance of the chmod failing, in which case a try/catch block is needed to handle the failure.
Sorry, something went wrong.
I am Japanese. Sorry. I am not good at English. Code is sample.
OK:Copy directory security permissions. Bug:Not copy file security permissions.
Why copy authority the directory only?
I understand that.
5e0e68a
No branches or pull requests
・Not copy file security permissions.
・Copy directory security permissions.
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
The text was updated successfully, but these errors were encountered: