MediaCommandController
class MediaCommandController extends CommandController (View source)
Properties
protected PersistenceManagerInterface | $persistenceManager | ||
protected EntityManagerInterface | $entityManager | ||
protected Connection | $dbalConnection | ||
protected AssetRepository | $assetRepository | ||
protected ThumbnailRepository | $thumbnailRepository | ||
protected ImageVariantRepository | $imageVariantRepository | ||
protected AssetService | $assetService | ||
protected ThumbnailService | $thumbnailService | ||
protected bool | $asyncThumbnails | ||
protected AssetModelMappingStrategyInterface | $mappingStrategy | ||
protected ReflectionService | $reflectionService | ||
protected AssetVariantGenerator | $assetVariantGenerator |
Methods
Import resources to asset management
Remove unused assets
Create thumbnails
Remove thumbnails
Render ungenerated thumbnails
List all configurations for your imageVariants.
Cleanup imageVariants with provided identifier and variant name.
Render asset variants
Used as a callback when iterating large results sets
Initializes the DBAL connection which is currently bound to the Doctrine Entity Manager
Details
void
importResourcesCommand(bool $simulate = false, bool $quiet = false)
Import resources to asset management
This command detects Flow "PersistentResource"s which are not yet available as "Asset" objects and thus don't appear in the asset management. The type of the imported asset is determined by the file extension provided by the PersistentResource.
void
removeUnusedCommand(string $assetSource = '', bool $quiet = false, bool $assumeYes = false, string $onlyTags = '', int $limit = null, string $onlyCollections = '')
Remove unused assets
This command iterates over all existing assets, checks their usage count and lists the assets which are not reported as used by any AssetUsageStrategies. The unused assets can than be removed.
void
createThumbnailsCommand(string $preset = null, bool $async = null, bool $quiet = false)
Create thumbnails
Creates thumbnail images based on the configured thumbnail presets. Optional preset
parameter to only create
thumbnails for a specific thumbnail preset configuration.
Additionally, accepts a async
parameter determining if the created thumbnails are generated when created.
void
clearThumbnailsCommand(string $preset = null, bool $quiet = false)
Remove thumbnails
Removes all thumbnail objects and their resources. Optional preset
parameter to only remove thumbnails
matching a specific thumbnail preset configuration.
void
renderThumbnailsCommand(int $limit = null, bool $quiet = false)
Render ungenerated thumbnails
Loops over ungenerated thumbnails and renders them. Optional limit
parameter to limit the amount of
thumbnails to be rendered to avoid memory exhaustion.
void
listVariantPresetsCommand()
List all configurations for your imageVariants.
Doesn't matter if configured under 'Neos.Media.variantPresets' or already deleted from this configuration. This command will find every single one for you.
removeVariantsCommand(string $identifier, string $variantName, bool $quiet = false, bool $assumeYes = false, int $limit = null)
Cleanup imageVariants with provided identifier and variant name.
Image variants that are still configured are removed without usage check and
can be regenerated afterwards with media:renderVariants
.
This command will not remove any custom cropped image variants.
void
renderVariantsCommand(int $limit = null, bool $quiet = false, bool $recreate = false)
Render asset variants
Loops over missing configured asset variants and renders them. Optional limit
parameter to
limit the amount of variants to be rendered to avoid memory exhaustion.
If the re-render parameter is given, any existing variants will be rendered again, too.
protected void
persistAll(int $iteration)
Used as a callback when iterating large results sets
protected void
initializeConnection()
Initializes the DBAL connection which is currently bound to the Doctrine Entity Manager