|
@@ -10,16 +10,6 @@ use Dever;
|
|
|
|
|
|
class Yun
|
|
|
{
|
|
|
- private function getMethod($type)
|
|
|
- {
|
|
|
- if ($type == 1) {
|
|
|
- $method = 'oss';
|
|
|
- } else {
|
|
|
- $method = 'qiniu';
|
|
|
- }
|
|
|
- return Dever::load('upload/lib/view/' . $method);
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
public function cover($key, $video, $num = 1, $local = 2)
|
|
|
{
|
|
@@ -29,7 +19,7 @@ class Yun
|
|
|
$config = Dever::db('upload/yun')->one(array('host' => $host));
|
|
|
|
|
|
if ($config) {
|
|
|
- return $this->getMethod($config['type'])->cover($key, $video, $num, $local);
|
|
|
+ return Dever::load('upload/lib/yun')->getMethod($config['type'])->cover($key, $video, $num, $local);
|
|
|
}
|
|
|
|
|
|
return false;
|
|
@@ -61,7 +51,7 @@ class Yun
|
|
|
$cover = 2;
|
|
|
}
|
|
|
|
|
|
- list($type, $token, $domain, $bucket) = $this->getMethod($config['type'])->token($config, $upload);
|
|
|
+ list($type, $token, $domain, $bucket) = Dever::load('upload/lib/yun')->getMethod($config['type'])->token($config, $upload);
|
|
|
$result = array('type' => $type, 'uptoken' => $token, 'domain' => $domain, 'host' => $config['host'], 'bucket' => $bucket, 'cover' => $cover);
|
|
|
if ($return == 1) {
|
|
|
return $result;
|
|
@@ -80,7 +70,7 @@ class Yun
|
|
|
if (!$config) {
|
|
|
return 'error';
|
|
|
}
|
|
|
- $body = $this->getMethod($config['type'])->callback();
|
|
|
+ $body = Dever::load('upload/lib/yun')->getMethod($config['type'])->callback();
|
|
|
$file = $body['filename'];
|
|
|
$key = $body['key'];
|
|
|
$size = $body['filesize'];
|
|
@@ -150,7 +140,7 @@ class Yun
|
|
|
if ($upload['yun'] > 0 && $upload['vod_convert'] == 2) {
|
|
|
$config = Dever::db('upload/yun')->one($upload['yun']);
|
|
|
if ($config) {
|
|
|
- $this->getMethod($config['type'])->convert($key, $file, $config, $upload);
|
|
|
+ Dever::load('upload/lib/yun')->getMethod($config['type'])->convert($key, $file, $config, $upload);
|
|
|
}
|
|
|
}
|
|
|
$this->initFile($key, $file, $source, false, false, false, $search);
|