Download the PHP package jdz/mediamanager without Composer
On this page you can find all versions of the php package jdz/mediamanager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jdz/mediamanager
More information about jdz/mediamanager
Files in jdz/mediamanager
Package mediamanager
Short Description Framework-agnostic media library management: browse, reshape and fill a media folder, with upload validation, watermarking and picker trees
License MIT
Homepage https://jdz.joffreydemetz.com/mediamanager
Informations about the package mediamanager
JDZ MediaManager
Framework-agnostic media library management: browse, reshape and fill a media folder — plus upload validation, watermarking and folder trees for pickers.
Installation
MediaManager
JDZ\MediaManager\Manager\MediaManager is the whole API. Point it at a folder and it owns everything under it.
Browsing
Thumbnails are not this package's business. getFilesystem() and getSelectorList() take optional resolvers so the consumer plugs in its own image pipeline:
Reshaping
Every mutation returns an OperationResult.
Uploading
Validates mime and weight against the config, slugs the name (camelCase split, transliterated, lowercased, dash-separated), resolves collisions with -1, -2, -3 unless $force, then downscales oversized pictures in place (GD via Imagine, EXIF autorotate). A failed resize never fails the upload.
Library quotas are enforced up front — $manager->getStats() exposes the counters and the verdict:
Watermarking
Backups live flat under protectPath, filed under the file's own name — two files sharing a basename in different folders share one backup slot.
Paths and safety
Folder paths travel through the browser with their slashes swapped for [-]. decodePath() / encodePath() handle the codec; run every inbound folder value through decodePath().
Every path is canonicalized and checked to be inside the root before anything touches the disk — .. segments, absolute paths and directory parts in file names are refused with MEDIAMANAGER_ERROR_INVALID_PATH. Paths stay forward-slashed on every platform.
Translation keys
The package never renders a message. It returns keys, which the consumer translates:
| Success | MEDIAMANAGER_SUCCESS_DIRCREATE, _DIRRENAME, _DIRMOVE, _DIRDELETE, _FILRENAME, _FILMOVE, _FILDELETE (%filename%), _PROTECT, _UNPROTECT |
| Folders | MEDIAMANAGER_ERROR_ROOT_CANNOT_BE_CHANGED, _ROOT_FOLDERS_CANNOT_BE_CHANGED, _ENTER_FOLDER_NAME, _ENTER_FOLDER_NEW_NAME, _FOLDER_NAME_UNCHANGED, _FOLDER_NOT_EMPTY, _SOURCE_FOLDER_INVALID, _SOURCE_FOLDER_NOT_FOUND, _DESTINATION_FOLDER_NOT_FOUND, _DESTINATION_FOLDER_ALREADY_EXISTS, _CANNOT_MOVE_INTO_ITSELF |
| Files | MEDIAMANAGER_ERROR_NO_FILE_SPECIFIED, _ENTER_FILE_NEW_NAME, _FILE_NAME_UNCHANGED, _SOURCE_FILE_NOT_FOUND, _DESTINATION_FILE_ALREADY_EXISTS, _SAME_FILEPATH, _NOT_AN_IMAGE, _PROTECT_ORIGINAL_NOT_FOUND |
| Uploads | MEDIAMANAGER_ERROR_UPLOAD_FILE_TOO_BIG (%maxFileSize%), _UPLOAD_FILE_UNAUTH_EXT (%authExts%), _UPLOAD_TOO_MANY_FILES (%maxFileCount%), _UPLOAD_FILESYSTEM_FULL (%maxWeightFiles%) |
| Generic | MEDIAMANAGER_ERROR_INVALID_PATH, MEDIAMANAGER_ERROR_OPERATION_FAILED (%error%) |
Trees
ImageTree builds a nested folders/files structure; DocumentTree builds a flat list with per-type icons. Both skip entries whose basename starts with _, and accept ignore lists. Reachable directly, or through getRedactorImageTree() / getRedactorDocumentTree().
Upgrading from 1.x
JDZ\MediaManager\Upload is gone — its work is done by MediaManager::upload(), which takes an explicit target folder, enforces library quotas and returns an UploadResult instead of throwing. Tree/ is unchanged.
Tests
License
MIT — see LICENSE.
All versions of mediamanager with dependencies
imagine/imagine Version ^1.3
symfony/filesystem Version ^7.4
symfony/finder Version ^7.4
symfony/string Version ^7.4
symfony/http-foundation Version ^7.4