Skip to content

Commit

Permalink
initialize Froshing
Browse files Browse the repository at this point in the history
  • Loading branch information
tinect committed Jan 21, 2019
1 parent 239f21e commit aea9e26
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 52 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea/
vendor
2 changes: 1 addition & 1 deletion Components/BunnyCDNAdapter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace TinectMediaBunnycdn\Components;
namespace FroshBunnycdnMediaStorage\Components;

use Doctrine\Common\Cache\FilesystemCache;
use League\Flysystem\AdapterInterface;
Expand Down
9 changes: 9 additions & 0 deletions FroshBunnycdnMediaStorage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace FroshBunnycdnMediaStorage;

use Shopware\Components\Plugin;

class FroshBunnycdnMediaStorage extends Plugin
{
}
10 changes: 5 additions & 5 deletions Resources/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<parameters>
<parameter key="swag_media_bunnycdn.cache_dir">%kernel.cache_dir%/bunnycdn</parameter>
<parameter key="frosh_bunnycdn_media_storage.cache_dir">%kernel.cache_dir%/bunnycdn</parameter>
</parameters>

<services>
<service id="swag_media_bunnycdn.subscriber.adapter_collection_subscriber" class="TinectMediaBunnycdn\Subscriber\AdapterCollectionSubscriber">
<service id="frosh_bunnycdn_media_storage.subscriber.adapter_collection_subscriber" class="FroshBunnycdnMediaStorage\Subscriber\AdapterCollectionSubscriber">
<argument type="service" id="service_container" />
<argument type="service" id="swag_media_bunnycdn.cache" />
<argument type="service" id="frosh_bunnycdn_media_storage.cache" />
<tag name="shopware.event_subscriber"/>
</service>

<service id="swag_media_bunnycdn.cache" class="Doctrine\Common\Cache\FilesystemCache">
<argument type="string">%swag_media_bunnycdn.cache_dir%</argument>
<service id="frosh_bunnycdn_media_storage.cache" class="Doctrine\Common\Cache\FilesystemCache">
<argument type="string">%frosh_bunnycdn_media_storage.cache_dir%</argument>
</service>
</services>
</container>
5 changes: 2 additions & 3 deletions Subscriber/AdapterCollectionSubscriber.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace TinectMediaBunnycdn\Subscriber;
namespace FroshBunnycdnMediaStorage\Subscriber;

use Enlight\Event\SubscriberInterface;
use Enlight_Event_EventArgs;
use Doctrine\Common\Cache\FilesystemCache;
use Symfony\Component\DependencyInjection\ContainerInterface;
use TinectMediaBunnycdn\Components\BunnyCDNAdapter;
use FroshBunnycdnMediaStorage\Components\BunnyCDNAdapter;

class AdapterCollectionSubscriber implements SubscriberInterface
{
Expand Down Expand Up @@ -42,7 +42,6 @@ public function createBunnyCDNAdapter(Enlight_Event_EventArgs $args)
$defaultConfig = ['migration' => false];
$config = $args->get('config');


return new BunnyCDNAdapter(array_merge($config,$defaultConfig), $this->cache, $this->container);
}
}
9 changes: 0 additions & 9 deletions TinectMediaBunnycdn.php

This file was deleted.

13 changes: 3 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
{
"name": "tinect/mediabunnycdn",
"keywords": ["shopware", "backend", "media", "media manager", "bunnyCDN"],
"name": "frosh/bunnycdn-media-storage",
"keywords": ["shopware", "backend", "media", "media manager", "bunnyCDN", "storage"],
"description": "bunnyCDN",
"license": "MIT",
"type": "shopware-plugin",
"authors": [
{
"name": "tinect",
"homepage": "https://github.com/tinect",
"role": "Developer"
}
],
"extra": {
"installer-name": "TinectMediaBunnycdn"
"installer-name": "FroshBunnycdnMediaStorage"
},
"require": {
"composer/installers": "~1.0"
Expand Down
43 changes: 19 additions & 24 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,36 @@
<plugin xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/shopware/shopware/5.2/engine/Shopware/Components/Plugin/schema/plugin.xsd">

<version>1.0.2</version>
<author>tinect</author>
<license>MIT</license>

<label>TinectMediaBunnycdn</label>
<label>Media-Storage-Adapter for bunnyCDN</label>
<label lang="de">Media-Storage-Adapter für bunnyCDN</label>

<description><![CDATA[
<p>BunnyCDN-Extension for Media Adapter</p>
<version>1.0.3</version>
<copyright>Friends of Shopware</copyright>
<license>MIT</license>
<link>https://github.com/FriendsOfShopware/FroshBunnycdnMediaStorage</link>
<author>Friends of Shopware</author>

config.php:
<pre>'cdn' =>
[
'backend' => 'bunnycdn',
'adapters' => [
'bunnycdn' =>
array (
'type' => 'bunnycdn',
'mediaUrl' => 'https://example.b-cdn.net/',
'apiUrl' => 'https://storage.bunnycdn.com/example/',
'apiKey' => 'secret-api-key'
)
]</pre><br>
dont't forget running "bin/console sw:media:migrate --from=local --to=bunnycdn" if you have existing media.<br>
More Info: https://developers.shopware.com/developers-guide/shopware-5-media-service/#file-system-adapters
]]></description>
<description lang="en">Media-Storage-Adapter for bunnyCDN</description>
<description lang="de">Media-Storage-Adapter für bunnyCDN</description>

<changelog version="1.0.3">
<changes lang="de">Willkommen bei Frosh</changes>
<changes lang="en">Welcome to Frosh</changes>
</changelog>

<changelog version="1.0.2">
<changes lang="de"><![CDATA[
- implementiere listContents
]]></changes>
<changes><![CDATA[
- implement listContents
]]></changes>
</changelog>

<changelog version="1.0.1">
<changes lang="de"><![CDATA[
- implement new cache
]]></changes>
<changes><![CDATA[
- implement new cache
]]></changes>
Expand Down

0 comments on commit aea9e26

Please sign in to comment.