mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
initial commit
This commit is contained in:
commit
e324e70050
21 changed files with 1410 additions and 0 deletions
35
src/command/rename.php
Normal file
35
src/command/rename.php
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
/**
|
||||
* Copyright (c) 2012 Robin Appelman <icewind@owncloud.com>
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later.
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
|
||||
namespace SMB\Command;
|
||||
|
||||
class Rename extends Double {
|
||||
public function __construct($connection) {
|
||||
parent::__construct($connection);
|
||||
$this->command = 'rename';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $lines
|
||||
* @return bool
|
||||
*/
|
||||
protected function parseOutput($lines) {
|
||||
if (count($lines) === 0) {
|
||||
return true;
|
||||
} else {
|
||||
list($error,) = explode(' ', $lines[0]);
|
||||
switch ($error) {
|
||||
case 'NT_STATUS_OBJECT_PATH_NOT_FOUND':
|
||||
case 'NT_STATUS_OBJECT_NAME_NOT_FOUND':
|
||||
throw new \SMB\NotFoundException();
|
||||
default:
|
||||
throw new \Exception();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue