champs-libres/wopi-bundle

A bundle providing routes and glue code between Symfony and a WOPI connector.

dev-master 2021-11-26 15:10 UTC

This package is auto-updated.

Last update: 2021-12-26 15:22:54 UTC


README

Latest Stable Version GitHub stars Total Downloads GitHub Workflow Status Scrutinizer code quality Type Coverage Code Coverage License

WOPI Bundle

A Symfony bundle to facilitate the implementation of the WOPI endpoints and protocol.

Description

The Web Application Open Platform Interface (WOPI) protocol let you integrate Office for the web with your application. The WOPI protocol enables Office for the web to access and change files that are stored in your service.

Office for the web platforms:

Installation

composer require champs-libres/wopi-bundle

Usage

There are many different ways to store documents in an application. Therefore, this bundle does not provide a specific implementation of the WOPI protocol described through a basic interface from the champs-libres/wopi-lib bundle.

Thus, this bundle only provides the glue code between Symfony and champs-libres/wopi-lib.

It provides:

In order to use it, you must provide, through dependency injection, your own implementation of a service implementing the WOPI interface from champs-libres/wopi-lib.

With Symfony, bind your custom implementation to an alias as such in services.php:

<?php

declare(strict_types=1);

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use ChampsLibres\WopiLib\WopiInterface;
use App\Service\CustomWopiImplementation;

return static function (ContainerConfigurator $container) {
    $services = $container->services();

    $services
        ->defaults()
        ->autoconfigure(true)
        ->autowire(true);

    $services
        ->alias(WopiInterface::class, CustomWopiImplementation::class);
};

Documentation

Code quality, tests, benchmarks

Every time changes are introduced into the library, Github runs the tests.

The library has tests written with PHPSpec. Feel free to check them out in the spec directory. Run composer phpspec to trigger the tests.

Before each commit, some inspections are executed with GrumPHP; run composer grumphp to check manually.

The quality of the tests is tested with Infection a PHP Mutation testing framework, run composer infection to try it.

Static analyzers are also controlling the code. PHPStan and PSalm are enabled to their maximum level.

Contributing

Feel free to contribute to this project by submitting pull requests on Github.

Changelog

See CHANGELOG.md for a changelog based on git commits.

For more detailed changelogs, please check the release changelogs.