PHPackages                             ajgl/composer-symlinker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ajgl/composer-symlinker

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

ajgl/composer-symlinker
=======================

Composer script to symlink assets.

0.3.1(5y ago)961.6k↓45.9%4[1 issues](https://github.com/ajgarlag/AjglComposerSymlinker/issues)4MITPHP

Since Mar 4Pushed 4y ago1 watchersCompare

[ Source](https://github.com/ajgarlag/AjglComposerSymlinker)[ Packagist](https://packagist.org/packages/ajgl/composer-symlinker)[ Docs](https://github.com/ajgarlag/AjglComposerSymlinker)[ RSS](/packages/ajgl-composer-symlinker/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (10)Used By (4)

AjglComposerSymlinker
=====================

[](#ajglcomposersymlinker)

The AjglComposerSymlinker component provides a Composer plugin to symlink paths from packages installed with composer to a different location. It is intended for use with web assets.

[![Latest Stable Version](https://camo.githubusercontent.com/a4cccf901a8156376acad24498671f6516d2eb912770dbf5df18f50d01fd39f9/68747470733a2f2f706f7365722e707567782e6f72672f616a676c2f636f6d706f7365722d73796d6c696e6b65722f762f737461626c652e706e67)](https://packagist.org/packages/ajgl/composer-symlinker)[![Latest Unstable Version](https://camo.githubusercontent.com/be03e376eaa6a30ff91e060b1e894c48bbb8a8cd0b3e603e1c092ce88af9c9e6/68747470733a2f2f706f7365722e707567782e6f72672f616a676c2f636f6d706f7365722d73796d6c696e6b65722f762f756e737461626c652e706e67)](https://packagist.org/packages/ajgl/composer-symlinker)[![Total Downloads](https://camo.githubusercontent.com/2b1d71fa3fc6f822d70358357a223377ede053974e5af8fee6247031a3619cfd/68747470733a2f2f706f7365722e707567782e6f72672f616a676c2f636f6d706f7365722d73796d6c696e6b65722f646f776e6c6f6164732e706e67)](https://packagist.org/packages/ajgl/composer-symlinker)[![Montly Downloads](https://camo.githubusercontent.com/90d0c3e234b9e107d3c503e000bd49bcede06e15106afc1fbcd272572ffe4595/68747470733a2f2f706f7365722e707567782e6f72672f616a676c2f636f6d706f7365722d73796d6c696e6b65722f642f6d6f6e74686c792e706e67)](https://packagist.org/packages/ajgl/composer-symlinker)[![Daily Downloads](https://camo.githubusercontent.com/0a7ef03b813618c1736520c72ec44393875588bf95742d4d8462d1574d846680/68747470733a2f2f706f7365722e707567782e6f72672f616a676c2f636f6d706f7365722d73796d6c696e6b65722f642f6461696c792e706e67)](https://packagist.org/packages/ajgl/composer-symlinker)[![License](https://camo.githubusercontent.com/4bb617c67fb31458cd11337b2544171ad5f51437e544aac48e1e40c20aa535a8/68747470733a2f2f706f7365722e707567782e6f72672f616a676c2f636f6d706f7365722d73796d6c696e6b65722f6c6963656e73652e706e67)](https://packagist.org/packages/ajgl/composer-symlinker)

This plugin allows you to install web assets to the `vendor` directory and symlink them to a directory exposed through an HTTP server, without the need to provide a special composer package type with a custom installer.

Suppose the following project layout where we want to install the `twbs/bootstrap` package:

```
project/
├── src/
│   ├── Controller.php
│   ├── Model.php
│   └── View.php
├── vendor/
└── www/
    ├── assets/
    |   ├── css
    |   ├── fonts
    |   ├── images
    |   └── js
    ├── index.php
    └── .htaccess

```

Any web asset installed with composer will be stored inside the `vendor` directory, but we need them to be stored inside `www/assets` directory. In the Usage section, we will see how to achieve this.

There are some alternatives, but they usually require defining a custom package type in the required package definition.

Installation
------------

[](#installation)

To install the latest stable version of this component, open a console and execute the following command:

```
$ composer require ajgl/composer-symlinker

```

Usage
-----

[](#usage)

### 1. Require the source package

[](#1-require-the-source-package)

Add the desired package to the `require` section of the composer.json file:

```
{
    "require": {
        "twbs/bootstrap": "^3.3"
    }
}
```

### 2. Define symlinks

[](#2-define-symlinks)

Create the symlinks definition adding a `ajgl-symlinks` section inside the `extra` section of the composer.json file:

```
{
    "extra": {
        "ajgl-symlinks": {
            "twbs/boostrap": {
                "dist/css": "web/assets/css/bootstrap",
                "dist/js": "web/assets/js/bootstrap",
                "dist/fonts/glyphicons-halflings-regular.eot": "web/assets/fonts/glyphicons-halflings-regular.eot",
                "dist/fonts/glyphicons-halflings-regular.svg": "web/assets/fonts/glyphicons-halflings-regular.svg",
                "dist/fonts/glyphicons-halflings-regular.ttf": "web/assets/fonts/glyphicons-halflings-regular.ttf",
                "dist/fonts/glyphicons-halflings-regular.woff": "web/assets/fonts/glyphicons-halflings-regular.woff",
                "dist/fonts/glyphicons-halflings-regular.woff2": "web/assets/fonts/glyphicons-halflings-regular.woff2"
            }
        }
    }
}
```

As you can see, you can link directories or files. On **Windows** platform, the links will be created using the junction feature of NTFS, so you can only link directories.

### 3. Execute composer

[](#3-execute-composer)

Once the composer.json file is complete:

```
{
    "require": {
        "ajgl/composer-symlinker": "^0.3",
        "twbs/bootstrap": "^3.3"
    },
    "extra": {
        "ajgl-symlinks": {
            "twbs/bootstrap": {
                "dist/css": "web/assets/css/bootstrap",
                "dist/js": "web/assets/js/bootstrap",
                "dist/fonts/glyphicons-halflings-regular.eot": "web/assets/fonts/glyphicons-halflings-regular.eot",
                "dist/fonts/glyphicons-halflings-regular.svg": "web/assets/fonts/glyphicons-halflings-regular.svg",
                "dist/fonts/glyphicons-halflings-regular.ttf": "web/assets/fonts/glyphicons-halflings-regular.ttf",
                "dist/fonts/glyphicons-halflings-regular.woff": "web/assets/fonts/glyphicons-halflings-regular.woff",
                "dist/fonts/glyphicons-halflings-regular.woff2": "web/assets/fonts/glyphicons-halflings-regular.woff2"
            }
        }
    }
}
```

Open a console and execute the `composer update` or `composer install` command:

```
$ composer update -v

```

You will see the following messages in the composer output:

```
Creating symlinks
 Symlinking package "twbs/bootstrap"
  Symlinking "/home/aj/tmp/lala/vendor/twbs/bootstrap/dist/css" to "/home/aj/tmp/lala/web/assets/css/bootstrap": symlink created
  Symlinking "/home/aj/tmp/lala/vendor/twbs/bootstrap/dist/js" to "/home/aj/tmp/lala/web/assets/js/bootstrap": symlink created
  Symlinking "/home/aj/tmp/lala/vendor/twbs/bootstrap/dist/fonts/glyphicons-halflings-regular.eot" to "/home/aj/tmp/lala/web/assets/fonts/glyphicons-halflings-regular.eot": symlink created
  Symlinking "/home/aj/tmp/lala/vendor/twbs/bootstrap/dist/fonts/glyphicons-halflings-regular.svg" to "/home/aj/tmp/lala/web/assets/fonts/glyphicons-halflings-regular.svg": symlink created
  Symlinking "/home/aj/tmp/lala/vendor/twbs/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf" to "/home/aj/tmp/lala/web/assets/fonts/glyphicons-halflings-regular.ttf": symlink created
  Symlinking "/home/aj/tmp/lala/vendor/twbs/bootstrap/dist/fonts/glyphicons-halflings-regular.woff" to "/home/aj/tmp/lala/web/assets/fonts/glyphicons-halflings-regular.woff": symlink created
  Symlinking "/home/aj/tmp/lala/vendor/twbs/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2" to "/home/aj/tmp/lala/web/assets/fonts/glyphicons-halflings-regular.woff2": symlink created

```

### 4. Packages not available at packagist.org

[](#4-packages-not-available-at-packagistorg)

If you want to install a package that is not available in the main composer repository, you can define a new package inside the `repositories` section of the composer.json file.

```
{
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "dojo/dojo",
                "version": "1.11.1",
                "dist": {
                    "type": "zip",
                    "url": "http://download.dojotoolkit.org/release-1.11.1/dojo-release-1.11.1.zip"
                },
                "type": "library"
            }
        }
    ]
}
```

Then, you can define the desired symlinks in the `ajgl-symlinks` section as usual:

```
{
    "extra": {
        "ajgl-symlinks": {
            "dojo/dojo": {
                ".": "www/dojo"
            }
        }
    }
}
```

License
-------

[](#license)

This component is under the MIT license. See the complete license in the [LICENSE](LICENSE) file.

Reporting an issue or a feature request
---------------------------------------

[](#reporting-an-issue-or-a-feature-request)

Issues and feature requests are tracked in the [Github issue tracker](https://github.com/ajgarlag/AjglComposerSymlinker/issues).

Author Information
------------------

[](#author-information)

Developed with ♥ by [Antonio J. García Lagar](http://aj.garcialagar.es).

If you find this component useful, please add a ★ in the [GitHub repository page](https://github.com/ajgarlag/AjglComposerSymlinker) and/or the [Packagist package page](https://packagist.org/packages/ajgl/composer-symlinker).

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~373 days

Recently: every ~0 days

Total

9

Last Release

1837d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f895b5880bdb002b96abac69a1a6630b4e20c4fbff9dbe3d47b08f0d1b7e2211?d=identicon)[ajgarlag](/maintainers/ajgarlag)

---

Top Contributors

[![ajgarlag](https://avatars.githubusercontent.com/u/388184?v=4)](https://github.com/ajgarlag "ajgarlag (33 commits)")[![darkelfe14728](https://avatars.githubusercontent.com/u/509102?v=4)](https://github.com/darkelfe14728 "darkelfe14728 (1 commits)")[![InfopactMLoos](https://avatars.githubusercontent.com/u/22300844?v=4)](https://github.com/InfopactMLoos "InfopactMLoos (1 commits)")

---

Tags

composerassets

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/ajgl-composer-symlinker/health.svg)

```
[![Health](https://phpackages.com/badges/ajgl-composer-symlinker/health.svg)](https://phpackages.com/packages/ajgl-composer-symlinker)
```

###  Alternatives

[ergebnis/composer-normalize

Provides a composer plugin for normalizing composer.json.

1.1k37.3M2.1k](/packages/ergebnis-composer-normalize)[bamarni/composer-bin-plugin

No conflicts for your bin dependencies

52722.0M859](/packages/bamarni-composer-bin-plugin)[pyrech/composer-changelogs

Display changelogs after each composer update

5904.0M25](/packages/pyrech-composer-changelogs)[helhum/dotenv-connector

Makes it possible to set environment variables for composer projects.

1594.6M34](/packages/helhum-dotenv-connector)[mnsami/composer-custom-directory-installer

A composer plugin, to help install packages of different types in custom paths.

1395.0M52](/packages/mnsami-composer-custom-directory-installer)[funkjedi/composer-include-files

Include files at a higher priority than autoload files.

1263.2M19](/packages/funkjedi-composer-include-files)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
