Skip to content

Commit

Permalink
Added support for all of the capture option classes to GrabzItBundle (#1
Browse files Browse the repository at this point in the history
)

* Added support for all of the capture option classes to GrabzItBundle
* Documentation and Test Changes to support the other option classes
  • Loading branch information
GrabzIt authored and TorbenLundsgaard committed Jun 4, 2019
1 parent 6ebea9e commit 26f595e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ tla_grabzit:
## Usage
The bundle registers the services `tla_grabzit.options` and `tla_grabzit.client`, which allows you to use the GrabzIt API.
The bundle registers the services `tla_grabzit.imageoptions`, `tla_grabzit.pdfoptions`, `tla_grabzit.docxoptions`, `tla_grabzit.animationoptions`, `tla_grabzit.tableoptions` and `tla_grabzit.client`, which allows you to use the GrabzIt API.


### Request a thumbnail from a service
Expand All @@ -63,7 +63,7 @@ class ThumbnailGenerator
{
$grabzItHandlerUrl = 'https://www.my-grabzit-thumbnail-site.com/api/thumbmail-ready';
$options = $this->container->get('tla_grabzit.options');
$options = $this->container->get('tla_grabzit.imageoptions');
$options->setBrowserWidth(1024);
$options->setBrowserHeight(768);
$options->setFormat("png");
Expand Down
12 changes: 10 additions & 2 deletions src/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<services>
<service id="tla_grabzit.options" class="GrabzIt\GrabzItImageOptions" public="true" />
<service id="GrabzIt\GrabzItImageOptions" alias="tla_grabzit.options" />
<service id="tla_grabzit.imageoptions" class="GrabzIt\GrabzItImageOptions" public="true" />
<service id="GrabzIt\GrabzItImageOptions" alias="tla_grabzit.imageoptions" />
<service id="tla_grabzit.pdfoptions" class="GrabzIt\GrabzItPDFOptions" public="true" />
<service id="GrabzIt\GrabzItPDFOptions" alias="tla_grabzit.pdfoptions" />
<service id="tla_grabzit.docxoptions" class="GrabzIt\GrabzItDOCXOptions" public="true" />
<service id="GrabzIt\GrabzItDOCXOptions" alias="tla_grabzit.docxoptions" />
<service id="tla_grabzit.animationoptions" class="GrabzIt\GrabzItAnimationOptions" public="true" />
<service id="GrabzIt\GrabzItAnimationOptions" alias="tla_grabzit.animationoptions" />
<service id="tla_grabzit.tableoptions" class="GrabzIt\GrabzItTableOptions" public="true" />
<service id="GrabzIt\GrabzItTableOptions" alias="tla_grabzit.tableoptions" />
<service id="tla_grabzit.client" class="GrabzIt\GrabzItClient" public="true">
<argument></argument>
<argument></argument>
Expand Down
2 changes: 1 addition & 1 deletion tests/DependencyInjection/TlaGrabzitExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ public function testLoad()
$extension = new TlaGrabzitExtension();
$extension->load([], $container);
$this->assertTrue($container->hasDefinition('tla_grabzit.client'));
$this->assertTrue($container->hasDefinition('tla_grabzit.options'));
$this->assertTrue($container->hasDefinition('tla_grabzit.imageoptions'));
}
}

0 comments on commit 26f595e

Please sign in to comment.