Download the PHP package robloach/component-installer without Composer
On this page you can find all versions of the php package robloach/component-installer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download robloach/component-installer
More information about robloach/component-installer
Files in robloach/component-installer
Package component-installer
Short Description Allows installation of Components via Composer.
License MIT
Informations about the package component-installer
DEPRECATED
Component Installer has been deprecated. Use one of the following projects instead:
- Composer Installers Extender
- Asset Packagist
- Composer Asset Plugin
- Laravel Mix (Example: eventum/eventum#801 and eventum/eventum#812)
Example
Component Installer for Composer
Allows installation of Components via Composer.
Install
Usage
To install a Component with Composer, add the Component to your composer.json
require
key. The following will install jQuery and
normalize.css:
Using the Component
The easiest approach is to use the Component statically. Just reference the
Components manually using a script
or link
tag:
For complex projects, a RequireJS configuration is available, which allows autoloading scripts only when needed. A require.css file is also compiled, including all Component stylesheets:
Configuration
There are a number of ways to alter how Components are installed and used.
Installation Directory
It is possible to switch where Components are installed by changing the
component-dir
option in your root composer.json's config
. The following
will install jQuery to public/jquery rather than components/jquery:
Defaults to components
.
Base URL
While component-dir
depicts where the Components will be installed,
component-baseurl
tells RequireJS the base path that will use when attempting
to load the scripts in the web browser. It is important to make sure the
component-baseurl
points to the component-dir
when loaded externally. See
more about baseUrl
in the
RequireJS documentation.
Defaults to components
.
Assetic filters
Creating a Component
To set up a Component to be installed with Component Installer, have it
require
the package robloach/component-installer and set the type
to
component, but it is not necessary:
scripts
- List of all the JavaScript files that will be concatenated together and processed when loading the Component.styles
- List of all the CSS files that should be concatenated together into the final require.css file.files
- Any additional file assets that should be copied into the Component directory.
Component Name
Components can provide their own Component name. The following will install jQuery to components/myownjquery rather than components/jquery:
Defaults to the package name, without the vendor.
RequireJS Configuration
Components can alter how RequireJS registers and interacts with them by changing some of the configuration options:
Current available RequireJS options for individual packages include:
Packages Without Composer Support
Using repositories
in composer.json allows use of Component Installer in packages that don't
explicitly provide their own composer.json. In the following example, we
define use of html5shiv:
Packages Without Component Support In composer.json
Using extra
in composer.json allows use of Component Installer in packages that don't
explicitly provide support for component, but do ship with their own composer.json.
Using extra
with packages that ship with Component Installer, will override component's settings for that package.
Not Invented Here
There are many other amazing projects from which Component Installer was inspired. It is encouraged to take a look at some of the other great package management systems:
License
Component Installer is licensed under the MIT License - see LICENSE.md for details.