survos / bunny-bundle
Symfony bundle for interacting with BunnyCDN using https://github.com/ToshY/BunnyNet-PHP
Fund package maintenance!
kbond
Installs: 247
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^8.2
- symfony/config: ^6.4 || ^7.0
- symfony/dependency-injection: ^6.4 || ^7.0
- symfony/http-kernel: ^6.4 || ^7.0
- toshy/bunnynet-php: ^4.5
- twig/twig: ^3.4
- zenstruck/bytes: ^1.0
- zenstruck/console-extra: ^1.4
Requires (Dev)
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^11.4
- survos/simple-datatables-bundle: ^1.5.394
- symfony/browser-kit: ^6.4 || ^7.0
- symfony/framework-bundle: ^6.4 || ^7.0
- symfony/http-client: ^7.1
- symfony/phpunit-bridge: ^6.4 || ^7.0
- symfony/twig-bundle: ^6.4 || ^7.0
- symfony/var-dumper: ^6.4 || ^7.0
- symfony/yaml: ^7.1
Suggests
- survos/simple-datatables-bundle: searchable/sortable tables when browsing
- dev-main
- 1.5.394
- 1.5.393
- 1.5.392
- 1.5.391
- 1.5.390
- 1.5.389
- 1.5.388
- 1.5.387
- 1.5.386
- 1.5.385
- 1.5.384
- 1.5.383
- 1.5.382
- 1.5.381
- 1.5.380
- 1.5.379
- 1.5.378
- 1.5.377
- 1.5.376
- 1.5.375
- 1.5.374
- 1.5.373
- 1.5.372
- 1.5.371
- 1.5.370
- 1.5.369
- 1.5.368
- 1.5.367
- 1.5.366
- 1.5.365
- 1.5.364
- 1.5.363
- 1.5.362
- 1.5.361
- 1.5.360
- 1.5.359
- 1.5.358
- 1.5.357
- 1.5.356
- 1.5.355
- 1.5.354
- 1.5.353
- 1.5.352
- 1.5.351
- 1.5.350
- 1.5.349
- 1.5.345
- 1.5.344
- 1.5.343
- 1.5.342
- 1.5.341
- 1.5.340
- 1.5.339
- 1.5.338
- 1.5.337
- 1.5.336
- 1.5.335
- 1.5.334
- 1.5.333
- 1.5.332
- 1.5.331
- 1.5.330
- 1.5.329
- 1.5.328
- 1.5.327
- 1.5.326
- 1.5.325
- 1.5.324
- 1.5.323
- 1.5.322
- 1.5.321
- 1.5.320
- 1.5.319
- 1.5.318
- 1.5.317
- 1.5.316
- 1.5.315
- 1.5.314
- 1.5.313
- 1.5.312
- 1.5.311
- 1.5.310
- 1.5.309
- 1.5.308
- 1.5.307
- 1.5.306
- 1.5.305
- 1.5.304
- 1.5.303
- 1.5.302
- 1.5.301
- 1.5.300
- 1.5.299
- 1.5.298
- 1.5.297
- 1.5.296
- 1.5.295
- 1.5.294
- 1.5.293
- 1.5.292
- 1.5.291
- 1.5.290
- 1.5.289
- 1.5.288
This package is auto-updated.
Last update: 2024-11-21 23:47:19 UTC
README
A Symfony bundle to interact with BunnyCDN via the Bunny-PHP library.
Still under development, feedback welcome!
Quickstart
symfony new bunny-demo --webapp && cd bunny-demo composer require survos/bunny-bundle
Installation
Go to https://dash.bunny.net/account/api-key and get the main api key. You should create at least one zone, as the bundle does not support creating zones.
Create a new Symfony project.
symfony new bunny-demo --webapp && cd bunny-demo composer require survos/bunny-bundle bin/console bunny:config <api-key> >> .env.local bin/console bunny:list
You can browse interactively with the basic admin controller.
composer require survos/simple-datatables-bundle symfony server:start -d symfony open:local --path=/bunny/zones
Or edit .env.local and add your API key.
As each storage zone has its own passwords and id, these need to be configured individually in survos_bunny.yaml. Rather than tediously configuring each zone by cutting and pasting, we can use the first utility to dump the configuration with just the main api key. This saves you from having to go to https://dash.bunny.net/storage and go to each storage zone, then click on it and select "FTP and ApiAccess" and selecting each key.
bin/console bunny:config <api-key>
Note: use --filter to limit to the zones to a regex (@todo)
You can skip passing the api key on the command line by defining it as an environment variable, etc.
echo "BUNNY_API_KEY=api-key >> .env.local
This command dumps the packages/config/survos_bunny.yaml file with references to the environment variables, which are also dumped and should be added to .env.local. If your application only reads from bunny, you can remove the password environment variables, it is only used during writing. You can also remove the main api key if your application doesn't need it in production.
Open .env.local and replace the values.
Your application now has a bare-bones controller located at /admin/bunny, you may want to secure this route in security.yaml, or configure it in config/routes/survos_bunny.yaml.
You also have access to a command line interface.
bin/console bunny:list
+------------- museado/ -----+--------+ | ObjectName | Path | Length | +----------------+-----------+--------+ | photos finales | /museado/ | 0 | +----------------+-----------+--------+