Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
1dd76dc
[TASK] Migrate to new query build api
fabarea Mar 1, 2023
f0e7bac
[TASK] Clean up some php comments
fabarea Mar 1, 2023
6ad6815
[FEATURE] Introduce cloudinary web hook handler
fabarea Mar 1, 2023
fb17629
fixup! [FEATURE] Introduce cloudinary web hook handler
fabarea Mar 7, 2023
a1493fc
[CLEANUP] Rework annotations
fabarea Mar 21, 2023
4419f36
[TASK] Fix type
fabarea Mar 21, 2023
88c2163
[FEATURE] Introduce cloudinary resource tagging and metadata
fabarea Mar 21, 2023
5723bb5
fixup! fixup! [FEATURE] Introduce cloudinary web hook handler
fabarea Mar 21, 2023
83ae9a8
[TASK] Remove legacy driver
fabarea Mar 28, 2023
6327699
[TASK] Rename fast driver to cloudinary driver
fabarea Mar 28, 2023
53dc7a6
[TASK] Update help message for cloudinary command query
fabarea Mar 28, 2023
1233fbe
[TASK] Remove unnecessary php docs
fabarea Mar 28, 2023
f5b1059
[TASK] Streamline ext_localconf
fabarea Mar 28, 2023
f22263b
fixup! [TASK] Update help message for cloudinary command query
fabarea Mar 28, 2023
3ff0b6b
[FEATURE] Introduce new typo3 command to interact with cloudinary api
fabarea Mar 28, 2023
f489f0f
[TASK] Update phpstan baseline
fabarea Mar 28, 2023
f217dca
[TASK] Composer update
fabarea Mar 28, 2023
f6c34e4
[FEATURE] Add cloudinary api query by file uid
fabarea Mar 28, 2023
343c2b6
[TASK] Better handle file rename in web hook
fabarea Mar 28, 2023
3102751
[TASK] Add phpstan command in make file
fabarea Mar 28, 2023
34cce06
[TASK] Fix CGL and introduce an event after clear cache pages
fabarea Mar 28, 2023
e2f1af9
[TASK] Improve code readability and enhance support for file renaming
fabarea Mar 30, 2023
4f5e48f
[TASK] Add example TypoScript configuration for Cloudinary WebHook
fabarea Mar 30, 2023
a74b55c
[CLEANUP] Remove unused import ExtensionManagementUtility
fabarea Mar 30, 2023
fd65b7b
[TASK] Change message to use simpler language
fabarea Mar 30, 2023
287ffe8
[TASK] Add message to response indicating which pages had their cache…
fabarea Mar 30, 2023
12f8e63
[TASK] Improve result key to be a boolean
fabarea Apr 3, 2023
403ab0f
[DOCS] Add configuration TCEFORM for interaction with Cloudinary
fabarea Apr 13, 2023
82926b0
[TASK] Indentation and return type
fabarea Apr 14, 2023
2c3bb79
[TASK] Improve console log message
fabarea Apr 14, 2023
2c94f4c
[BUGFIX] Make CloudinaryPathService nullable
fabarea May 5, 2023
1495898
[TASK] Change error message to warning message
fabarea May 5, 2023
3378ef9
fix: Only add extension for raw resources
dhuf May 5, 2023
1df0377
[REFACTOR] Better computing of cloudinary public id
fabarea May 8, 2023
58f8653
[TASK] Handle exception in fileExists method
fabarea May 8, 2023
4779723
[TASK] Add type hinting and nullable property for cloudinaryPathService
fabarea May 8, 2023
faa851a
[REFACTOR] Replace strpos with str_starts_with function for readabili…
fabarea May 8, 2023
45e8626
[ENHANCE] Option for command cloudinary:scan
fabarea May 8, 2023
2b3aebe
[REFACTOR] Streamline return types to methods that were missing them
fabarea May 8, 2023
0369655
[BUGFIX] Migrate signal slot to event dispatcher
fabarea May 9, 2023
02bf93d
[TASK] Change table name from tx_cloudinary_resource to tx_cloudinary…
fabarea May 9, 2023
1a97258
[TASK] Remove unused translation for Cloudinary resources in tt_conte…
fabarea May 9, 2023
004ec22
[CGL] Improve php return type
fabarea May 9, 2023
cf960ef
[REFACTOR] Move knownRawFormats to static property
fabarea May 9, 2023
23c3cc3
[BUGFIX] streamline computeCloudinaryPublicId method
fabarea May 9, 2023
463cd95
[BUGFIX] Improve fileExists method to return true for processed files
fabarea May 9, 2023
a13eea3
[CGL] phpstan
fabarea May 9, 2023
99f2264
[STYLE] Add return type declarations to initialize and configure meth…
fabarea May 9, 2023
1543f55
[FEATURE] Enable to recursively delete files from the command cloudin…
fabarea May 9, 2023
cdd25b6
[ENHANCE] Add help text to cloudinary:scan command
fabarea May 9, 2023
b9beafc
[REFACTOR] Remove redundant prefix from log messages in CloudinaryDri…
fabarea May 9, 2023
d8e29f8
[ENHANCE] Avoid creating empty processed folder
fabarea May 9, 2023
228eda5
[REFACTOR] Centralize getStorageObject() call
fabarea May 9, 2023
62b4d5b
[REFACTOR] Introduce MimeTypeUtility class to handle mime type guessing
fabarea May 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
.prettierrc
package.json
yarn.lock
composer.lock
/public/*
/vendor/*
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
use TYPO3\CMS\Core\Resource\ResourceStorage;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Fluid\View\StandaloneView;
use Visol\Cloudinary\Driver\CloudinaryFastDriver;
use Visol\Cloudinary\Driver\CloudinaryDriver;
use Visol\Cloudinary\Services\ConfigurationService;

class InlineCloudinaryControlContainer extends InlineControlContainer
{

public function render() {

public function render()
{
// We load here the cloudinary library
/** @var AssetCollector $assetCollector */
$assetCollector = GeneralUtility::makeInstance(AssetCollector::class);
Expand All @@ -32,11 +32,7 @@ public function render() {
return parent::render();
}

