A module can use Composer without changing the OpenCart core. Pick a namespace for your own code and a controlled location for the module's autoloader. Decide whether dependencies are shared by the installation or bundled with an independently deployed extension. Two bundled versions of the same public package can still collide, even when the extension's own classes have unique namespaces.
Practical check. Use a clean CI workspace and test deployment with production dependencies only. Rehearse restoring the previous bundle on staging.
Define the dependency boundary
composer.json defines the allowed dependency versions, while composer.lock records the resolved set used by the build. Run updates in a reviewed development workflow and inspect the lock-file diff. For an independently deployed application or module artifact, install from its lock file. A library's lock file does not control how a consuming project's dependencies are resolved.
| Check | What it shows | Where to verify |
|---|---|---|
composer update | Resolve and review changes | Development or CI update workflow |
composer install | Install the locked versions | Clean build runner |
check-platform-reqs | Check actual CLI PHP requirements | Matching PHP environment |
| Module smoke test | Verify autoloading in the normal entry point | Staging |
Build and test the release
On the build runner use composer install --no-dev --prefer-dist --optimize-autoloader. Review plugins and scripts before granting them access to the build environment. Use composer check-platform-reqs --no-dev to check the Composer runtime, then verify the storefront's PHP-FPM version and extensions independently. Keep the module and its verified dependencies in one release artifact when the target host does not run Composer.
Exercise the module through the same entry points that will load the dependency in production. Include the admin route, a storefront route and any scheduled job that uses it. A smoke test should instantiate a class and perform a small representative operation. Keep the previous module and dependency bundle together so a rollback does not mix files from different releases.
Frequently asked questions
What belongs in version control?
Keep the manifest and the lock file for reproducible application builds. Include the assembled vendor directory in the deployment artifact if production will not run Composer.
Where should autoload.php be required?
Load it once at a defined module entry point using a reliably resolved path.
Can Composer verify PHP-FPM directly?
Its platform check uses the PHP executable that runs Composer. Verify the FPM pool separately.







