@@ -135,11 +135,14 @@ public function rename($bucket, $oldname, $newname)
135
135
* @return mixed 成功返回NULL,失败返回对象Qiniu\Http\Error
136
136
* @link http://developer.qiniu.com/docs/v6/api/reference/rs/copy.html
137
137
*/
138
- public function copy ($ from_bucket , $ from_key , $ to_bucket , $ to_key )
138
+ public function copy ($ from_bucket , $ from_key , $ to_bucket , $ to_key, $ force = flase )
139
139
{
140
140
$ from = \Qiniu \entry ($ from_bucket , $ from_key );
141
141
$ to = \Qiniu \entry ($ to_bucket , $ to_key );
142
142
$ path = '/copy/ ' . $ from . '/ ' . $ to ;
143
+ if ($ force ) {
144
+ $ path .= '/force/true ' ;
145
+ }
143
146
list (, $ error ) = $ this ->rsPost ($ path );
144
147
return $ error ;
145
148
}
@@ -155,11 +158,14 @@ public function copy($from_bucket, $from_key, $to_bucket, $to_key)
155
158
* @return mixed 成功返回NULL,失败返回对象Qiniu\Http\Error
156
159
* @link http://developer.qiniu.com/docs/v6/api/reference/rs/move.html
157
160
*/
158
- public function move ($ from_bucket , $ from_key , $ to_bucket , $ to_key )
161
+ public function move ($ from_bucket , $ from_key , $ to_bucket , $ to_key, $ force = flase )
159
162
{
160
163
$ from = \Qiniu \entry ($ from_bucket , $ from_key );
161
164
$ to = \Qiniu \entry ($ to_bucket , $ to_key );
162
165
$ path = '/move/ ' . $ from . '/ ' . $ to ;
166
+ if ($ force ) {
167
+ $ path .= '/force/true ' ;
168
+ }
163
169
list (, $ error ) = $ this ->rsPost ($ path );
164
170
return $ error ;
165
171
}
0 commit comments