A PHP CLI application that automatically organizes your photos and videos by moving them into date-based directories. Files are organized by their creation date in YYYY/MM/DD format.
- Automatic Organization: Moves photos and videos into directories organized by creation date
- Metadata Extraction: Uses EXIF data, filename patterns, and file timestamps to determine creation date
- Multiple Format Support: Supports images (JPG, JPEG, GIF, PNG) and videos (MP4, MOV, 3GP, AVI)
- Batch Processing: Optional limit to process only N files per run
- Docker Support: Run in Docker for consistent environments
- PHP 8.4 or higher
- Composer
- Docker (optional, for containerized execution)
# Clone the repository
git clone <repository-url>
cd photos-mover
# Build Docker image
make up
# Install dependencies
make installMove files from a source directory to a destination organized by date:
php photos-mover.php /path/to/photos /path/to/organizedImages: JPG, JPEG, GIF, PNG Videos: MP4, MOV, 3GP
- Discover Files: Scans the source directory for supported image and video files
- Extract Metadata: Determines the creation date using:
- EXIF data (for images with EXIF metadata)
- Filename pattern
YYYY-MM-DD_*(for videos) - File creation/modification timestamps (fallback)
- Generate Paths: Creates destination paths in
destination/YYYY/MM/DD/filenameformat - Move Files: Moves files to their destination, creating directories as needed
# Run unit tests
make test-unit
# Run integration tests
make test-integration# Auto format and refactor code
make format
# Run code quality analysis
make qualityAccess an interactive shell in the container:
make shellRemove all containers, images, and vendor files:
make cleanThe application follows clean architecture principles:
- Application Layer: Orchestrates the file-moving workflow
- Domain Layer: Core business logic (Finder, PathGenerator, Mover, MetadataReaders)
- Infrastructure Layer: External integrations (Logger, Metadata readers)