Skip to content

v1.0.3 - Namespace Update

Choose a tag to compare

@onamfc onamfc released this 04 Aug 18:16
· 11 commits to main since this release

This update addresses a critical issue where the package's classes were not being correctly loaded due to a mismatch between the declared namespaces within the PHP files and the psr-4 autoloading configuration in composer.json.

Problem Identified:

The composer.json file defined the base namespace as LaravelDbArchiver\ mapping to the src/ directory. However, many of the package's PHP files incorrectly used onamfc\LaravelDbArchiver as their root namespace. This discrepancy prevented Composer's autoloader from locating the classes, leading to "Class not found" errors upon installation in new projects.

Solution Implemented:

All PHP files within the src/ and tests/ directories have been updated to consistently use LaravelDbArchiver as their root namespace, aligning with the composer.json configuration.

Affected Files (Namespace Changed from onamfc\LaravelDbArchiver to LaravelDbArchiver):

  • src/Providers/DbArchiverServiceProvider.php
  • src/Models/ArchiveLog.php
  • src/Services/ArchiveService.php
  • src/Services/StorageManager.php
  • src/Formatters/JsonFormatter.php
  • src/Formatters/ParquetFormatter.php
  • src/Adapters/S3StorageAdapter.php
  • src/Adapters/LocalStorageAdapter.php
  • src/Commands/ArchiveAllCommand.php
  • src/Commands/ArchiveTableCommand.php
  • src/Commands/ArchiveStatusCommand.php
  • src/Exceptions/ArchiveException.php
  • src/Exceptions/StorageException.php
  • tests/Unit/ArchiveServiceTest.php
  • tests/Feature/ArchiveCommandTest.php

Action Required After Update:

After applying these changes (or updating the package), it is crucial to run composer dump-autoload in your project's root directory. This command regenerates Composer's autoloader files, ensuring that the corrected namespaces are properly recognized and the classes can be loaded.