Download the PHP package corneltek/genphp without Composer

On this page you can find all versions of the php package corneltek/genphp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package genphp

GenPHP

GenPHP is a powerful, flexible PHP code/project generator, which helps you avoid repeating jobs.

GenPHP can generate anything you defined in the flavor, In the generator class, you can use the simple generator API to generate your code.

By using GenPHP, you can also seperate your global generator (~/.genphp/flavors), project-scope generator (./flavors).

GenPHP is using Twig template engine from Symfony.

Build Status

Requirements

Installation

Copy this line to install genphp:

$ curl https://raw.github.com/c9s/GenPHP/master/scripts/install.sh | bash

Install built-in flavors

$ git clone https://github.com/c9s/GenPHP-Flavors ~/.genphp/flavors

Usage

After installation, you can run list command to list your flavors, You can put your flavor (generator) in global flavor path (~/.genphp/flavors) or your current project flavor path (./flavors or ./.flavors), for example:

~GenPHP $ genphp list

Available flavors:
    command     flavors
    flavor      flavors
    operation   flavors
    phpunit     flavors
    project     flavors
    flavor      /Users/c9s/.genphp/flavors
    phpunit     /Users/c9s/.genphp/flavors

Creating New Flavors

The concept of GenPHP is pretty simple, when you run genphp new, it first initialize a flavor loader, then use the flavor loader to look up matched flavor from several locations.

The loaded flavor instance initializes a generator (which can be GenericGenerator, or BaseGenerator) to generate the stuff from the flavor resource directory to the destination directory. your generator class works between the flavor resource directory and the destination directory.

Creating Flavor

To create your flavor from your codebase in your project, type:

$ cd your_project
$ mkdir flavors
$ genphp new flavor foo ~/path/to/codebase

Loading flavor...
Inializing option specs...
Running generator...
    create        flavors/foo/Resource
    create        flavors/foo/Resource/file1
    create        flavors/foo/Resource/file2
    create        flavors/foo/Resource/file3
Done

You can see those created files files here, it's using GenericGenerator to copy flavors/foo/Resource to current directory.

Now you can put your own files (used by generator) into the Resource directory.

Customizing Your Flavor and Generator

For more complex usage, to create your own generator, just run:

$ genphp new flavor foo

Loading flavor...
Inializing option specs...
Running generator...
    create        flavors/foo/Resource
    render        flavors/foo/Generator.php
Done

Create new flavor without codebase path, then open the Generator.php file, write your generator actions in the generate function.

Put your favorite files into flavors/foo/Resource, then you can write operation code in PHP.

Testing Your Flavor

Once you have done, You can run new command to generate your flavor:

$ genphp new foo argument1 argument2

And your code is generated.

If you want your flavor be global (system-wide), you can run install command:

$ genphp install flavors/foo

This installs flavor to your global flavor path.

Using Operation

GenPHP provides a lot of useful operations for you to write generation tasks very easily.

CopyOperation

To copy directory recursively from flavors/foo/Resource/from/path to to/path

TouchOperation

To touch a file

CreateOperation

To create a new file with content

CopyOperation

To copy a file, copy path/file1 from Resource dir to file2

CreateDirOperation

To create a directory:

RenderOperation

To load templateName.php.twig template from flavors/foo/Resource and render the code template with variables to a file:

WriteJsonOperation

To write a json file

WriteYamlOperation

To write a yaml file

GitCloneOperation

To clone/pull a git repository:

HgCloneOperation

To clone/pull a hg repository:

Command Usage

To generate a generic PHP project structure, GenPHP provides a built-in template for this:

genphp looks for flavor in ./flavors, ./.flavors, ~/.genphp/flavors, you can define your generator in those paths.

to generate a new flavor:

To generate a new flavor from current existing code base:

To list schemas

please check ./flavors directory of this repository for more details.

Flavor API

Generator Runner

Generator API

Operations

By using built-in operations, you can create your code generator very easily, for example, the built-in flavor code generator from GenPHP:

Operation name magic:

GenPHP supports many operations:

Development

Create New Opeartion

There is a flavor for creating new opeartion already, just run:

$ ./scripts/genphp new operation DoSomething

Create New Flavor

$ ./scripts/genphp new flavor flavor_name

IRC

Join us on irc channel: #genphp on irc.freenode.net

Reference


All versions of genphp with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
corneltek/phptask Version ~1
corneltek/fileutil Version ^1
twig/twig Version ~1.32.0|^2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package corneltek/genphp contains the following files

Loading the files please wait ....