PHPackages                             ekuiter/feature-php - 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. ekuiter/feature-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ekuiter/feature-php
===================

Feature-oriented programming with PHP and FeatureIDE

v1.1(8y ago)0921LGPL-3.0-onlyPHPPHP &gt;=5.3.0

Since Jan 20Pushed 7y ago1 watchersCompare

[ Source](https://github.com/ekuiter/feature-php)[ Packagist](https://packagist.org/packages/ekuiter/feature-php)[ Docs](https://github.com/ekuiter/feature-php)[ RSS](/packages/ekuiter-feature-php/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (6)Used By (1)

feature-php
-----------

[](#feature-php)

feature-php is a [Composer package](https://packagist.org/packages/ekuiter/feature-php) for analyzing and implementing feature-oriented software product lines.

It can be used to:

- analyze and validate [FeatureIDE](https://featureide.github.io/) feature models and configurations (*domain analysis*)
- implement and trace features using the following variability mechanisms (*domain implementation*):
    - runtime variability for PHP code
    - build-system-like copying of files and directories
    - preprocessor-like template and chunk systems
    - feature-oriented programming (mixin-based)
    - aspect-oriented programming (using [Go! AOP](https://github.com/goaop/framework))
- generate products and export them (e.g. as a ZIP file) (*product derivation*)

(If you'd like some visual tools for feature models and configurations, have a look at [ekuiter/feature-configurator](https://github.com/ekuiter/feature-configurator)or [ekuiter/feature-model-viz](https://github.com/ekuiter/feature-model-viz).)

### Requirements

[](#requirements)

To use feature-php, the following is required:

- PHP &gt;= 5.3
- the libxml and SimpleXML extensions (most servers have these)

Also recommended are:

- the DOM extension (for validating XML data)
- the ZIP extension (for exporting products as ZIP files)

feature-php also depends on some Composer packages:

- [ekuiter/feature-schema](https://github.com/ekuiter/feature-schema) for validating feature models and configurations
- [nikic/PHP-Parser](https://github.com/nikic/PHP-Parser) for feature- and aspect-oriented programming

To install the dependencies, create the following `composer.json` file:

```
{
    "minimum-stability": "dev",
    "require": {
        "ekuiter/feature-php": "dev-master"
    }
}
```

Then run `composer install` ([more information on Composer](https://getcomposer.org/)). Refer to the [guide](GUIDE.md) for further information.

### Usage

[](#usage)

**Check out the [User Guide](GUIDE.md) for installation and usage.**

For a quick start, you can also

- look at the [example](#example) below
- try [ekuiter/feature-web](https://github.com/ekuiter/feature-web)
- run the command-line interface with `vendor/bin/feature-php`

### API Reference

[](#api-reference)

**The API reference for feature-php can be found [here](http://ekuiter.github.io/feature-php).**

A good starting point is the [ProductLine](http://ekuiter.github.io/feature-php/classes/FeaturePhp.ProductLine.ProductLine.html)class. If you want to learn about configuration files, have a look at the [ProductLine\\Settings](http://ekuiter.github.io/feature-php/classes/FeaturePhp.ProductLine.Settings.html)class.

### Example

[](#example)

#### Command line interface

[](#command-line-interface)

After installing, run:

```
vendor/bin/feature-php --settings  --configuration

```

in your project root to analyze a given configuration. For more information on the command-line interface, run `vendor/bin/feature-php` or refer to the [guide](GUIDE.md). To see example input files, see [uvr2web.json](https://github.com/ekuiter/uvr2web-spl/blob/master/spl/uvr2web.json)and [UVR1611.xml](https://github.com/ekuiter/uvr2web-spl/blob/master/spl/UVR1611.xml).

#### Script usage

[](#script-usage)

```
