{"id":35784110,"url":"https://github.com/darsyn/fly-bundle","last_synced_at":"2026-01-07T06:38:32.383Z","repository":{"id":95654436,"uuid":"34919324","full_name":"darsyn/fly-bundle","owner":"darsyn","description":"A bundle that provides simple integration of the PHP League's Flysystem using service definitions.","archived":false,"fork":false,"pushed_at":"2016-02-11T13:12:44.000Z","size":21,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2023-03-01T23:55:55.222Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darsyn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-01T19:12:55.000Z","updated_at":"2023-04-30T17:08:58.182Z","dependencies_parsed_at":"2023-03-04T01:00:31.092Z","dependency_job_id":null,"html_url":"https://github.com/darsyn/fly-bundle","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/darsyn/fly-bundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darsyn%2Ffly-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darsyn%2Ffly-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darsyn%2Ffly-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darsyn%2Ffly-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darsyn","download_url":"https://codeload.github.com/darsyn/fly-bundle/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darsyn%2Ffly-bundle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28233394,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2026-01-07T02:00:05.975Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-07T06:38:30.808Z","updated_at":"2026-01-07T06:38:32.378Z","avatar_url":"https://github.com/darsyn.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Darsyn's Fly Bundle\n\nA bundle that provides simple integration of the PHP League's Flysystem using service definitions.\n\n**Note:** this bundle was conceived out of a desire to define multiple adapters and plugins through Symfony's *service\ncontainer* instead of a bulky config section (defining filesystems by enabling bundles without editing the\napplication configuration). I highly recommend using the\n[OneupFlysystemBundle](https://github.com/1up-lab/OneupFlysystemBundle) as it is [official recongnised as the Symfony\nbridging package by Flysystem](http://flysystem.thephpleague.com/integrations/).\n\nThis bundle prefers to use the [MountManager](http://flysystem.thephpleague.com/mount-manager) rather than individual\nfilesystems. As such, cache providers and plugins are applied to the entire mount system, rather than the filesystems\nthemselves.\n\n## License\n\nThis project is licensed under [MIT](http://j.mp/mit-license).\n\n## Dependencies\n\nThis bundle relies on the following components:\n\n- Symfony's [HTTP Kernel](https://github.com/symfony/httpkernel) component (for registering the bundle itself with the\n  [Symfony framework](http://symfony.com)).\n- Symfony's [Dependency Injection](https://github.com/symfony/dependencyinjection) component (for registering\n  Flysystem's MountManager  as services).\n- Symfony's [Config](https://github.com/symfony/config) component (for loading service definition configuration files).\n- [The PHP League](http://thephpleague.com/)'s [Flysystem](http://flysystem.thephpleague.com/) library, which this\n  entire bundle is based upon.\n\nIf you wish to run tests, this bundle also requires some development dependencies:\n\n- [Sebastian Bergmann](https://sebastian-bergmann.de/)'s [PHPUnit](http://phpunit.de) for unit testing.\n- [SquizLabs](https://www.squizlabs.com/)' [PHP CodeSniffer](http://pear.php.net/package/PHP_CodeSniffer) for reporting\n  PSR-2 coding standards.\n- [Pádraic Brady](http://blog.astrumfutura.com/)'s [Humbug](https://github.com/padraic/humbug) for mutation testing.\n\n### Adapter Dependencies\n\nThis bundle does not include dependencies for each filesystem type, you must require those in your `composer.json`\nyourself;\n\n- To access an [Amazon S3](http://aws.amazon.com/s3) filesystem, require `league/flysystem-aws-s3-v2` adapter.\n- To access an [Azure](http://azure.microsoft.com/en-gb/services/storage/) filesystem, require `league/flysystem-azure`\n  adapter.\n- To access a [Copy.com](https://www.copy.com) filesystem, require `league/flysystem-copy` adapter.\n- To access a [Dropbox](https://www.dropbox.com) filesystem, require `league/flysystem-dropbox` adapter.\n- To access a [GridFS](http://docs.mongodb.org/manual/core/gridfs) filesystem, require the `league/flysystem-gridfs`\n  adapter.\n- To access a [Rackspace](https://developer.rackspace.com/) filesystem, require the `league/flysystem-rackspace`\n  adapter.\n- To access an SFTP filesystem, require the `league/flysystem-sftp` adapter.\n- To access a WebDav filesystem, require the `league/flysystem-webdav` adapter.\n- To access a Zip archive filesystem, require the `league/flysystem-ziparchive` adapter.\n\nThe [Cache adapter](https://github.com/thephpleague/flysystem-cached-adapter) is already included, however the eventable\nfilesystem is not yet implemented in this bundle.\n\n## Installation\n\nInclude this bundle as a dependency of your project:\n\n```bash\n$ php composer.phar require \"darsyn/fly-bundle:~0.1\"\n```\n\nNext, activate the bundle in your application kernel:\n\n```php\n\u003c?php\n\nclass AppBundle\n{\n    public function registerBundles()\n    {\n        $bundles = [\n            // ...\n            new Darsyn\\Bundle\\FlyBundle\\DarsynFlyBundle,\n        ];\n        return $bundles;\n    }\n}\n```\n\n## Setup\n\nNow that the bundle has been enabled, it will search for any services that you define that are tagged with either\n`flysystem.adapter` or `flysystem.plugin` every time the configuration is compiled (when the cache is cleared via\n`app/console cache:clear` or when changes are detected in debug mode).\n\n### Defining Adapters\n\nTo define Flysystem adapters, tag your service definitions with `flysystem.adapter` and add a scheme attribute\n(restricted to a letter followed by any number of letters, numbers, hyphens, period or plus signs; see section 3.1 of\nRFC 3986).\n\nThe class defined by the tagged service definition **must** implement `League\\Flysystem\\AdapterInterface`.\n\nThe following example shows how to implement adapters for Amazon's S3 and Dropbox:\n\n```yaml\nparameters:\n    # Put these parameter definitions in your \"parameters.yml.dist\" file.\n    amazon.key: ~\n    amazon.secret: ~\n    amazon.bucket: ~\n    dropbox.access_token: ~\n    dropbox.client_identifier: ~\n\nservices:\n\n    # The adapters rely on these service definitions:\n    aws_credentials:\n        class:      Aws\\Common\\Credentials\\Credentials\n        arguments:  [ %amazon.key%, %amazon.secret% ]\n    s3_client:\n        class:      Aws\\S3\\S3Client\n        factory:    [ Aws\\S3\\S3Client, factory ]\n        arguments:  [ { credentials: @aws_credentials } ]\n    dropbox_client:\n        class:      Dropbox\\Client\n        arguments:  [ %dropbox.access_token%, %dropbox.client_identifier% ]\n\n    # These are the tagged adapter services:\n    my_amazon_flyadapter:\n        class:      League\\Flysystem\\AwsS3v2\\AwsS3Adapter\n        arguments:  [ @s3_client, %amazon.bucket% ]\n        tags:\n            - { name: flysystem.adapter, protocol: amazon }\n    my_dropbox_adapter:\n        class:      League\\Flysystem\\Dropbox\\DropboxAdapter\n        arguments:  [ @dropbox_client ]\n        tags:\n            - { name: flysystem.adapter, protocol: dropbox }\n```\n\n### Predefined Adapter Services\n\nThe bundle comes with one adapter preset for you; a local filesystem with the scheme `project`. It assumes your project\nroot directory is one above the kernel root directory, and uses that for this adapter.\n\nThe scheme for this adapter can be changed in the application configuration (or disabled completely if set to null):\n\n```yaml\ndarsyn_fly:\n    project_adapter: project\n```\n\n### Usage\n\nFlysystem can be used in your application by fetching the mount manager service `flysystem` and using it as described in\n[Flysystem's documentation](http://flysystem.thephpleague.com/mount-manager).\n\n```php\n\u003c?php\n\nclass YourController extends Controller\n{\n    public function indexAction()\n    {\n        $flysystem = $this-\u003econtainer-\u003eget('flysystem');\n        $flysystem-\u003emove(\n            'dropbox://Employment/MyCompany/WorkFromHome/MeetingMinutes.doc',\n            'amazon://FinancialDepartment/Meetings/2015-05-01/MayDayMinutes.doc'\n        );\n        $flysystem-\u003ecopy(\n            'amazon://Website/Styles/CSS/Latest.css',\n            'project://web/css/latest.css'\n        );\n    }\n}\n```\n\nThe `flysystem` service is an alias for the `darsyn_fly` service. You can change this service name (if there is a\nconflict where another bundle provides a service of this name) in the application configuration (or disable it\ncompletely by setting it to null).\n\nThe `darsyn_fly` service will always be available.\n\n```yaml\ndarsyn_fly:\n    alias: flysystem\n```\n\n## Caching\n\nCache can be enabled globally for all adapters in the configuration via the `darsyn_fly.cache` setting, but also per\nadapter in its service configuration by adding the `cache` attribute to an adapter tag.\n\nThe class defined in the service definition **must** implement `League\\Flysystem\\Cached\\CachedInterface`.\n\n```yaml\nservices:\n\n    global_cache_provider:\n        class: League\\Flysystem\\Cached\\Storage\\Memory\n    \n    adapter_cache_provider:\n        class: League\\Flysystem\\Cached\\Storage\\Predis\n\n    dropbox_client:\n        class:      Dropbox\\Client\n        arguments:  [ %dropbox.access_token%, %dropbox.client_identifier% ]\n\n    my_dropbox_adapter:\n        class:      League\\Flysystem\\Dropbox\\DropboxAdapter\n        arguments:  [ @dropbox_client ]\n        tags:\n            - { name: flysystem.adapter, scheme: dropbox, cache: adapter_cache_provider }\n\ndarsyn_fly:\n    cache: global_cache_provider\n```\n\n## Flysystem Plugins\n\nDefining plugins to be applied to the mount manager is the same as defining adapters, but tagged with `flysystem.plugin` instead (and no attributes are required).\n\nThe class defined in the service definition **must** implement `League\\Flysystem\\PluginInterface`.\n\n```yaml\nservices:\n\n    my_example_plugin:\n        class: AppBundle\\FlyPlugin\\Example\n        tags:\n            - { name: flysystem.plugin }\n```\n\n## Authors and Contributing\n\nCurrent authors include:\n\n- [Zander Baldwin](https://zanderbaldwin.com) \u003c[hello@zanderbaldwin.com](mailto:hello@zanderbaldwin.com)\u003e (on\n[GitHub](https://github.com/zanderbaldwin \"Zander Baldwin on GitHub\")).\n\nAll contributions are welcome, don't forget to add your name here in the pull request!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarsyn%2Ffly-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarsyn%2Ffly-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarsyn%2Ffly-bundle/lists"}