PHP Classes

File: app/config/container.php

Recommend this page to a friend!
  Classes of Gavin Gordon Markowski  >  Helphp PHP Class Generator  >  app/config/container.php  >  Download  
File: app/config/container.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Helphp PHP Class Generator
Generate classes from configuration parameters
Author: By
Last change:
Date: 4 months ago
Size: 977 bytes
 

Contents

Class file image Download
<?php

use Pimple\Container as PimpleContainer;

$container = new PimpleContainer();

$container['parameters'] = [
   
'manifest.file' => __DIR__ . DIRECTORY_SEPARATOR . 'manifest.json',
   
'tmp.save.dir' => dirname( dirname( __DIR__ ) ) . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR
];

$container['service.documentcreator'] = function($container)
{
    return new
GGG\ConsoleApp\Service\DocumentCreator( $container['parameters']['manifest.file'], $container['parameters']['tmp.save.dir'] );
};

$container['command.create.class'] = function($container)
{
    return new
GGG\ConsoleApp\Command\Create\ClassCommand( $container['service.documentcreator'] );
};

$container['commands'] = function( $container )
{
    return [
       
$container['command.create.class']
    ];
};

$container['application'] = function( $container )
{
   
$application = new \Symfony\Component\Console\Application();
   
$application->addCommands( $container['commands'] );
    return
$application;
};

return
$container;

For more information send a message to info at phpclasses dot org.