lastcall/composer-extra-files

Composer plugin for requiring additional files from composer packages.

Installs: 9 893

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 8

Open Issues: 2

Type:composer-plugin

1.0.1 2017-10-01 20:30 UTC

This package is not auto-updated.

Last update: 2024-12-28 02:57:49 UTC


README

Composer Extra Files Plugin is brought to you by your friends at Last Call Media, this composer plugin allows you to request additional files to be downloaded with your composer package.

When should I use this?

The most common use case is if you have compiled front-end code, where the compiled version is never committed to a git repository, and therefore isn't registered on packagist.org. For example, if you want your distributed package to depend on an NPM/Bower package.

Note: You probably shouldn't use this if you have the ability to add repositories to your project's root composer.json. There are better alternatives for this. See Composer Asset Plugin and Asset Packagist. This plugin is most useful for packages that are required by other packages, since Composer doesn't allow nested repositories.

Usage

In your package's composer.json, require this plugin, and specify the extra files in the "extra" section:

{
  ... 
  "require": {
    "lastcall/composer-extra-files": "~1.0"
  }
  "extra": {
    "extra-files": {
      "ui": {
        "url": "https://registry.npmjs.org/lastcall-mannequin-ui/-/lastcall-mannequin-ui-1.0.0-rc2.tgz",
        "path": "ui"
      }
    }
  }
  ...
}

The ui identifier here is an arbitrary ID for each dependency.

The url key specifies the URL to fetch the content from. If it points to a tarball or zip file, it will be unpacked on downloading.

The path key specifies the folder (relative to where your package is installed in /vendor) that the content is installed into.