Giter Club home page Giter Club logo

package-generators's Introduction

Lumen generators

Contents

Why ?

In order to develop your tools as a single package, you have to follow many rules to create the package directory and files under it, and these steps may waste some not short time.

So, this command will help you to create an example basic-package to help you develop faster.You should only type in your vendor and package-name to make it set up automatically.

This packages was mainly built to be used with Lumen, but it should work fine with Laravel 5 too.

Installation

Nowtimes only support local-develop methods.

  1. Download or sync this package to your {root documen}/packages/ directory;

  2. Add this code to your composer.json

    "repositories": [
    {
       "type": "path",
       "url": "{root_path}/packages/Local/package-generators"
    },

    if the "repositories" has been existed, only copy

    {
       "type": "path",
       "url": "{root_path}/packages/Local/package-generators"
    },

    under it.

    Then, Add

    "local/package-generators": "dev-master"

    under 'require' attribute.

  3. Then add the service provider in the file app/Providers/AppServiceProvider.php like the following:

    public function register()
    {
        if ($this->app->environment() == 'local') {
            $this->app->register('Generators\CommandsServiceProvider');
        }
    }

    under the register function

  4. Turn to bootstrap\app.php Add

    $app->register(Generators\commandsServiceProvider::class);

under it anywhere except the place where before require and use and after the last code return $app;;

  1. The last step, go to cmd console, and change directory to your lumen root, and execut
    composer update
    

And waiting for successfully install

Then you can try it with

php artisan list

If the package command shown in the list, means it was successfully installed.

Don't forget to include the application service provider on your bootstrap/app.php and to enable Eloquent and Facades if you are using Lumen

Quick Usage

To generate a package resource for your application , you simply need to run one single command. For example:

php artisan package localtest testNewPackage

will generate many files under package directory

packages:
+ Localtest
++ TestNewPackage
+++ config
   - CONST.php
   - database.config.php
   - main.config.php
+++ route
   - web.php
+++ src
++++ Argument
    - ArgumentFormat.php
    - ArgumentFormatLoader.php
    - ArgumentParser.php
++++ Commands
    - BaseCommand.php
    - ExampleCommand.php
++++ Exceptions
    - ArgumentFormatException.php
    - ArgumentParserException.php
    - DefaultException.php
++++ Handlers
    - ExampleHandler.php
++++ Helpers
    - FileHelper.php
    - LogHelper.php
    - SystemConfig.php
++++ Models
    - dbModel.php
    - exampleModel.php
++++ Template
    - Template.php
    - TemplateLoader.php
---- CommandsServiceProvider.php
---composer.json

Then you can use

php artisan list

to check if the example command in the list.

Development Notes

  • Version 1.0.0

    • The base package generators

Contributing

Pull requests are welcome :D

package-generators's People

Contributors

zorion-z avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.