If you need to track a package with Composer but it doesn't exist in a repository, you can still manage it with Composer. Simply create a custom repository of type 'package', add it to your required packages, and proceed as normal.
- Open your
composer.json
and add a a block to the 'repositories' array like the following.
{
"repositories": [
{
"type": "package",
"package": {
"name": "magic-fields-team/magic-fields-2",
"version": "2.3.3.1",
"dist": {
"url": "https://github.com/magic-fields-team/Magic-Fields-2/archive/2.3.3.1.zip",
"type": "zip"
},
"source": {
"url": "https://github.com/magic-fields-team/Magic-Fields-2.git",
"type": "git",
"reference": "2.3.3.1"
}
}
}
]
}
- Add the new repository to your 'require' section.
{
"require": {
"magic-fields-team/magic-fields-2": "2.3.3.1"
}
}
- Install as normal with Composer.
$ composer update
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 4 updates, 0 removals
- Locking magic-fields-team/magic-fields-2 (2.3.3.1)
- Upgrading roave/security-advisories (dev-master d596191 => dev-master a2c04f8)
- Upgrading symfony/polyfill-ctype (v1.18.1 => v1.22.0)
- Upgrading symfony/polyfill-mbstring (v1.20.0 => v1.22.0)
- Upgrading symfony/polyfill-php80 (v1.20.0 => v1.22.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 4 updates, 0 removals
- Downloading magic-fields-team/magic-fields-2 (2.3.3.1)
- Downloading symfony/polyfill-php80 (v1.22.0)
- Downloading symfony/polyfill-mbstring (v1.22.0)
- Downloading symfony/polyfill-ctype (v1.22.0)
- Installing magic-fields-team/magic-fields-2 (2.3.3.1): Extracting archive
- Upgrading roave/security-advisories (dev-master d596191 => dev-master a2c04f8)
- Upgrading symfony/polyfill-php80 (v1.20.0 => v1.22.0): Extracting archive
- Upgrading symfony/polyfill-mbstring (v1.20.0 => v1.22.0): Extracting archive
- Upgrading symfony/polyfill-ctype (v1.18.1 => v1.22.0): Extracting archive
Generating optimized autoload files
11 packages you are using are looking for funding.
Use the `composer fund` command to find out more!