tristanbes / my-poseo-bundle
Access to MyPoseo API
Installs: 60 368
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 4
Open Issues: 1
Type:symfony-bundle
Requires
- php: >=7.4
- ext-json: *
- php-http/client-common: ^1.0||^2.0
- php-http/client-implementation: ^1.0
- php-http/discovery: ^1.0
- php-http/httplug: ^1.0 || ^2.0
- psr/cache: ^1.0
- symfony/framework-bundle: ^4.4 || ^5.3
- symfony/yaml: ^4.4 || ^5.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16
- php-http/guzzle6-adapter: ^1.0 || ^2.0
- phpstan/phpstan: ^0.12.52
- phpstan/phpstan-phpunit: ^0.12.16
- phpstan/phpstan-strict-rules: ^0.12.5
- symfony/phpunit-bridge: ^4.4 || ^5.3
This package is auto-updated.
Last update: 2024-10-15 13:41:58 UTC
README
Description:
This bundle provides a way to communicate with MyPoseo webservices inside your Symfony4 application.
For now, only the Search API has been wired. If you need more, PR are welcome.
The Search API allows you to get the position of an URL by keyword(s) among other features.
Installation:
Add tristanbes/my-poseo-bundle to your composer.json:
php composer.phar require "tristanbes/my-poseo-bundle": "2.*"
Register the bundle in the kernel:
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Tristanbes\MyPoseoBundle\MyPoseoBundle() ); }
How to use it:
You can configure the bundle with:
my_poseo: api: key: "YOUR_API_KEY" cache_service_id: ~ http_client: 'name_of_your_http_adapter' type: search: base_url: "http://api.myposeo.com/m/apiv2"
Your API key can be found on this page.
Be careful, the given API key is already url encoded ! You need to decode it since guzzle re-encode automatically all parameters
Choose HTTP client
MyPoseoBundle 2.0 is no longer coupled to Guzzle3. Thanks to Httplug you can now use any library to transport HTTP messages. You can rely on discovery to automatically find an installed client or you can provide a client service name to the configuration (see HttplugBundle).