features/upload/lib/webdav.php
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class Uploader_Webdav {
- Exclude checks
Opening brace of a class must be on the line after the definition Open
Open
class Uploader_Webdav {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
"status" => $status
- Exclude checks
Method name "Uploader_Webdav::process_response" is not in camel caps format Open
Open
private function process_response($response) {
- Exclude checks
Function closing brace must go on the next line following the body; found 1 blank lines before brace Open
Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
$dir_path . "/" . $file_name;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
"status" => $status
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
$location = $response['headers']['location'];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
private function process_response($response) {
- Exclude checks
Method name "Uploader_Webdav::make_destination" is not in camel caps format Open
Open
private function make_destination($destination_dir) {
- Exclude checks
Function closing brace must go on the next line following the body; found 1 blank lines before brace Open
Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
} else {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
"location" => $location,
- Exclude checks
Method name "Uploader_Webdav::create_client" is not in camel caps format Open
Open
private function create_client() {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
return array(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
}
- Exclude checks
Method name "Uploader_Webdav::read_file" is not in camel caps format Open
Open
private function read_file($filepath) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
"location" => $location,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $username;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $password;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $url;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->create_client();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
foreach ($options as $key => $value) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
private function create_client() {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $proxy;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function __construct($options = []) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
// Please pass in the appropriate stuff
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if (property_exists($this, $key)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->$key = $value;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'baseUri' => $this->url,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$file_name = rawurlencode($file_name);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'proxy' => $this->proxy
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if ($status == 204) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'password' => $this->password,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
private function read_file($filepath) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'userName' => $this->username,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->client = new Client(array(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$fh = fopen($filepath, 'r');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
// but only kinda.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return $content;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
// Creates the directory into which we will PUT our file
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return $dir_path;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
error_log("WebDAV Driver: {$status} on PUT");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$location = $this->url . "/" .
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$dir_path . "/" . $file_name;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
// It kinda doesn't like creating a dir that exists
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
fclose($fh);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/* A status code of 201 means a new file was created.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$dir_path = $this->make_destination($destination_dir);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$response = $this->client->request('PUT', "/{$dir_path}/" . $file_name, $content);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$mkcol_response = $this->client->request('MKCOL', $dir_path);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$content = $this->read_file($filepath);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
// Which response code when a new file is really
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
private function make_destination($destination_dir) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
error_log("WebDAV Driver: {$mkcol_response['statusCode']} on MKCOL");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if ($mkcol_response['statusCode'] >= 400) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$status = $response['statusCode'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$content = fread($fh, filesize($filepath));
- Exclude checks
Class name "Uploader_Webdav" is not in camel caps format Open
Open
class Uploader_Webdav {
- Exclude checks
Opening brace should be on a new line Open
Open
public function __construct($options = []) {
- Exclude checks
Opening brace should be on a new line Open
Open
private function make_destination($destination_dir) {
- Exclude checks
Opening brace should be on a new line Open
Open
private function create_client() {
- Exclude checks
Opening brace should be on a new line Open
Open
private function process_response($response) {
- Exclude checks
Opening brace should be on a new line Open
Open
public function send($filepath, $destination_dir = '') {
- Exclude checks
Whitespace found at end of line Open
Open
$dir_path . "/" . $file_name;
- Exclude checks
Opening brace should be on a new line Open
Open
private function read_file($filepath) {
- Exclude checks
Whitespace found at end of line Open
Open
// Which response code when a new file is really
- Exclude checks