DBM Platform Hybrid Autoloader

The documentation is constantly evolving and updated alongside the project's progress. Since it is developed in parallel with the code, some sections may temporarily refer to earlier versions of the system-these are gradually adapted to the current state of the application. If you notice any outdated information, please report it or open an Issue / Pull Request.

Documentation

# DBM Platform Hybrid Autoloader

DBM Framework defines Composer PSR-4 metadata for the Dbm\ namespace. DBM Platform also has a custom hybrid loader in bootstrap/autoload.php, initialized by public/index.php. This is a platform deployment feature; framework applications using Composer alone do not need it.

# Loading order and mappings

The platform first requires vendor/autoload.php when it exists. It then registers a fallback loader for application namespaces, discovered/runtime bundles, and bundled local libraries. The fallback runs after Composer so Composer remains the primary resolver.

The custom mappings include:

  • App\ → src/
  • Mod\ → modules/
  • Dbm\ → libraries/designbymalina/dbmframework/src/
  • selected PSR and third-party namespaces → their bundled libraries/ source directories
  • package/module bundles → maps returned by libraries/*/bundle.php and storage/framework/bundles.php

This allows a platform installation to operate without Composer when all required dependencies are available in its bundled libraries, while still supporting Composer-based deployments. Optional packages still need to be installed or bundled; the loader cannot provide missing source files.

# Bootstrap sequence

public/index.php loads runtime setup, requires bootstrap/autoload.php, and calls autoloadingWithWithoutComposer($baseDirectory, $pathToVendorAutoload). It then loads bootstrap/support.php, initializes Paths, reads .env, and creates the application through bootstrap/app.php.

Applications should use this bootstrap entry point rather than registering duplicate namespace loaders manually. Keep bundle maps and Composer mappings consistent, and remember the local Dbm\ mapping is pinned to the framework source bundled in that platform checkout.