- Timestamp:
- 05/29/2015 08:16:22 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-filesystem-ssh2.php
r31686 r32654 43 43 public $keys = false; 44 44 45 public function __construct($opt='') { 45 /** 46 * 47 * @param array $opt 48 */ 49 public function __construct( $opt = '' ) { 46 50 $this->method = 'ssh2'; 47 51 $this->errors = new WP_Error(); … … 90 94 $this->options['password'] = $opt['password']; 91 95 } 92 93 } 94 96 } 97 98 /** 99 * 100 * @return bool 101 */ 95 102 public function connect() { 96 103 if ( ! $this->keys ) { … … 127 134 * @return bool|string 128 135 */ 129 public function run_command( $command, $returnbool = false) { 130 136 public function run_command( $command, $returnbool = false ) { 131 137 if ( ! $this->link ) 132 138 return false; … … 167 173 168 174 /** 169 * @param string $file170 * @param string $contents175 * @param string $file 176 * @param string $contents 171 177 * @param bool|int $mode 172 178 * @return bool … … 183 189 } 184 190 191 /** 192 * 193 * @return bool 194 */ 185 195 public function cwd() { 186 196 $cwd = $this->run_command('pwd'); … … 202 212 * @param string $file 203 213 * @param string $group 204 * @param bool $recursive 214 * @param bool $recursive 215 * 216 * @return bool 205 217 */ 206 218 public function chgrp($file, $group, $recursive = false ) { … … 214 226 /** 215 227 * @param string $file 216 * @param int $mode217 * @param bool $recursive228 * @param int $mode 229 * @param bool $recursive 218 230 * @return bool|string 219 231 */ … … 290 302 291 303 /** 304 * @param string $source 305 * @param string $destination 306 * @param bool $overwrite 307 * @param int|bool $mode 308 * @return bool 309 */ 310 public function copy($source, $destination, $overwrite = false, $mode = false) { 311 if ( ! $overwrite && $this->exists($destination) ) 312 return false; 313 $content = $this->get_contents($source); 314 if ( false === $content) 315 return false; 316 return $this->put_contents($destination, $content, $mode); 317 } 318 319 /** 292 320 * @param string $source 293 321 * @param string $destination 294 * @param bool $overwrite 295 * @param int|bool $mode 296 * @return bool 297 */ 298 public function copy($source, $destination, $overwrite = false, $mode = false) { 299 if ( ! $overwrite && $this->exists($destination) ) 300 return false; 301 $content = $this->get_contents($source); 302 if ( false === $content) 303 return false; 304 return $this->put_contents($destination, $content, $mode); 305 } 306 307 /** 308 * @param string $source 309 * @param string $destination 310 * @param bool $overwrite 322 * @param bool $overwrite 311 323 * @return bool 312 324 */ … … 316 328 317 329 /** 318 * @param string $file319 * @param bool $recursive330 * @param string $file 331 * @param bool $recursive 320 332 * @param string|bool $type 321 333 * @return bool … … 404 416 /** 405 417 * @param string $file 406 * @param int $time407 * @param int $atime418 * @param int $time 419 * @param int $atime 408 420 */ 409 421 public function touch($file, $time = 0, $atime = 0) { … … 413 425 /** 414 426 * @param string $path 415 * @param mixed $chmod416 * @param mixed $chown417 * @param mixed $chgrp427 * @param mixed $chmod 428 * @param mixed $chown 429 * @param mixed $chgrp 418 430 * @return bool 419 431 */ … … 436 448 /** 437 449 * @param string $path 438 * @param bool $recursive450 * @param bool $recursive 439 451 * @return bool 440 452 */ … … 445 457 /** 446 458 * @param string $path 447 * @param bool $include_hidden448 * @param bool $recursive459 * @param bool $include_hidden 460 * @param bool $recursive 449 461 * @return bool|array 450 462 */
Note: See TracChangeset
for help on using the changeset viewer.