Download the PHP package cyhello/seafile-php-sdk without Composer
On this page you can find all versions of the php package cyhello/seafile-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cyhello/seafile-php-sdk
More information about cyhello/seafile-php-sdk
Files in cyhello/seafile-php-sdk
Package seafile-php-sdk
Short Description This is a PHP package for accessing Seafile Web API
License MIT
Homepage https://github.com/Schmidt-DevOps/seafile-php-sdk
Informations about the package seafile-php-sdk
Seafile PHP SDK
This is a PHP package for accessing Seafile Web API.
German Web Application Developer Available for Hire!
No marketing skills whatsoever, but low rates, 20+ years of experience, and "german work attitude" -- whatever you associate with that.
Get in touch now: https://sdo.sh/#contact
What is Seafile?
- Open Source Cloud Storage for your teams and organizations
- Built in File Encryption, better Protecting your Privacy
- Collaboration around Files, file locking and other features make collaboration easy.
How to get Started
To get started with Seafile PHP SDK, you may either set up your own private Seafile server (see https://www.seafile.com/en/product/private_server/) or obtain a cloud account. Because the SDK is in its infancy it's highly recommended to set up a test server or create a test account.
It's not advisable yet to use your real server/account if you already got one.
After you have created your test account continue to the next step.
Roadmap and notes on development
Please note that this SDK currently is under active development and that things might change rather drastically.
If you are looking for stability please refer to stable tags.
Obtain API token
Please refer to the Seafile docs on how to obtain an API token.
This also applies to the token required for functional tests (TEST_SERVER_AUTHORIZATION_TOKEN
).
Installing Seafile-PHP-SDK
The recommended way to install seafile-php-sdk is through Composer.
Next, run the Composer command to install the latest stable version of seafile-php-sdk:
After installing, you need to require Composer's autoloader:
You can then later update seafile-php-sdk using Composer:
Using Seafile PHP SDK
Hint: Have a look at -- everything this SDK can do is covered there!
Connecting to Seafile
First, you need to include the API token (see above):
List available libraries
List directory contents
Check if directory item exists
Be aware that because Seafile Web API does not provide a function to do this check on its own, all items of the directory will get loaded for iteration. So that's not very efficient.
Create directory
Download file from unencrypted library
Download file from encrypted library
Trying to download a file from an encrypted library without unlocking it first would inevitably fail, so just unlock (API docs say "decrypt") the library before attempting:
Upload file
Update file
Get file details
Get API user account info
Get all accounts
Create account
Update account
Get account info by email address
Delete account
or
Get avatar of an account
or
Create and remove shared link
Get all starred files, star and unstar file
Debugging and how to enable logging of requests and responses
This example requires monolog. Log entries and Guzzle debug info will be written to stdout.
Issues
File::upload()
: Parameter$newFilename
actually does not set a new file name when uploading a file (thanks to https://github.com/FlorientR)
Dependencies
- PHP >=8.0 64 bits
- Guzzle 7.2
Seafile Web API Support Matrix
Resource | Web API Version | Support grade |
---|---|---|
Account | v2 | ★★★☆ |
Avatar | v2.1 | ★★★★ |
Events | v2 | Yet to be done, contact me |
File Share Link | v2.1 | ★★★☆ |
Group | v2 | ★☆☆☆ |
Library/Directory | v2 | ★★☆☆ |
Library/File | v2 | ★★☆☆ |
Library/Library | v2 | ★★☆☆ |
Library/Multiple Files | v2 | ★★★★ |
Organization | v2 | Yet to be done, contact me |
Starred Files | v2 | ★★★★ |
Seafile server compatibility
Tested with:
Seafile Server 5.1.3 for generic Linux/Debian JessieSeafile Server 5.1.3 for generic Linux/Debian WheezySeafile Server 5.1.4 for generic Linux/Ubuntu XenialSeafile Server 6.0.3 for generic Linux/Ubuntu Xenial- Seafile Server 7.x+ for Ubuntu 20.04 LTS
Support
I'd be happy to implement new features for you at a competitive hourly rate. Get in touch now: https://sdo.sh/#contact
Contributing
Please note that this package still is in its infancy. Only a part of the API has been implemented so far.
Pull requests are welcome. Please adhere to some very basic and simple principles:
- Follow "separation of concern" on all levels: 1 issue == 1 pull request. Do not cover multiple issues in a pull request.
- Unit tests raise the chance of your pull request getting accepted.
- The same goes for PHPDoc blocks.
Tests
There are two types of tests:
- Unit tests that test a code unit without external dependencies and no data manipulation. Please always provide at least unit tests when contributing.
- Functional tests that run against a live server instance (=may have external dependencies) and also alter data. Disabled and thus skipped by default. Please refer to
/phpunit/php
inphpunit.xml.dist
for information on how to enable functional tests.
Links
- https://seafile.com
- https://download.seafile.com/published/seafile-manual/develop/web_api_v2.1.md
- https://sdo.sh
- https://luckycloud.de/de/ (Seafile server hosting in Germany)
- https://www.yoursecurecloud.de/ (Seafile server hosting in Germany)
License
MIT © 2015-2021 Rene Schmidt DevOps UG (haftungsbeschränkt) & Co. KG
All versions of seafile-php-sdk with dependencies
guzzlehttp/guzzle Version ~7.2
marcusball/case-helper Version ~0.1
ext-json Version *
sdo/bitmask Version ~1.0