/**
* @param array $inlineConfiguration
* @return string
*/
protected function renderPossibleRecordsSelectorTypeGroupDB(array $inlineConfiguration)
protected function renderPossibleRecordsSelectorTypeGroupDB(array $inlineConfiguration): string
{
$typo3Buttons = parent::renderPossibleRecordsSelectorTypeGroupDB($inlineConfiguration);

Expand Down Expand Up @@ -107,7 +103,7 @@ protected function getCloudinaryStorages(): array
$storageItems = $query
->select('*')
->from('sys_file_storage')
->where($query->expr()->eq('driver', $query->expr()->literal(CloudinaryFastDriver::DRIVER_TYPE)))
->where($query->expr()->eq('driver', $query->expr()->literal(CloudinaryDriver::DRIVER_TYPE)))
->execute()
->fetchAllAssociativeIndexed();

Expand Down
189 changes: 0 additions & 189 deletions Classes/Cache/CloudinaryTypo3Cache.php

This file was deleted.

61 changes: 8 additions & 53 deletions Classes/Command/AbstractCloudinaryCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,15 @@ abstract class AbstractCloudinaryCommand extends Command
const WARNING = 'warning';
const ERROR = 'error';

/**
* @var SymfonyStyle
*/
protected $io;
protected SymfonyStyle $io;

/**
* @var bool
*/
protected $isSilent = false;
protected bool $isSilent = false;

/**
* @var string
*/
protected $tableName = 'sys_file';
protected string $tableName = 'sys_file';

/**
* @param ResourceStorage $storage
* @param InputInterface $input
*
* @return array
*/
protected function getFiles(ResourceStorage $storage, InputInterface $input): array
{
$query = $this->getQueryBuilder();
$query = $this->getQueryBuilder($this->tableName);
$query
->select('*')
->from($this->tableName)
Expand Down Expand Up @@ -110,13 +95,9 @@ protected function getFiles(ResourceStorage $storage, InputInterface $input): ar
}
}

return $query->execute()->fetchAll();
return $query->execute()->fetchAllAssociative();
}

/**
* @param string $type
* @param array $files
*/
protected function writeLog(string $type, array $files)
{
$logFileName = sprintf(
Expand All @@ -141,22 +122,15 @@ protected function writeLog(string $type, array $files)
);
}

/**
* @param ResourceStorage $storage
*
* @return bool
*/
protected function checkDriverType(ResourceStorage $storage): bool
{
return $storage->getDriverType() === CloudinaryDriver::DRIVER_TYPE;
}

/**
* @param string $message
* @param array $arguments
* @param string $severity can be 'warning', 'error', 'success'
*/
protected function log(string $message = '', array $arguments = [], $severity = '')
protected function log(string $message = '', array $arguments = [], string $severity = '')
{
if (!$this->isSilent) {
$formattedMessage = vsprintf($message, $arguments);
Expand All @@ -168,47 +142,28 @@ protected function log(string $message = '', array $arguments = [], $severity =
}
}

/**
* @param string $message
* @param array $arguments
*/
protected function success(string $message = '', array $arguments = [])
{
$this->log($message, $arguments, self::SUCCESS);
}

/**
* @param string $message
* @param array $arguments
*/
protected function warning(string $message = '', array $arguments = [])
{
$this->log($message, $arguments, self::WARNING);
}

/**
* @param string $message
* @param array $arguments
*/
protected function error(string $message = '', array $arguments = [])
{
$this->log($message, $arguments, self::ERROR);
}


/**
* @return object|QueryBuilder
*/
protected function getQueryBuilder(): QueryBuilder
protected function getQueryBuilder(string $tableName): QueryBuilder
{
/** @var ConnectionPool $connectionPool */
$connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
return $connectionPool->getQueryBuilderForTable($this->tableName);
return $connectionPool->getQueryBuilderForTable($tableName);
}

/**
* @return object|Connection
*/
protected function getConnection(): Connection
{
/** @var ConnectionPool $connectionPool */
Expand Down
Loading