swp / bridge-bundle
Bundle which acts as a bridge between the Superdesk Web publisher and the Superdesk Content API.
Installs: 9 308
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 5
Forks: 2
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.3
- guzzlehttp/guzzle: ^6.0
- superdesk/contentapi-sdk-php: dev-master
- swp/bridge: ^2.0
- swp/storage-bundle: ^2.0
- symfony/framework-bundle: ^4.2
- symfony/monolog-bridge: ^4.2
- symfony/monolog-bundle: ^3.3
- symfony/translation: ^4.2
- symfony/validator: ^4.2
Requires (Dev)
- doctrine/doctrine-bundle: ^1.10
- doctrine/orm: ^2.6
- phpdocumentor/reflection-docblock: ^4.0
- phpspec/phpspec: ^6.0
- phpunit/php-code-coverage: @stable
- phpunit/phpunit: ^5.0
- sensio/framework-extra-bundle: ^5.0
- swp/jms-serializer-bridge: ^2.0
- symfony/browser-kit: ^4.2
- symfony/doctrine-bridge: ^4.2
- symfony/http-kernel: ^4.2
- symfony/stopwatch: ^4.2
- dev-master / 2.2.x-dev
- 2.1.x-dev
- v2.1.0
- 2.0.x-dev
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v2.0.0-rc2
- v2.0.0-rc
- 1.5.x-dev
- v1.5.0
- 1.4.x-dev
- v1.4.0
- v1.4.0-beta2
- v1.4.0-beta
- 1.3.x-dev
- v1.3.0
- v1.3.0-rc
- v1.2.0
- v1.1.0
- 1.0.x-dev
- v1.0.0
- v0.6.0
- 0.5.x-dev
- v0.5.0
- 0.1.x-dev
- v0.1.1
- v0.1.0
- v0.0.1
- dev-takeit-patch-1
- dev-fix/cache_per_release
- dev-revert-969-slideshows_groups
This package is auto-updated.
Last update: 2024-12-16 23:03:50 UTC
README
This bundle is a bridge between the Superdesk Content API and the Superdesk Publisher.
Installation
- Download SWPBridgeBundle
- Enable the bundle and its dependencies
- Import SWPUpdaterBundle routing file
- Configure the SWPBridgeBundle
Step 1: Install SWPBridgeBundle with Composer
Run the following composer require command:
$ php composer.phar require swp/bridge-bundle
Step 2: Enable the bundle and its dependencies
Enable the bundle in AppKernel.php
.
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new SWP\Bundle\BridgeBundle\SWPBridgeBundle() ); }
Step 3: Import SWPBridgeBundle routing file
You have to import SWPBridgeBundle routing file. You can use YAML or XML format.
YAML:
# app/config/routing.yml swp_bridge: resource: "@SWPBridgeBundle/Resources/config/routing.yml" prefix: /
Step 4: Configure the SWPBridgeBundle
Add the following parameters to your config.yml
file.
# app/config/config.yml swp_bridge: api: host: 'example.com' auth: client_id: 'my_client_id' username: 'my_username' password: 'my_password'
This is a minimum requirement to get started, see the section Everything about configuration for more details.
Everything about configuration
Configuration reference
swp_bridge: api: host: 'The hostname of your Content API instance. This option is required.' port: 'The port of your Content API Instance, defaults to 80.' protocol: 'Protocol to use to connect to your Content API Instance, options are: _http_ and _https_. Defaults to _http_.' auth: client_id: 'Client ID for authenticating with your Content API Instance. This option is required.' username: 'Username for authenticating with your Content API Instance. This option is required.' password: 'Password for authenticating with your Content API Instance. This option is required.' options: 'An array of options which will included in each call in GuzzleApiClient->makeApiCall(). The values defined here will override values from the Request object if the keys are identical.'
Adding custom http client options:
SWPBridgeBundle uses Guzzle to fetch data from the external server. You can add
custom Guzzle options / headers for your http client by simply adding an array
of options as a parameter in your configuration.
The example below shows how to add custom curl options.
# app/config/config.yml swp_bridge: options: curl: # http://guzzle.readthedocs.org/en/latest/faq.html#how-can-i-add-custom-curl-options 10203: # integer value of CURLOPT_RESOLVE - "example.com:5050:localhost" # This will resolve the host example.com to your localhost
For more details see Guzzle documentation.
At this stage, the bundle is ready to be used by your application.
Development Configuration
The above example is specific for the Guzzle client and allows you to do custom
hostname resolving, practical when using docker in your devevelopment environment.
Just add 127.0.0.1 publicapi
to your hosts file and change the value
localhost to the ip address of you publicapi docker container.