1
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use think\Db;
|
||||
use think\Env;
|
||||
use phpseclib3\Net\SFTP;
|
||||
|
||||
//use TCPDF;
|
||||
|
||||
@@ -249,6 +250,40 @@ function getAuthor($article) {
|
||||
return $frag;
|
||||
}
|
||||
|
||||
|
||||
function pushSFTPForScopus($file)
|
||||
{
|
||||
$host = 'sftp-opsbank2.elsevier.com';
|
||||
$port = 22; // SFTP 默认端口号
|
||||
$username = 'pdf-e';
|
||||
$password = '?b#W5=T4';
|
||||
|
||||
// 创建 SFTP 连接
|
||||
$sftp = new SFTP($host, $port);
|
||||
|
||||
if (!$sftp->login($username, $password)) {
|
||||
exit('SFTP 登录失败');
|
||||
}
|
||||
|
||||
// 列出远程服务器的文件
|
||||
// $fileList = $sftp->nlist();
|
||||
// print_r($fileList);
|
||||
|
||||
// 上传文件到 SFTP 服务器
|
||||
$localFile = ROOT_PATH."public/articleXML/".$file;
|
||||
$remoteFile = '/data/incoming/tmr/'.$file;
|
||||
|
||||
$res = $sftp->put($remoteFile, $localFile, SFTP::SOURCE_LOCAL_FILE);
|
||||
|
||||
if ($res) {
|
||||
echo "文件上传成功!";
|
||||
} else {
|
||||
var_dump($sftp);
|
||||
// return $sftp;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function strongArticleList($list){
|
||||
$journal_stage_obj = Db::name("journal_stage");
|
||||
$journal_obj = Db::name("journal");
|
||||
|
||||
Reference in New Issue
Block a user