Giter VIP home page Giter VIP logo

flysystem-nextcloud's Introduction

Flysystem Nextcloud

Project stage: Development License Latest Version Maintained

PDS Interop standard-readme compliant keep-a-changelog compliant

Flysystem adapter for the Nextcloud filesystem

Table of Contents

Background

This project is part of the PHP stack of projects by PDS Interop. It is used by the Solid-Nextcloud app.

As the functionality seemed useful for other projects, it was implemented as a separate package.

Installation

The advised install method is through composer:

composer require pdsinterop/flysystem-nextcloud

Usage

This package offers features to interact with the Filesystem provided by Nextcloud through the Flysystem API.

To use the adapter, instantiate it and add it to a Flysystem filesystem:

<?php
/** @var IRootFolder $rootFolder */
$folder = $rootFolder->getUserFolder('userId')->get('/some/directory');

// Create the Nextcloud Adapter
$adapter = new \Pdsinterop\Flysystem\Adapter\Nextcloud($folder);

// Create Flysystem as usual, adding the Adapter
$filesystem = new \League\Flysystem\Filesystem($adapter);

// Read the contents of a file
$content = $filesystem->read('/some.file');

Develop

  • Do not forget to install the required dependencies using composer.

  • Most of the logic here involves Nextcloud and/or FlySystem. You'll want to familiarise yourself with their workings.

Contribute

Questions or feedback can be given by opening an issue on GitHub.

All PDS Interop projects are open source and community-friendly. Any contribution is welcome! For more details read the contribution guidelines.

All PDS Interop projects adhere to the Code Manifesto as its code-of-conduct. Contributors are expected to abide by its terms.

There is a list of all contributors on GitHub.

For a list of changes see the CHANGELOG or the GitHub releases page.

License

All code created by PDS Interop is licensed under the MIT License.

flysystem-nextcloud's People

Contributors

potherca avatar ylebre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

momuenten

flysystem-nextcloud's Issues

Rename package (and repo?) to flysystem-nextcloud-internal

Currently, the name of this repo (and package) could lead to confusion, as this adapter is not meant to talk to Nextcloud externally (the WebDav adapter is better suited for that) but to use the FlySystem API within Nextcloud.

To remedy this confusion, the package should be renamed to flysystem-nextcloud-internal or something similar.

We could also rename this repo but I am not (yet) convinced that is really needed...

Add (more) unit-tests

This repository does not contain any unit-tests.

The provided classes (Nextcloud, NextcloudCalendar, NextcloudContacts, NextcloudProfile) contain a mix of side-effects and input/output logic.

The best method to tests this code would be explorartory: instead of writing test logic first, just call the class-under-test, observe what happens and then add asserts to document those observations.

For these tests, complexity is more an issue than scope.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.