ekyna / digital-ocean-bundle
Deploy assets to digital ocean space CDN
Installs: 28
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=7.0
- guzzlehttp/guzzle: ^6.2
- league/flysystem-aws-s3-v3: ^1.0
- symfony/framework-bundle: ^3.0
README
Deploy assets to Digital Ocean space CDN
Installation
Install using composer:
composer require ekyna/digital-ocean-bundle
Register the bundle:
class AppKernel extends Kernel { public function registerBundles() { $bundles = [ // ... new Ekyna\Bundle\DigitalOceanBundle\EkynaDigitalOceanBundle(), ]; } }
Add the configuration:
ekyna_digital_ocean: api: token: YOUR_API_TOKEN spaces: - name: my-do-cdn # Must match space name on Digital Ocean region: ams3 key: SPACE_ACCESS_KEY secret: SPACE_ACCESS_SECRET usage: bundles: my-do-cdn # The space to use for assets deployment
Usage
Spaces storages are available as League\Flysystem\Filesystem (v1) services :
<!-- You can inject 'my-do-cdn' filesystem service --> <service id="Acme\Some\Service"> <argument type="service">ekyna_digital_ocean.my_do_cdn.filesystem</argument> </service>
Commands
You can deploy bundles assets to your space CDN by running the following command:
php bin/console ekyna:digital-ocean:assets:deploy
Warning: it purge the entire CDN cache.