2017 © Pedro Peláez
 

library barberry

image

barberry/barberry

  • Wednesday, June 13, 2018
  • by Magomogo
  • Repository
  • 6 Watchers
  • 33 Stars
  • 1,418 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 7 Forks
  • 5 Open issues
  • 16 Versions
  • 7 % Grown

The README.md

Build Status, (*1)

The problem

Every web project have different binary data to host and handle: images, PDFs, etc. In most cases those files should be converted in different ways:, (*2)

  • images: resize and format
  • PDF to image
  • Open office templates to MS Office documents and PDFs

Solution

This application can host a binary/text data (Documents) of a particular content type and convert it in requested way., (*3)

It intended to be deployed at separate hostname as bin.project-hostname. Also it is recommended to use cookieless domain for read-only serving of public content., (*4)

Installation

composer install
./phpunit

Usage

We desided to use REST interface. Here are the commands., (*5)

POST

Submitting data to the service., (*6)

Url: /
Data: Document and (optionally) variables to parse if Document is a template
Return: {id : "_auto_generated_id_string_", contentType: "_content_type_",
    ext: "_standart_file_extension_", length: _file_size_, filename: "_original_file_name_"}

GET

Getting a document., (*7)

Url: /_id_string_._ext_
Data: no
Return: Document

Example: /12wkr234ser349.pdf - get document "12wkr234ser349" as PDF, (*8)

Getting a document related to some restricted group, (*9)

Url: /_auth_group_3_letters_/_id_string_._ext_
Data: no
Return: Document

Example: /adm/6b12YX.pdf - get document "12wkr234ser349" as PDF, (*10)

Restriction of /adm/* URIs should be done externally. See section Authorization below., (*11)

DELETE

Deleting a document., (*12)

Url: /_id_string_
Data: no
Return: {}

Deployment

See https://github.com/Magomogo/barberry-service as a reference. Target application should depends from barberry/barberry and necessary converter plugins. Dependencies are handled with Composer., (*13)

Plugins

  • https://github.com/Magomogo/barberry-plugin-imagemagick - images conversion
  • https://github.com/kevich/barberry-plugin-pdf - PDF to text, PDF to image
  • https://github.com/ykovaleva/barberry-plugin-webcapture - make web sites screen shots as image or PDF with webkit engine
  • https://github.com/jamayka/barberry-plugin-openoffice - XSL, DOC, PDF other spreadsheet, templates and documents
  • https://github.com/ykovaleva/barberry-plugin-ffmpeg - converting video, taking frameshots

Authorization

Authorization should be done externally., (*14)

Example: Restrict all methods except GET with apache web server

<Directory %PUT_THE_PATH_HERE%/binary/public>

    AuthName "Restricted method"
    AuthType Basic
    AuthBasicProvider file
    AuthUserFile %PUT_THE_PATH_HERE%/passwords

    <LimitExcept GET>
        Require valid-user
    </LimitExcept>

    DirectoryIndex index.php
</Directory>

Magic

magic.mime.mgc version 8 (file version 5.09) is compatible only with php >=5.3.11
magic.mime.mgc version 7 (file version 5.04) is compatible with php <=5.3.10
both versions are included in barberry/interfaces

The Versions

13/06 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

13/06 2018

3.0.1

3.0.1.0

  Sources   Download

MIT

The Requires

 

The Development Requires

30/04 2018

dev-php7

dev-php7

  Sources   Download

MIT

The Requires

 

The Development Requires

30/04 2018

3.0.0

3.0.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

30/05 2017

2.2.2

2.2.2.0

  Sources   Download

MIT

The Requires

 

The Development Requires

20/03 2017

2.2.1

2.2.1.0

  Sources   Download

MIT

The Requires

 

The Development Requires

30/06 2016

2.2.0

2.2.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

30/04 2016

2.1.0

2.1.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

20/04 2016

2.0.1

2.0.1.0

  Sources   Download

MIT

The Requires

 

The Development Requires

02/04 2016

2.0.0

2.0.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

03/04 2013

1.1.x-dev

1.1.9999999.9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

02/04 2013

1.1.0

1.1.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

20/11 2012

1.0.x-dev

1.0.9999999.9999999-dev

  Sources   Download

MIT

The Requires

 

20/11 2012

1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires

 

20/11 2012

0.2.x-dev

0.2.9999999.9999999-dev

  Sources   Download

MIT

The Requires

 

07/11 2012

0.1.x-dev

0.1.9999999.9999999-dev

  Sources   Download

MIT

The Requires