OwnCloudSDK
Some common operations will be integrated owncloud, I wrote the first can be considered an open source project.
Which essentially means that simulate various webdav server requests to access the server corresponding to owncloud achieve obtain a list of folders, file upload, moving and other operations.
Directory Structure
- Connection: a number of requests for the encapsulation of
- Exception: For some unusual type of package, according to the service required, when an exception is thrown, processing corresponding to do.
- Operate: core operating class, is invoked by the user to the class.
- test: some test preparation class PHPUnit
- composer.json: expansion needed
Tutorial
About Operate
Tutorial core classes, test
the directory has an example, but the use of test
time in the example, you need to configure some values:
Open test/Base.php
, the following configured:
/**
* 读取配置值
* @return array
*/
public function getConfigData(){
return array(
'domain'=>"",// owncloud的域名
'user_name'=>"",// 对应的owncloud用户名
'password'=>"",// 对应的owncloud的密码
'is_https'=>true,// owncloud的域名是否使用了ca证书
'another_user_name'=>""// 另一个owncloud的账号,主要是用于进行文件分享测试的
);
}
It should use the server to build your company's configuration, Once configured, you can run test
the example of the.
Operate in core classes Introduction
Base.php
: Base class that encapsulates some common methodsFile.php
Some property values file type, file records:FilePath.php
: Directory class to get a list of files in the specified directoryFileShare.php
: File sharing class can be created for the file, folder sharing address, similar to Baidu cloud file-sharingFolder.php
: Directory operations class, you can create, move, delete directories.UploadFile.php
: File upload class, used to upload files to a specified directory