2017 © Pedro Peláez
 

staempfli-tool universal-code-generator

Staempfli AG - Universal Code Generator Tool

image

staempfli/universal-code-generator

Staempfli AG - Universal Code Generator Tool

  • Sunday, March 11, 2018
  • by jalogut
  • Repository
  • 4 Watchers
  • 2 Stars
  • 640 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 7 Versions
  • 70 % Grown

The README.md

Universal Code Generator Tool

Project Status: Abandoned – Initial development has started, but there has not yet been a stable, usable release; the project has been abandoned and the author(s) do not intend on continuing development., (*1)

This tool can be used as base for creating code generators for specific frameworks, (*2)

Usage

  1. Create your own generator project:, (*3)

  2. Add this project as dependency, (*4)

    composer require "staempfli/universal-code-generator":"~1.0"
    composer update
    
  3. Copy needed default configuration file, (*5)

    • $ cp vendor/staempfli/universal-code-generator/config/default-properties.yml.dist config/default-properties.yml
  4. You need to create a PHP script to define the console application:, (*6)

    • We recommend to do that into the bin folder, (*7)

      cd bin && vim <command_name>, (*8)

    • Add the following content to this file:, (*9)

    #!/usr/bin/env php
    <?php
    $composerAutoload = __DIR__ . '/../../../autoload.php';
    
    if (file_exists($composerAutoload)) {
        require_once $composerAutoload;
    } else {
        require_once __DIR__ . ' /../vendor/autoload.php';
    }
    
    /**
    * Shortcut constant for the project root directory
    */
    define('BP', dirname(__DIR__));
    /**
    * Command name
    */
    define('COMMAND_NAME', basename(__FILE__));
    
    // Init Console Application
    use Staempfli\UniversalGenerator\Application;
    
    $application = new Application('@git-version@');
    
    /**
    * You can add new commands or extend exiting ones to add custom functionality
    * - Check default commands in Staempfli\UniversalGenerator\Application
    * - To add or extend commands you must use the method $application->addGeneratorCommand
    */
    // $application->addGeneratorCommand('template:generate', 'VendorName\ProjectName\Command\TemplateGenerateCommand');
    
    $application->run();
    
  5. Usually you might want to extend the default template:generate command. You can do that as follows:, (*10)

  6. Create the templates that will be generated:, (*11)

Prerequisites

  • PHP >= 5.6.*

Developers

Licence

GNU General Public License, version 3 (GPLv3), (*12)

(c) 2016 Staempfli AG, (*13)

The Versions

11/03 2018

dev-master

9999999-dev

Staempfli AG - Universal Code Generator Tool

  Sources   Download

GPL-3.0

The Requires

 

by Juan Alonso

11/03 2018

dev-develop

dev-develop

Staempfli AG - Universal Code Generator Tool

  Sources   Download

GPL-3.0

The Requires

 

by Juan Alonso

11/03 2018

1.2

1.2.0.0

Staempfli AG - Universal Code Generator Tool

  Sources   Download

GPL-3.0

The Requires

 

by Juan Alonso

25/04 2017

1.1.1

1.1.1.0

Staempfli AG - Universal Code Generator Tool

  Sources   Download

GPL-3.0

The Requires

 

by Juan Alonso

12/03 2017

1.1

1.1.0.0

Staempfli AG - Universal Code Generator Tool

  Sources   Download

GPL-3.0

The Requires

 

by Juan Alonso

13/10 2016

1.0.1

1.0.1.0

Staempfli AG - Universal Code Generator Tool

  Sources   Download

GPL-3.0

The Requires

 

by Juan Alonso

12/10 2016

1.0

1.0.0.0

Staempfli AG - Universal Code Generator Tool

  Sources   Download

GPL-3.0

The Requires

 

by Juan Alonso