Giter Club home page Giter Club logo

yamm's Introduction

YAMM :: Yet Another Meta Module

English

This meta module provides generally desired functionality, like:

  • A reusable Dependency Injection Container

  • Sensible logging facilities

DIC Usage

The DIC is an extension of Pimple which allows service tagging and is integrated with Oxid eSales.

To use the DIC just put a dic.php in the root of yourproject and register all your services in there. A variable $dic will be available in this fileyou can operate with:

/** @var \Marm\Yamm\DIC $dic */
$dic['acme_module_service'] = function (\Marm\Yamm\DIC $dic) {
    return new Acme\Module\Service(/* ... */);
};

On top of that we allow tagging of services and receiving of all services which are tagged with a defined tag when constructing services:

/** @var \Marm\Yamm\DIC $dic */
$dic->tag('acme_module_service', 'acme:tag');
$dic['acme_module_service'] = function (\Marm\Yamm\DIC $dic) {
    return new Acme\Module\Service(/* ... */);
};

// Somewhere else or later
$dic['acme_module_aggregator'] = function (\Marm\Yamm\DIC $dic) {
    return new Acme\Module\Aggregator(
        // Array of all services tagged with "acme:tag"
        $dic->getTagged('acme:tag')
    );
};

To get the DIC anywhere else in your project, just fetch it from oxRegistry:

/** @var \Marm\Yamm\DIC $dic */
$dic = oxRegistry::get('yamm_dic');

Licence Terms

YAMM is released under MIT.

Use this module in your project but keep the author notice. Thank you!

Authors

yamm's People

Contributors

kore avatar bizzl-greekdog avatar kyoya-de avatar

Stargazers

Alfred Bez avatar

Watchers

James Cloos avatar Joscha Krug avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.