2017 © Pedro Peláez
 

drupal-module drupony

image

frizinak/drupony

  • Tuesday, June 6, 2017
  • by klipkens
  • Repository
  • 1 Watchers
  • 0 Stars
  • 122 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 2 % Grown

The README.md

Build Status, (*1)

Currently: a tiny drupal - symfony-dependency-injection wrapper., (*2)

Aspired:, (*3)

  • hook_menu > symfony routes and controllers
  • node / taxonomy_terms / user > entities
  • ...
  • always remain a module that provides an sdk.

Installation:

Add this to your projects composer.json:, (*4)

"require":{
  ...
  "frizinak/drupony": "?.?.?"
}
"extra": {
  "installer-paths": {
    "<path to your modules dir>/drupony": ["frizinak/drupony"]
  }
}

<path to your modules dir> is relative to your composer.json e.a.:, (*5)

  • sites/www.example.com/modules/contrib if your composer.json resides in DRUPAL_ROOT.
  • all/modules if your composer.json is located in DRUPAL_ROOT/sites and you don't use contrib/custom subdirectories.
  • anywhere/anywhere as long as it's relative to your composer.json and drupal can identify it as a module.

$ composer update (-o --no-dev), (*6)

Configuration

  • variables (and their default values)
$conf['drupony_debug'] = FALSE;         // Only enable in dev env (e.a. staging.settings.php)
$conf['drupony_error_handler'] = TRUE;  // Symfony error handler will only be enabled
                                        // if both drupony_debug and drupony_error_handler are truthy.
$conf['drupony_autoloader'] = ?;        // Absolute path to composer autoload.php (optional), will be set if
                                        // it could be found automatically.

API

$drupony = drupony_get_wrapper()::Drupony\\Drupony

          // Symfony ContainerBuilder
$drupony->getContainer()  // Any service declared in enabledModule/service.yml
                        ->get('symfony.component.filesystem')
                        ->mkdir('woop');

defining a service: yourModule/parameters.yml (or hook_drupony_parameters), (*7)

parameters:
 yourModule.yourService.class: YourModule\YourServiceClass

yourModule/services.yml (or hook_drupony_services), (*8)

services:
 yourModule.yourService:
   class: %yourModule.yourService.class%

Contributing

please do., (*9)

The Versions

06/06 2017
06/06 2017
14/07 2015
02/07 2015