Skip to content

Commit

Permalink
Merge pull request #11 from mficzel/task/neos7
Browse files Browse the repository at this point in the history
TASK: Add Support for Neos 7
  • Loading branch information
kdambekalns committed Nov 15, 2021
2 parents ef003ec + 80ddfae commit 9a9efce
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 23 deletions.
35 changes: 35 additions & 0 deletions Classes/AssetSource/PixxioAssetSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Security\Account;
use Neos\Flow\Security\Context;
use Neos\Flow\ResourceManagement\ResourceManager;
use Neos\Media\Domain\Model\AssetSource\AssetProxyRepositoryInterface;
use Neos\Media\Domain\Model\AssetSource\AssetSourceInterface;
use Neos\Utility\MediaTypes;
Expand Down Expand Up @@ -57,6 +58,12 @@ class PixxioAssetSource implements AssetSourceInterface
*/
protected $securityContext;

/**
* @Flow\Inject
* @var ResourceManager
*/
protected $resourceManager;

/**
* @var string
*/
Expand Down Expand Up @@ -97,6 +104,16 @@ class PixxioAssetSource implements AssetSourceInterface
*/
private $assetSourceOptions;

/**
* @var string
*/
protected $iconPath;

/**
* @var string
*/
protected $description = '';

/**
* @param string $assetSourceIdentifier
* @param array $assetSourceOptions
Expand Down Expand Up @@ -161,6 +178,12 @@ public function __construct(string $assetSourceIdentifier, array $assetSourceOpt
}
}
break;
case 'icon':
$this->iconPath = $optionValue;
break;
case 'description':
$this->description = $optionValue;
break;
default:
throw new \InvalidArgumentException(sprintf('Unknown asset source option "%s" specified for Pixx.io asset source "%s". Please check your settings.', $optionName, $assetSourceIdentifier), 1525790910);
}
Expand Down Expand Up @@ -276,4 +299,16 @@ public function getPixxioClient(): PixxioClient
}
return $this->pixxioClient;
}

public function getIconUri(): string
{
return $this->resourceManager->getPublicPackageResourceUriByPath($this->iconPath);
}

public function getDescription(): string
{
return $this->description;
}


}
6 changes: 6 additions & 0 deletions Configuration/Settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ Neos:
enable: false
inUseTag: 'used-by-neos'

# The icon for the asset source
icon: 'resource://Flownative.Pixxio/Public/Icons/PixxioWhite.svg'

# The description for the asset source
description: 'Pixxio assets'

Neos:
modules:
management:
Expand Down
8 changes: 4 additions & 4 deletions Migrations/Mysql/Version20180517083014.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Neos\Flow\Persistence\Doctrine\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
Expand All @@ -13,7 +13,7 @@ class Version20180517083014 extends AbstractMigration
/**
* @return string
*/
public function getDescription()
public function getDescription(): string
{
return '';
}
Expand All @@ -24,7 +24,7 @@ public function getDescription()
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Migrations\AbortMigrationException
*/
public function up(Schema $schema)
public function up(Schema $schema): void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');

Expand All @@ -37,7 +37,7 @@ public function up(Schema $schema)
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Migrations\AbortMigrationException
*/
public function down(Schema $schema)
public function down(Schema $schema): void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');

Expand Down
14 changes: 14 additions & 0 deletions Resources/Public/Icons/PixxioWhite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 28 additions & 19 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
{
"description": "Neos integration for pixx.io",
"type": "neos-package",
"name": "flownative/neos-pixxio",
"license": "MIT",
"require": {
"neos/flow": "6.* || dev-master",
"neos/media": "5.* || 6.* || dev-master",
"guzzlehttp/guzzle": "6.*",
"behat/transliterator": "~1.0"
},
"autoload": {
"psr-4": {
"Flownative\\Pixxio\\": "Classes/"
"description": "Neos integration for pixx.io",
"type": "neos-package",
"name": "flownative/neos-pixxio",
"license": "MIT",
"require": {
"neos/flow": "6.* || 7.* || dev-master",
"neos/media": "5.* || 6.* || 7.* || dev-master",
"guzzlehttp/guzzle": "6.*",
"behat/transliterator": "~1.0"
},
"autoload": {
"psr-4": {
"Flownative\\Pixxio\\": "Classes/"
}
},
"extra": {
"neos": {
"package-key": "Flownative.Pixxio"
},
"applied-flow-migrations": [
"Neos.Flow-20190425144900",
"Neos.Flow-20190515215000",
"Neos.Flow-20200813181400",
"Neos.Flow-20201003165200",
"Neos.Flow-20201109224100",
"Neos.Flow-20201205172733",
"Neos.Flow-20201207104500"
]
}
},
"extra": {
"neos": {
"package-key": "Flownative.Pixxio"
}
}
}

0 comments on commit 9a9efce

Please sign in to comment.