2017 © Pedro Peláez
 

library feature-php

Feature-oriented programming with PHP and FeatureIDE

image

ekuiter/feature-php

Feature-oriented programming with PHP and FeatureIDE

  • Thursday, March 22, 2018
  • by ekuiter
  • Repository
  • 1 Watchers
  • 0 Stars
  • 59 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

feature-php

feature-php is a Composer package for analyzing and implementing feature-oriented software product lines., (*1)

It can be used to:, (*2)

  • analyze and validate FeatureIDE 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)
  • 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 or ekuiter/feature-model-viz.), (*3)

Requirements

To use feature-php, the following is required:, (*4)

  • PHP >= 5.3
  • the libxml and SimpleXML extensions (most servers have these)

Also recommended are:, (*5)

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

feature-php also depends on some Composer packages:, (*6)

To install the dependencies, create the following composer.json file:, (*7)

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

Then run composer install (more information on Composer). Refer to the guide for further information., (*8)

Usage

Check out the User Guide for installation and usage., (*9)

For a quick start, you can also, (*10)

API Reference

The API reference for feature-php can be found here., (*11)

A good starting point is the ProductLine class. If you want to learn about configuration files, have a look at the ProductLine\Settings class., (*12)

Example

Command line interface

After installing, run:, (*13)

vendor/bin/feature-php --settings <productLine.json> --configuration <configuration.xml>

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. To see example input files, see uvr2web.json and UVR1611.xml., (*14)

Script usage

 "model.xml",
        "defaultConfiguration" => array(
            "data" => ""
        )
    )));

    // the configuration is user-supplied with the GET or POST parameter "configuration"
    // we could also use XmlConfiguration::fromString(...) or XmlConfiguration::fromFile(...)
    if (isset($_REQUEST["configuration"]))
        $configuration = new fphp\Model\Configuration(
            $productLine->getModel(),
            fphp\Model\XmlConfiguration::fromRequest("configuration")
        );
    else // if not supplied, use the default configuration
        $configuration = $productLine->getDefaultConfiguration();
    // used for replacements by the templating system
    fphp\Specification\ReplacementRule::setConfiguration($configuration);

    if (!isset($_REQUEST["generate"])) {
        // output some information on the model and configuration
        echo '

Generate

'; echo $configuration->renderAnalysis(); } else { // we want to generate or export a product $product = $productLine->getProduct($configuration); if (!isset($_REQUEST["export"])) { // output some information on the product echo '

Download ZIP

'; echo $product->renderAnalysis(); } else // export product as ZIP file (using "tmp" as a temporary directory) $product->export(new fphp\Exporter\DownloadZipExporter("tmp")); } } catch (Exception $e) { echo $e->getMessage(); } ?>

License

This project is released under the LGPL v3 license., (*15)

The Versions

22/03 2018

dev-master

9999999-dev https://github.com/ekuiter/feature-php

Feature-oriented programming with PHP and FeatureIDE

  Sources   Download

LGPL-3.0 LGPL-3.0-only

The Requires

 

by Elias Kuiter

configuration feature variant feature-oriented featureide software product line product line

22/03 2018

v1.1

1.1.0.0 https://github.com/ekuiter/feature-php

Feature-oriented programming with PHP and FeatureIDE

  Sources   Download

LGPL-3.0-only

The Requires

 

by Elias Kuiter

configuration feature variant feature-oriented featureide software product line product line

22/03 2018

v1.0.3

1.0.3.0 https://github.com/ekuiter/feature-php

Feature-oriented programming with PHP and FeatureIDE

  Sources   Download

LGPL-3.0-only

The Requires

 

by Elias Kuiter

configuration feature variant feature-oriented featureide software product line product line

20/03 2018

v1.0.2

1.0.2.0 https://github.com/ekuiter/feature-php

Feature-oriented programming with PHP and FeatureIDE

  Sources   Download

LGPL-3.0-only

The Requires

 

by Elias Kuiter

configuration feature variant feature-oriented featureide software product line product line

20/03 2018

v1.0.1

1.0.1.0 https://github.com/ekuiter/feature-php

Feature-oriented programming with PHP and FeatureIDE

  Sources   Download

LGPL-3.0-only

The Requires

 

by Elias Kuiter

configuration feature variant feature-oriented featureide software product line product line

20/01 2018

v1.0

1.0.0.0 https://github.com/ekuiter/feature-php

Feature-oriented programming with PHP and FeatureIDE

  Sources   Download

LGPL-3.0-only

The Requires

 

by Elias Kuiter

configuration feature variant feature-oriented featureide software product line product line