PHPackages                             aydin-hassan/magento-core-composer-installer - 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. aydin-hassan/magento-core-composer-installer

ActiveComposer-plugin

aydin-hassan/magento-core-composer-installer
============================================

A composer plugin for managing Magento Core

2.1.0(5y ago)94609.2k↓12.8%39[1 PRs](https://github.com/AydinHassan/magento-core-composer-installer/pulls)2MITPHPPHP ^8.0CI passing

Since Dec 9Pushed 3mo ago9 watchersCompare

[ Source](https://github.com/AydinHassan/magento-core-composer-installer)[ Packagist](https://packagist.org/packages/aydin-hassan/magento-core-composer-installer)[ RSS](/packages/aydin-hassan-magento-core-composer-installer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (5)Versions (14)Used By (2)

magento-core-composer-installer
===============================

[](#magento-core-composer-installer)

[![Build Status](https://github.com/AydinHassan/magento-core-composer-installer/workflows/MagentoCoreComposerInstaller/badge.svg)](https://github.com/AydinHassan/magento-core-composer-installer/actions?query=workflow%3AMagentoCoreComposerInstaller)[![Build Status](https://camo.githubusercontent.com/8f553d5ce66e2cdd049887694a6d1f3a44c8a164ca1282dc1353e9bffd85ce71/68747470733a2f2f7472617669732d63692e6f72672f417964696e48617373616e2f6d6167656e746f2d636f72652d636f6d706f7365722d696e7374616c6c65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/AydinHassan/magento-core-composer-installer)[![Latest Stable Version](https://camo.githubusercontent.com/20d84a67a9e65f5776bbb98f1af5f1c12efb0b6341b91bdfd99354117e6340cb/68747470733a2f2f706f7365722e707567782e6f72672f617964696e2d68617373616e2f6d6167656e746f2d636f72652d636f6d706f7365722d696e7374616c6c65722f762f737461626c652e737667)](https://packagist.org/packages/aydin-hassan/magento-core-composer-installer)[![Latest Unstable Version](https://camo.githubusercontent.com/bcb701db1c3f5ed2ee64e62f5cd3f609582f6c0e2ddf5ab5cfa1eaad5c3c35f6/68747470733a2f2f706f7365722e707567782e6f72672f617964696e2d68617373616e2f6d6167656e746f2d636f72652d636f6d706f7365722d696e7374616c6c65722f762f756e737461626c652e737667)](https://packagist.org/packages/aydin-hassan/magento-core-composer-installer)

A Composer Plugin to manage Magento Core

This tool allows you to manage Magento Core in your project using Composer.

Advantages:

- Keep Magento out of your project repository
- Allows for easy upgrades to new Magento versions

You require this tool in your project and require a specific version of Magento. An initial install of a Magento package will trigger an install to your Magento root directory. A `.gitignore` file will be automatically created with all of the files in the Magento core package (Some are grouped, more on this later).

When a package is removed, either using `composer remove magento/magento` or manually removing from your `composer.json` file and running `composer update` all of the files present in the version of Magento you are removing will be deleted from your `magento-root-dir` folder. If there are custom files in any of these folders, these will not be deleted.

This allows you to install and remove the Magento core in to your project without having to commit it as the `.gitignore`is automatically updated. Further to this, in your project root you could ignore the `.gitignore` in the `magento-root-dir`This would mean that you can install, update &amp; remove Magento core without any untracked files showing in your repository.

Now updating Magento Core is easy, simply change your require to `"magento/magento": 1.10.0` or whatever the newest version is and run `composer update`!

Compatibility
-------------

[](#compatibility)

This tool works with any version of PHP &gt;= 7.0. It is automatically tested using Travis on version PHP versions 7.0, 7.1, 7.2, 7.3, 7.4.

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

[](#installation)

```
$ cd magento-project
$ composer require aydin-hassan/magento-core-composer-installer

```

The latest stable version will be installed.

In order for the installer to actually do anything, you will also need to require a core Magento package. This should be a Magento release with a `composer.json` file in the root. It should be defined like so:

```
{
    "name": "magento/magento",
    "description": "Magento Mirror",
    "type": "magento-core"
}

```

See [here](https://github.com/AydinHassan/magento-community/blob/1.9/composer.json) for an example. You can use this repository for your Magento CE builds if you wish so.

You can create your own public or private Magento repository to host the different versions. You should tag each version as the version it is. The `type` key is important. The Magento Core Composer Installer will only install packages which have a type of `magento-core`.

Read [here](#creating-a-core-package) to see how you can create your own Magento Source Code Repository.

To use the Magento package you will have to add the repository to your projects `composer.json` file:

```
"repositories": [
    {
        "type": "vcs",
        "url": "git@github.com:AydinHassan/magento-community.git"
    }
],

```

Then you can do:

```
$ composer require "magento/magento:1.9.1.0"

```

Overall your projects `composer.json` should look something like:

```
{
    "name": "somevendor/someproject",
    "description": "Magento build for ...",
    "require-dev": {
        "phpunit/phpunit": "~4.4"
    },
    "require": {
        "aydin-hassan/magento-core-composer-installer" : "^2.0",
        "magento/magento" : "1.9.1.0"
    },
    "authors": [
        {
            "name": "Aydin Hassan",
            "email": "aydin@hotmail.co.uk"
        }
    ],
    "repositories": [
        {
            "type": "vcs",
            "url": "git@github.com:AydinHassan/magento-community.git"
        }
    ],
    "extra": {
        "magento-root-dir": "htdocs"
    }
}

```

Also note the `magento-root-dir`, this is used to specify where you want Magento to be installed to.

Configuration
-------------

[](#configuration)

Configuration can be provided under the `magento-core-deploy` under the `extra` key in your root `composer.json` file

Available configuration

- `excludes` - An array of files to not copy when installing the core, useful if local overrides are necessary, or you want to track a `.htaccess`.
- `ignore-directories` - An array of folders to group ignores together to make the core `.gitignore` smaller.
- `git-ignore-append` - Defaults to `true`. Whether to append to the `.gitignore` in the `magento-root-dir` folder. If false it will be wiped out on each deploy.
- `git-ignore-enable` - Defaults to `true`. Setting this to `false` will prevent any actions being taken on the `.gitignore` file in the `magento-root-dir` folder.

Example configuration:

```
{
     ...
     "extra" {
         "magento-root-dir": "htdocs",
         "magento-core-deploy" : {
            "excludes": [
                ".htaccess"
            ],
            "ignore-directories": [
                "lib/Zend"
            ],
            "git-ignore-append": false
         }
     }
}

```

The above config will, install everything from the core package, except the file `.htaccess`, it will group all files under `lib\Zend` in the `htdocs\.gitignore` file. And it will wipe the `htdocs\.gitignore` every time Magento is updated or removed.

### Excludes

[](#excludes)

Use this to exclude certain files and folders from being copied from the core in to your root directory. If the exclude path you include is actually a folder, everything within that folder will be excluded.

Exclude all files within `lib`

```
{
     ...
     "extra" {
         "magento-root-dir": "htdocs",
         "magento-core-deploy" : {
            "excludes": [
                "lib"
            ]
         }
     }
}

```

Exclude just `app/etc/local.xml`

```
{
     ...
     "extra" {
         "magento-root-dir": "htdocs",
         "magento-core-deploy" : {
            "excludes": [
                "app/etc/local.xml"
            ]
         }
     }
}

```

### Ignore Directories

[](#ignore-directories)

This one requires a little more explanation. Generating a `.gitignore` for every file in Magento results in a file well over 10,000 lines. On investigation this seems to slow git commands like `git status` down quite a bit. Some issues were taking up to 14 seconds for me.

In order to combat this, any files which are in a default set of folders, will not be added to the `.gitignore`, instead only the folder will, this greatly reduces the size of the `.gitignore`. The list of folders which are ignored by default can be found [here](https://github.com/AydinHassan/magento-core-composer-installer/blob/master/src/Options.php#L24)

If you need to commit files inside these directories then you can override this list by setting the `ignore-directories`key, noted above. Your list will not be merged, it will be used instead. This is in case you want to remove one of the ignore directories.

Creating a core package
-----------------------

[](#creating-a-core-package)

I have provided a script which allows you to easily manage a mirror of Magento. It will work for both Community and Enterprise. The below instructions explain how to create a core package.

Add new Magento version script:

1. Create a repository or clone an existing one: `cd && mkdir magento-mirror && git init`
2. Download a version of Magento and extract it: `cd && tar -xzf magento.tar.gz`
3. Download this script to your home directory: `cd && curl https://gist.githubusercontent.com/AydinHassan/6ed0bf2219ea0f122402/raw/28d1e629947ef4e92082914172c5000a417d87c5/add-magento-version.php -o add-magento-version.php`
4. Run it with the locations of your repository and the extracted Magento code: `php add-magento-version.php ~/magento-mirror ~/magento`
5. The new version will be committed &amp; tagged. You can now push this up to the remote.

The script will figure out the version and edition of Magento from the source. It will create branches and tags based on those versions.

Branches are major.minor:

so `1.9.0.0`, `1.9.0.1` &amp; `1.9.10` all go in the `1.9` branch

`1.10.0.0` would cause a new `1.10` branch to be created.

`1.10` will be branched of `1.9` so you can diff them easily

Running the Tests
-----------------

[](#running-the-tests)

```
$ git clone git@github.com:AydinHassan/magento-core-composer-installer.git
$ cd magento-core-composer-installer
$ composer install
$ ./vendor/bin/phpunit

```

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance53

Moderate activity, may be stable

Popularity52

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 77.9% 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 ~233 days

Recently: every ~516 days

Total

11

Last Release

1840d ago

Major Versions

1.5.0 → 2.0.02020-11-06

PHP version history (3 changes)1.4.0PHP ^5.5 | ^7.0

2.0.0PHP ^7.0

2.1.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/421c0adaa533effb16310b34396c544663167970aa9eb6940edb6ed1917c963d?d=identicon)[AydinHassan](/maintainers/AydinHassan)

---

Top Contributors

[![AydinHassan](https://avatars.githubusercontent.com/u/2817002?v=4)](https://github.com/AydinHassan "AydinHassan (88 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")[![Flyingmana](https://avatars.githubusercontent.com/u/237319?v=4)](https://github.com/Flyingmana "Flyingmana (7 commits)")[![bencorlett](https://avatars.githubusercontent.com/u/181919?v=4)](https://github.com/bencorlett "bencorlett (4 commits)")[![adam-paterson](https://avatars.githubusercontent.com/u/1008727?v=4)](https://github.com/adam-paterson "adam-paterson (2 commits)")[![latenzio](https://avatars.githubusercontent.com/u/8480072?v=4)](https://github.com/latenzio "latenzio (2 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")[![convenient](https://avatars.githubusercontent.com/u/600190?v=4)](https://github.com/convenient "convenient (1 commits)")

---

Tags

composerhacktoberfestmagento2php

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/aydin-hassan-magento-core-composer-installer/health.svg)

```
[![Health](https://phpackages.com/badges/aydin-hassan-magento-core-composer-installer/health.svg)](https://phpackages.com/packages/aydin-hassan-magento-core-composer-installer)
```

###  Alternatives

[humbug/box

Fast, zero config application bundler with PHARs.

1.3k801.5k69](/packages/humbug-box)[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

2994.3M16](/packages/vaimo-composer-patches)[mglaman/composer-drupal-lenient

1317.4M15](/packages/mglaman-composer-drupal-lenient)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5341.9M446](/packages/drupal-core-composer-scaffold)[roots/wordpress-core-installer

A Composer custom installer to handle installing WordPress as a dependency

4115.6M19](/packages/roots-wordpress-core-installer)[drupal/core-project-message

Adds a message after Composer installation.

2122.6M172](/packages/drupal-core-project-message)

PHPackages © 2026

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