PHPackages                             flancer32/sample\_mage2\_module - 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. flancer32/sample\_mage2\_module

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

flancer32/sample\_mage2\_module
===============================

Magento 2 sample module.

0.0.1(10y ago)3761MITPHP

Since Dec 2Pushed 9y ago2 watchersCompare

[ Source](https://github.com/flancer32/sample_mage2_module)[ Packagist](https://packagist.org/packages/flancer32/sample_mage2_module)[ Docs](https://github.com/flancer32/sample_mage2_module)[ RSS](/packages/flancer32-sample-mage2-module/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (1)Versions (4)Used By (0)

Sample module for Magento 2
===========================

[](#sample-module-for-magento-2)

Stub for Magento 2 module with development environment.

[![Build Status](https://camo.githubusercontent.com/3fc85466c18243a0c26dbaee46c8996d594c1e03d8a48adcbcefe05430cb6ca3/68747470733a2f2f7472617669732d63692e6f72672f666c616e63657233322f73616d706c655f6d616765325f6d6f64756c652e737667)](https://travis-ci.org/flancer32/sample_mage2_module/)

Environment is deployed using PHP Composer (sources are downloaded from Magento repo), contains simple tests units and CI descriptor to run these tests on Travis-CI.

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

[](#installation)

### Create local configuration

[](#create-local-configuration)

```
$ cp deploy.cfg.sh.init deploy.cfg.work.sh
$ nano deploy.cfg.work.sh    //edit configuration for deployment

```

### Get credentials to authenticate on 'repo.magento.com'

[](#get-credentials-to-authenticate-on-repomagentocom)

Go to your [Magento Connect](https://www.magentocommerce.com/magento-connect/customer/account/) account, section (*My Account / Connect / Developer / Secure Keys*) and generate pair of keys to connect to Magento 2 repository.

### Setup environment

[](#setup-environment)

[System requirements](http://devdocs.magento.com/guides/v2.0/install-gde/system-requirements.html)

### Run deployment script

[](#run-deployment-script)

```
$ sh deploy.sh

Clean up application's root folder (/.../sample_mage2_module/work)...

Create M2 CE project in '/.../sample_mage2_module/work' using 'composer install'...
	Authentication required (repo.magento.com):    // NOTE: on the first iteration only if you will save credentials.
	  Username:
	  Password:
...
Filter original    // NOTE: unset unnecessary nodes and merge Magento's "composer.json" with your own options.
		'/.../sample_DB_NAME_module/work/composer.json' on
		'/.../sample_DB_NAME_module/deploy/composer_unset.json' set and populate with additional options from
		'/.../sample_DB_NAME_module/deploy/composer_opts.json'...
...
Update M2 CE project with additional options...
...
Drop M2 database DB_NAME...
Database "DB_NAME" dropped

(Re)install Magento using database 'DB_NAME' (connecting as 'USER_NAME').
...
Create working folders before permissions will be set.

Switch Magento 2 instance into 'developer' mode.
Enabled developer mode.

Set file system ownership (OWNER:GROUP) and permissions...

Deployment is done.
Go to http://.../ to check your Magento 2 instance.

```

Tests
-----

[](#tests)

```
$ cd work/vendor
$ php ./bin/phpunit -c flancer32/sample_mage2_module/test/unit/phpunit.dist.xml
$ php ./bin/phpunit -c flancer32/sample_mage2_module/test/functional/phpunit.dist.xml

```

Travis CI
---------

[](#travis-ci)

[Last log](https://travis-ci.org/flancer32/sample_mage2_module/).

Notes
-----

[](#notes)

### Install Composer

[](#install-composer)

This is allowed for PHP 5.6:

```
$ sudo apt-get install composer

```

Use this method for PHP 7:

```
$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer

```

### Required PHP exts

[](#required-php-exts)

You can see error message like this

```
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for magento/product-community-edition 2.0.2 -> satisfiable by magento/product-community-edition[2.0.2].
    - magento/product-community-edition 2.0.2 requires ext-gd * -> the requested PHP extension gd is missing from your system.

```

in case of not all [required PHP extensions](http://devdocs.magento.com/guides/v2.0/install-gde/system-requirements.html) are installed.

Install PHP extensions on Ubuntu:

```
$ sudo apt-get install php7.0-bcmath php7.0-curl php7.0-gd php7.0-intl php7.0-mbstring php7.0-mcrypt php7.0-mysql php7.0-xml libapache2-mod-php7.0 php7.0-zip php7.0-json php7.0-opcache

```

Apache2
-------

[](#apache2)

```
$ sudo apt-get install libapache2-mod-php7.0
$ sudo a2enmod rewrite
$ sudo service apache2 restart

```

Sample of the virtual host config:

```

        ServerName mage2.localhost
        ServerAdmin webmaster@localhost
        DocumentRoot /.../sample_mage2_module/work

                AllowOverride All
                Require all granted

        LogLevel info
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

```

Don't forget about `AllowOverride All`, otherwise rewrite rules in `.htaccess` files will not be allowed and public resources will not be generated in the `/pub/static/[frontend|adminhtml]` folders.

Links
-----

[](#links)

- [Installing Magento 2 (Integrators)](http://devdocs.magento.com/guides/v2.0/install-gde/prereq/integrator_install.html)
- [Magento 2: PHP 5.5, 5.6, or 7.0—CentOS](http://devdocs.magento.com/guides/v2.0/install-gde/prereq/php-centos.html)
- [Magento 2: PHP 5.5, 5.6, or 7.0—Ubuntu](http://devdocs.magento.com/guides/v2.0/install-gde/prereq/php-ubuntu.html)
- [Magento authentication keys](http://devdocs.magento.com/guides/v2.0/install-gde/prereq/connect-auth.html)
- [Travis CI: Defining Variables in Repository Settings](https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings)

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

3863d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6083415?v=4)[F. Lancer, SIA](/maintainers/flancer32)[@flancer32](https://github.com/flancer32)

---

Top Contributors

[![flancer64](https://avatars.githubusercontent.com/u/5052385?v=4)](https://github.com/flancer64 "flancer64 (144 commits)")

### Embed Badge

![Health badge](/badges/flancer32-sample-mage2-module/health.svg)

```
[![Health](https://phpackages.com/badges/flancer32-sample-mage2-module/health.svg)](https://phpackages.com/packages/flancer32-sample-mage2-module)
```

###  Alternatives

[mbezhanov/faker-provider-collection

A collection of custom providers for the Faker library

2139.1M25](/packages/mbezhanov-faker-provider-collection)

PHPackages © 2026

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