All Projects → WyriHaximus → Flypie

WyriHaximus / Flypie

Licence: mit
Flysystem plugin for CakePHP

Projects that are alternatives of or similar to Flypie

Users
Users Plugin for CakePHP
Stars: ✭ 488 (+1294.29%)
Mutual labels:  hacktoberfest, cakephp, cakephp-plugin
crud-users
CakePHP: Users plugin based on the CRUD action classes
Stars: ✭ 17 (-51.43%)
Mutual labels:  cakephp, cakephp-plugin
queue
A queue-interop compatible Queueing library
Stars: ✭ 25 (-28.57%)
Mutual labels:  cakephp, cakephp-plugin
Cakephp Tools
A CakePHP Tools plugin containing lots of useful helpers, behaviors, components, shells, ...
Stars: ✭ 325 (+828.57%)
Mutual labels:  cakephp, cakephp-plugin
mixerapi
A CakePHP Plugin for RESTful API Development [READ-ONLY]
Stars: ✭ 26 (-25.71%)
Mutual labels:  cakephp, cakephp-plugin
crud-view
CakePHP: Automated admin backend based on your CRUD configuration
Stars: ✭ 45 (+28.57%)
Mutual labels:  cakephp, cakephp-plugin
Bootstrap Ui
CakePHP: Transparently use Bootstrap
Stars: ✭ 293 (+737.14%)
Mutual labels:  cakephp, cakephp-plugin
cakephp-glide
CakePHP plugin for using Glide image manipulation library
Stars: ✭ 34 (-2.86%)
Mutual labels:  cakephp, cakephp-plugin
Cakepdf
CakePHP plugin for creating and/or rendering PDFs, supporting several popular PDF engines.
Stars: ✭ 360 (+928.57%)
Mutual labels:  cakephp, cakephp-plugin
Asset compress
An asset compression plugin for CakePHP. Provides file concatenation and a flexible filter system for preprocessing and minification.
Stars: ✭ 370 (+957.14%)
Mutual labels:  cakephp, cakephp-plugin
cakephp-api-pagination
📑 CakePHP 4 plugin that injects pagination information into API responses.
Stars: ✭ 39 (+11.43%)
Mutual labels:  cakephp, cakephp-plugin
Debug kit
Debug Toolbar for CakePHP applications.
Stars: ✭ 858 (+2351.43%)
Mutual labels:  cakephp, cakephp-plugin
cakephp-mailgun
Mailgun plugin for CakePHP 3
Stars: ✭ 23 (-34.29%)
Mutual labels:  cakephp, cakephp-plugin
cakephp-rest
CakePHP REST Plugin - Easily build REST API endpoints in your CakePHP application.
Stars: ✭ 23 (-34.29%)
Mutual labels:  cakephp, cakephp-plugin
cakephp-sequence
CakePHP plugin for maintaining a contiguous sequence of records
Stars: ✭ 41 (+17.14%)
Mutual labels:  cakephp, cakephp-plugin
Enum
Enumeration list for CakePHP 3
Stars: ✭ 27 (-22.86%)
Mutual labels:  cakephp, cakephp-plugin
cakephp-translate
A CakePHP plugin to manage translations of your static content the easy way via web backend.
Stars: ✭ 18 (-48.57%)
Mutual labels:  cakephp, cakephp-plugin
asset-mix
Provides helpers functions for CakePHP to use Laravel Mix.
Stars: ✭ 27 (-22.86%)
Mutual labels:  cakephp, cakephp-plugin
Crud
Production-grade rapid controller development with built in love for API and Search
Stars: ✭ 339 (+868.57%)
Mutual labels:  cakephp, cakephp-plugin
Docs
CakePHP CookBook
Stars: ✭ 653 (+1765.71%)
Mutual labels:  hacktoberfest, cakephp

FlyPie

Lightweight Flysystem wrapper/configuration plugin for CakePHP.

See below for CakePHP core version compatibility matrix.

Installation

To install via Composer, use the command below, it will automatically detect the latest version and bind it with ^.

composer require wyrihaximus/fly-pie 

Bootstrap

Add the following to your config/bootstrap.php to load the plugin.

Plugin::load('WyriHaximus/FlyPie', ['bootstrap' => true]);

Configuration

Example configuration (for in config/app_local.php):

/**
 * FlySystem filesystems
 */
'WyriHaximus' => [
    'FlyPie' => [
        's3_thumbnails' => [
            'adapter' => 'Local',
            'vars' => [
                __DIR__, // Path
                'second option',
                'third option',
            ],
        ],
    ],
],

At first it's namespaced within WyriHaximus.FlyPie to make sure it doesn't interfere with any other plugins. Secondly it's an associative array where every key is the alias for a specific plugin configuration. That is s3_thumbnails in our example. So when you need that filesystem somewhere in your project you can call $this->filesystem('s3_thumbnails'); on the trait.

To enable the filesystem panel in DebugKit add the configuration as shown below:

'DebugKit' => [
    'panels' => ['WyriHaximus/FlyPie.Filesystem'],
],

Configuration keys

  • adapter - adapter name or full qualified class name to use for this filesystem
  • vars - array containing the required settings for FlyPie to build an adapter for you. That is passed directly into newInstanceArgs upon adapter creation. (This is required in case you don't use a factory or provide the client.)
  • client - a prebuild client
  • factory - a callback, array (class instance, methodname), string (static class method or function name or event name) that can be utilized as a factory to build the adapter
  • url - Data Source Name. A connection string format that is formed like a URI. See below for examples.

Check out config/config.sample.php for more details.

Usage

FlyPie comes with the FilesystemsTrait trait that lets you easily access filesystems. The only method in the trait, filesystem($alias), provides access to the adapters you've defined in your configuration.

For example this lists all files in a S3 bucket with thumbnails:

$this->filesystem('s3_thumbnails')->listContents();

For more details on how to use Flysystem, check out its Getting Started section.

Supported Adapters

By default only a few adapters are included. Extra adapters can be added on a per case basis as extra composer packages. For all supported adapters see: https://github.com/thephpleague/flysystem#commonly-used-adapters

Example Data Source Names

Adapter Data Source Name
AsyncAwsS3Adapter s3://key:[email protected]et/path?region={{region}}

CakePHP version compatibility matrix

FlyPie CakePHP core PHP min
1.x 3.x PHP 5.4
2.x 4.x PHP 7.2

License

Copyright 2017 Cees-Jan Kiewiet

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].