torqit/pimcore-flysystem-azure-bundle
not-reviewed
No Category
Detailstorqit/pimcore-flysystem-azure-bundle
No Category
Project Summary
Readme
This package enables Pimcore to write to an Azure Storage Account via Flysystem. It acts as a wrapper around https://github.com/thephpleague/flysystem-azure. To install:
- Run
composer require torqit/azure-flysystem-bundle:^1.0
- Set environment variables and values for
AZURE_STORAGE_ACCOUNT_NAME
,AZURE_STORAGE_ACCOUNT_CONTAINER
,AZURE_STORAGE_ACCOUNT_ASSETS_CONTAINER
andAZURE_STORAGE_ACCOUNT_KEY
that will allow the bundle to write to your Storage Account. -
Enable the bundle by doing one of the following:
- Add it to
var/config/extensions.php
:<?php return [ "bundle" => [ "TorqIT\\FlysystemAzureBundle\\FlysystemAzureBundle" => TRUE, ] ];
-
Add it to
Kernel.php
:use TorqIT\FlysystemAzureBundle\FlysystemAzureBundle; class Kernel extends PimcoreKernel { public function registerBundlesToCollection(BundleCollection $collection) if (class_exists('TorqIT\\FlysystemAzureBundle\\FlysystemAzureBundle')) { $collection->addBundle(new FlysystemAzureBundle); } }
-
Note that you may opt to only use the Storage Account in "upper" environments, and not while developing locally. In this case, you can conditionally enable the bundle in
Kernel.php
as follows:use TorqIT\FlysystemAzureBundle\FlysystemAzureBundle; class Kernel extends PimcoreKernel { public function registerBundlesToCollection(BundleCollection $collection) if (class_exists('TorqIT\\FlysystemAzureBundle\\FlysystemAzureBundle')) { if (!array_key_exists('LOCAL', $_ENV) || !$_ENV['LOCAL']) { $collection->addBundle(new FlysystemAzureBundle); } } }
where
LOCAL
is a boolean environment variable that can be set totrue
when developing your app locally.
-
- Add it to