定制 ruvart/openkm-client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ruvart/openkm-client

最新稳定版本:0.3

Composer 安装命令:

composer require ruvart/openkm-client

包简介

A generic unofficial REST API client for PHP for connecting with an OpenKM Server.

README 文档

README

A generic unofficial REST API client for PHP for connecting with an OpenKM Server.

http://github.com/ruvart/openkm-client
Ruvart contacto@ruvart.com

I created this client/library because I couldn't find the official one. Every single link I tried to follow in the OpenKM documentation for the PHP library threw an error, a missing file, or something similar.

Not all the API endpoints that OpenKM creates have been implemented in this client because I made it in a hurry and only implemented the ones that I needed for my project. However, I hope this library can still be helpful to you.

For any issues: http://github.com/ruvart/openkm-client/issues

To be honest, I will only attend to them when I have time. I hope you can understand.

*Note: The file name must contain the full route plus the file name or only the file's ID that OpenKM generates.

Installation

PHP 8.0 or above.

$ composer require ruvart/openkm-client

Basic Usage

$okmClient = new OpenKMClient($url,$user,$password, true);

//This funtion gets the route to the users folder (OpenKM User), it's the equivalent to C:\Users\user-name
//You can user any valid route if you don't wanna use the user's folder
$root = $okmClient->getRoot();

//Is a valid file
if ( $okmClient->documentIsValid($root . $file_name) ) {
    echo "It's a valid file";
}
else {
    echo "It's not a valid file";
}


//Filezise
$properties = $okmClient->documentGetProperties($root . $file_name);
if ( !empty($properties) && !empty($properties['actualVersion']) && !empty($properties['actualVersion']['size']) ) {
    echo $properties['actualVersion']['size'];
}


//Mime info
$properties = $okmClient->documentGetProperties($root . $file_name);
if ( !empty($properties) && !empty($properties['mimeType']) ) {
    echo $properties['mimeType'];
}


//Uploads a file
$okmClient->documentCreateSimple($root . $file_name, $route_to_local_file);


//rename a file
$okmClient->documentRename($root . $file_name, $only_new_name);


//copy a file
$okmClient->documentCopy($root . $file_name, $destiny_route);


//Stream a file
$okmClient->documentGetContent($root . $file_name, 'PHP:output');


//Deletes a file
$okmClient->documentDelete($root . $file_name);


//Make folder / dir
$okmClient->folderCreateSimple($root . $folder_name);

统计信息

  • 总下载量: 26
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-06