Common packaging operation OwnCloud

OwnCloudSDK

git repository address

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 OperateTutorial core classes, testthe directory has an example, but the use of testtime 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 testthe example of the.

Operate in core classes Introduction

  • Base.php: Base class that encapsulates some common methods
  • File.phpSome property values ​​file type, file records:
  • FilePath.php: Directory class to get a list of files in the specified directory
  • FileShare.php: File sharing class can be created for the file, folder sharing address, similar to Baidu cloud file-sharing
  • Folder.php: Directory operations class, you can create, move, delete directories.
  • UploadFile.php: File upload class, used to upload files to a specified directory
Published 184 original articles · won praise 72 · Views 400,000 +

Guess you like

Origin blog.csdn.net/YQXLLWY/article/details/89766370