Files
OMS/app/taskmgr/lib/interface/storage.php
2025-12-28 23:13:25 +08:00

52 lines
1.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Copyright © ShopeX http://www.shopex.cn. All rights reserved.
* See LICENSE file for license details.
*/
/**
* 导出数据文件存储介质外部调用接口类
*
* @author kamisama.xia@gmail.com
* @version 0.1
*/
//加载配置信息
require_once(dirname(__FILE__) . '/../../config/config.php');
class taskmgr_interface_storage{
private static $__storageObj;
public function __construct(){
if(!isset(self::$__storageObj)){
$storageClass = sprintf('taskmgr_storage_%s', __STORAGE_MODE);
self::$__storageObj = new $storageClass();
}
}
//存储数据成文件
public function save($source_file, $task_id, &$url){
return self::$__storageObj->save($source_file, $task_id, $url);
}
//读取文件获取数据
public function get($url, $local_file){
return self::$__storageObj->get($url, $local_file);
}
//读取文件获取数据
public function delete($url){
return self::$__storageObj->delete($url);
}
//识别当前文件存储模式,是否是本地存储模式
public function isLocalMode(){
if(defined('__STORAGE_MODE') && strtolower(__STORAGE_MODE) == 'local'){
return true;
}else{
return false;
}
}
}