staempfli-tool universal-code-generator
Staempfli AG - Universal Code Generator Tool
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
, (*1)
This tool can be used as base for creating code generators for specific frameworks, (*2)
Usage
-
Create your own generator project:, (*3)
-
Add this project as dependency, (*4)
composer require "staempfli/universal-code-generator":"~1.0"
composer update
-
Copy needed default configuration file, (*5)
$ cp vendor/staempfli/universal-code-generator/config/default-properties.yml.dist config/default-properties.yml
-
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();
-
Usually you might want to extend the default template:generate
command. You can do that as follows:, (*10)
-
Create the templates that will be generated:, (*11)
Prerequisites
Developers
Licence
GNU General Public License, version 3 (GPLv3), (*12)
Copyright
(c) 2016 Staempfli AG, (*13)
dev-master
9999999-dev
Staempfli AG - Universal Code Generator Tool
Sources
Download
GPL-3.0
The Requires
by
Juan Alonso
dev-develop
dev-develop
Staempfli AG - Universal Code Generator Tool
Sources
Download
GPL-3.0
The Requires
by
Juan Alonso
1.2
1.2.0.0
Staempfli AG - Universal Code Generator Tool
Sources
Download
GPL-3.0
The Requires
by
Juan Alonso
1.1.1
1.1.1.0
Staempfli AG - Universal Code Generator Tool
Sources
Download
GPL-3.0
The Requires
by
Juan Alonso
1.1
1.1.0.0
Staempfli AG - Universal Code Generator Tool
Sources
Download
GPL-3.0
The Requires
by
Juan Alonso
1.0.1
1.0.1.0
Staempfli AG - Universal Code Generator Tool
Sources
Download
GPL-3.0
The Requires
by
Juan Alonso
1.0
1.0.0.0
Staempfli AG - Universal Code Generator Tool
Sources
Download
GPL-3.0
The Requires
by
Juan Alonso