PHP Classes
elePHPant
Icontem

File: bin/net_bazzline_generate_locator

Recommend this page to a friend!
  Classes of nvb  >  PHP Service Locator Generator  >  bin/net_bazzline_generate_locator  >  Download  
File: bin/net_bazzline_generate_locator
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP Service Locator Generator
Generate locator classes from configuration files
Author: By
Last change:
Date: 3 years ago
Size: 1,110 bytes
 

Contents

Class file image Download
#!/bin/php
<?php
/**
 * @author stev leibelt <artodeto@bazzline.net>
 * @since 2014-06-10 
 */

use Net\Bazzline\Component\Locator\ProcessPipeFactory;

//check if is installed as composer component - taken from pdepend
if (file_exists(__DIR__ . '/../../../autoload.php')) {
    require_once __DIR__ . '/../../../autoload.php';
} else {
    require_once __DIR__ . '/../vendor/autoload.php';
}

try {
    $factory        = new ProcessPipeFactory();
    $output         = $factory->create()->execute($argv);
    /** @var \Net\Bazzline\Component\Locator\Configuration\Configuration $configuration */
    $configuration  = $output['configuration'];
    echo $configuration->getClassName() . ' created in ' . $configuration->getFilePath() . PHP_EOL;
    exit(0);
} catch (Exception $exception) {
    echo '---------' . PHP_EOL;
    echo '| Error |' . PHP_EOL;
    echo '---------' . PHP_EOL;
    echo $exception->getMessage() . PHP_EOL;
    echo '---------------' . PHP_EOL;
    echo '| Stack Trace |' . PHP_EOL;
    echo '---------------' . PHP_EOL;
    echo $exception->getTraceAsString() . PHP_EOL;
    exit(1);
}