-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
新增兼容swoole client addFile其他参数,支持文件分片上传
- Loading branch information
Showing
2 changed files
with
130 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: tioncico | ||
* Date: 2020-07-23 | ||
* Time: 15:33 | ||
*/ | ||
|
||
namespace EasySwoole\HttpClient\Bean; | ||
|
||
|
||
class CURLFile | ||
{ | ||
protected $path; | ||
protected $name; | ||
protected $type; | ||
protected $filename; | ||
protected $offset; | ||
protected $length; | ||
|
||
function __construct(string $filename,string $name,string $mimetype=null) | ||
{ | ||
$this->name = $name; | ||
$this->path = $filename; | ||
$this->type = $mimetype; | ||
$this->filename = $filename; | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getPath() | ||
{ | ||
return $this->path; | ||
} | ||
|
||
/** | ||
* @param mixed $path | ||
*/ | ||
public function setPath($path): void | ||
{ | ||
$this->path = $path; | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getName() | ||
{ | ||
return $this->name; | ||
} | ||
|
||
/** | ||
* @param mixed $name | ||
*/ | ||
public function setName($name): void | ||
{ | ||
$this->name = $name; | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getType() | ||
{ | ||
return $this->type; | ||
} | ||
|
||
/** | ||
* @param mixed $type | ||
*/ | ||
public function setType($type): void | ||
{ | ||
$this->type = $type; | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getFilename() | ||
{ | ||
return $this->filename; | ||
} | ||
|
||
/** | ||
* @param mixed $filename | ||
*/ | ||
public function setFilename($filename): void | ||
{ | ||
$this->filename = $filename; | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getOffset() | ||
{ | ||
return $this->offset; | ||
} | ||
|
||
/** | ||
* @param mixed $offset | ||
*/ | ||
public function setOffset($offset): void | ||
{ | ||
$this->offset = $offset; | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getLength() | ||
{ | ||
return $this->length; | ||
} | ||
|
||
/** | ||
* @param mixed $length | ||
*/ | ||
public function setLength($length): void | ||
{ | ||
$this->length = $length; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters