viv dump-autoload

Run this after you've added classes or changed autoload rules, without needing to reinstall any package: it regenerates the autoload files and vendor/bin from what's already installed, fetching nothing.

Usage

Regenerate the autoload files and `vendor/bin` from an already installed `vendor/`, without fetching or linking

Usage: viv dump-autoload [OPTIONS]

Options:
      --no-dev
          Skip `require-dev` packages
  -v, --verbose
          Raise logging to debug
      --cache-dir <CACHE_DIR>
          Store location (default `$XDG_CACHE_HOME/vivace`, or `~/.cache/vivace`)
  -d, --project-dir <PROJECT_DIR>
          Project directory holding `composer.json`/`composer.lock` [default: .]
  -o, --optimize-autoloader
          Also classmap-scan PSR-0/PSR-4 directories (`config.optimize-autoloader`)
      --offline
          Fail fast on any request instead of connecting: install errors, naming every package not already in the store; update solves from cached repository metadata only, erroring on an uncached package. Also set by `COMPOSER_DISABLE_NETWORK` (any value but unset, empty or `0`; Composer's own git-priming `prime` value is not special-cased here, since neither `install` nor `update` touch a git source)
  -a, --classmap-authoritative
          Classmap-only autoloading, no PSR-0/PSR-4 fallback at runtime (`config.classmap-authoritative`); implies `-o`
      --apcu-autoloader
          Cache classmap lookups in `APCu` (`config.apcu-autoloader`)
      --apcu-autoloader-prefix <PREFIX>
          Fixed `APCu` cache-key prefix, instead of one generated per run (`config.apcu-autoloader-prefix`); implies `--apcu-autoloader`
      --ignore-platform-reqs
          Skip every platform (`php`/`ext-*`) requirement check, same as Composer's flag of the same name; wins over `--ignore-platform-req` below when both are given (`PlatformRequirementFilterFactory::fromBoolOrList`)
      --ignore-platform-req <REQ>
          Skip one named platform requirement (`*` glob, repeatable)
      --no-scripts
          Skip `pre-autoload-dump`/`post-autoload-dump` and every other root `scripts` listener
      --no-plugins
          Regenerate every package's autoload entry at its plain `vendor/` location: the native installer adapters are disabled, same as `install --no-plugins` (`docs/plugin-strategy.md`)
  -n, --no-interaction
          Accepted for compatibility (#211): global to every Composer command, but `dump-autoload` never prompts either way, so this is already true and only logged. `--prefer-dist`/`--no-suggest` aren't accepted here (`install`-only in Composer): `dump-autoload` fetches nothing
  -h, --help
          Print help

Reads and writes

  • Reads: composer.json, composer.lock and the installed packages already in vendor/.
  • Writes: vendor/autoload.php, vendor/composer/*, vendor/bin/.

The command does not need a composer.lock. Without one, like Composer, it takes the package list from vendor/composer/installed.json, or an empty list when vendor/ does not exist yet, so the autoloader covers only your own autoload rules. In that case it leaves installed.json and installed.php as they are.

Dev packages

Without --no-dev, the command uses the mode of the last install, like Composer: the dev value in vendor/composer/installed.json. A vendor installed with viv install --no-dev dumps without dev packages and autoload-dev rules, and so does a vendor with no installed.json.

Exit codes

  • 0 — regenerated cleanly.
  • 1 — a filesystem error (a package missing from vendor/, an unreadable file), or a bad flag.

See also

viv install