From 2a67161a3d952f5c23252963523a5eba405b7b22 Mon Sep 17 00:00:00 2001 From: abcsun Date: Wed, 20 Apr 2016 16:52:47 +0800 Subject: [PATCH] move the lumen generator to corresponding folder --- bin/all-petstore.sh | 1 + bin/lumen-petstore-server.sh | 31 ++ .../codegen/languages/LumenServerCodegen.java | 235 +++++++++++++ .../services/io.swagger.codegen.CodegenConfig | 1 + .../lumen/app/Console/Commands/.gitkeep | 0 .../resources/lumen/app/Console/Kernel.php | 29 ++ .../lumen/app/Exceptions/Handler.php | 50 +++ .../lumen/app/Http/Controllers/Controller.php | 10 + .../Http/Controllers/ExampleController.php | 18 + .../app/Http/Middleware/Authenticate.php | 44 +++ .../app/Http/Middleware/ExampleMiddleware.php | 20 ++ .../resources/lumen/app/Http/routes.mustache | 28 ++ .../app/Providers/AppServiceProvider.php | 18 + .../app/Providers/AuthServiceProvider.php | 40 +++ .../app/Providers/EventServiceProvider.php | 19 ++ .../src/main/resources/lumen/app/User.php | 34 ++ .../src/main/resources/lumen/artisan | 35 ++ .../main/resources/lumen/bootstrap/app.php | 102 ++++++ .../src/main/resources/lumen/composer.json | 17 + .../src/main/resources/lumen/public/.htaccess | 16 + .../src/main/resources/lumen/public/index.php | 28 ++ .../src/main/resources/lumen/readme.md | 21 ++ .../src/main/resources/lumen/routes.mustache | 28 ++ .../resources/lumen/storage/app/.gitignore | 2 + .../lumen/storage/framework/views/.gitignore | 2 + .../resources/lumen/storage/logs/.gitignore | 2 + .../resources/lumen/tests/ExampleTest.php | 20 ++ .../main/resources/lumen/tests/TestCase.php | 14 + .../codegen/lumen/LumenServerOptionsTest.java | 33 ++ .../options/LumenServerOptionsProvider.java | 30 ++ .../online/OnlineGeneratorOptionsTest.java | 2 +- .../lumen/lumen/app/Console/Kernel.php | 29 ++ .../lumen/lumen/app/Exceptions/Handler.php | 50 +++ .../lumen/app/Http/Controllers/Controller.php | 10 + .../Http/Controllers/ExampleController.php | 18 + .../app/Http/Middleware/Authenticate.php | 44 +++ .../app/Http/Middleware/ExampleMiddleware.php | 20 ++ .../petstore/lumen/lumen/app/Http/routes.php | 316 ++++++++++++++++++ .../app/Providers/AppServiceProvider.php | 18 + .../app/Providers/AuthServiceProvider.php | 40 +++ .../app/Providers/EventServiceProvider.php | 19 ++ .../server/petstore/lumen/lumen/app/User.php | 34 ++ samples/server/petstore/lumen/lumen/artisan | 35 ++ .../petstore/lumen/lumen/bootstrap/app.php | 102 ++++++ .../server/petstore/lumen/lumen/composer.json | 17 + .../petstore/lumen/lumen/public/index.php | 28 ++ samples/server/petstore/lumen/lumen/readme.md | 21 ++ 47 files changed, 1730 insertions(+), 1 deletion(-) create mode 100644 bin/lumen-petstore-server.sh create mode 100644 modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/LumenServerCodegen.java create mode 100644 modules/swagger-codegen/src/main/resources/lumen/app/Console/Commands/.gitkeep create mode 100644 modules/swagger-codegen/src/main/resources/lumen/app/Console/Kernel.php create mode 100644 modules/swagger-codegen/src/main/resources/lumen/app/Exceptions/Handler.php create mode 100644 modules/swagger-codegen/src/main/resources/lumen/app/Http/Controllers/Controller.php create mode 100644 modules/swagger-codegen/src/main/resources/lumen/app/Http/Controllers/ExampleController.php create mode 100644 modules/swagger-codegen/src/main/resources/lumen/app/Http/Middleware/Authenticate.php create mode 100644 modules/swagger-codegen/src/main/resources/lumen/app/Http/Middleware/ExampleMiddleware.php create mode 100644 modules/swagger-codegen/src/main/resources/lumen/app/Http/routes.mustache create mode 100644 modules/swagger-codegen/src/main/resources/lumen/app/Providers/AppServiceProvider.php create mode 100644 modules/swagger-codegen/src/main/resources/lumen/app/Providers/AuthServiceProvider.php create mode 100644 modules/swagger-codegen/src/main/resources/lumen/app/Providers/EventServiceProvider.php create mode 100644 modules/swagger-codegen/src/main/resources/lumen/app/User.php create mode 100644 modules/swagger-codegen/src/main/resources/lumen/artisan create mode 100644 modules/swagger-codegen/src/main/resources/lumen/bootstrap/app.php create mode 100644 modules/swagger-codegen/src/main/resources/lumen/composer.json create mode 100644 modules/swagger-codegen/src/main/resources/lumen/public/.htaccess create mode 100644 modules/swagger-codegen/src/main/resources/lumen/public/index.php create mode 100644 modules/swagger-codegen/src/main/resources/lumen/readme.md create mode 100644 modules/swagger-codegen/src/main/resources/lumen/routes.mustache create mode 100644 modules/swagger-codegen/src/main/resources/lumen/storage/app/.gitignore create mode 100644 modules/swagger-codegen/src/main/resources/lumen/storage/framework/views/.gitignore create mode 100644 modules/swagger-codegen/src/main/resources/lumen/storage/logs/.gitignore create mode 100644 modules/swagger-codegen/src/main/resources/lumen/tests/ExampleTest.php create mode 100644 modules/swagger-codegen/src/main/resources/lumen/tests/TestCase.php create mode 100644 modules/swagger-codegen/src/test/java/io/swagger/codegen/lumen/LumenServerOptionsTest.java create mode 100644 modules/swagger-codegen/src/test/java/io/swagger/codegen/options/LumenServerOptionsProvider.java create mode 100644 samples/server/petstore/lumen/lumen/app/Console/Kernel.php create mode 100644 samples/server/petstore/lumen/lumen/app/Exceptions/Handler.php create mode 100644 samples/server/petstore/lumen/lumen/app/Http/Controllers/Controller.php create mode 100644 samples/server/petstore/lumen/lumen/app/Http/Controllers/ExampleController.php create mode 100644 samples/server/petstore/lumen/lumen/app/Http/Middleware/Authenticate.php create mode 100644 samples/server/petstore/lumen/lumen/app/Http/Middleware/ExampleMiddleware.php create mode 100644 samples/server/petstore/lumen/lumen/app/Http/routes.php create mode 100644 samples/server/petstore/lumen/lumen/app/Providers/AppServiceProvider.php create mode 100644 samples/server/petstore/lumen/lumen/app/Providers/AuthServiceProvider.php create mode 100644 samples/server/petstore/lumen/lumen/app/Providers/EventServiceProvider.php create mode 100644 samples/server/petstore/lumen/lumen/app/User.php create mode 100644 samples/server/petstore/lumen/lumen/artisan create mode 100644 samples/server/petstore/lumen/lumen/bootstrap/app.php create mode 100644 samples/server/petstore/lumen/lumen/composer.json create mode 100644 samples/server/petstore/lumen/lumen/public/index.php create mode 100644 samples/server/petstore/lumen/lumen/readme.md diff --git a/bin/all-petstore.sh b/bin/all-petstore.sh index f1e8ae4b1161..f3f497254f42 100755 --- a/bin/all-petstore.sh +++ b/bin/all-petstore.sh @@ -49,3 +49,4 @@ cd $APP_DIR ./bin/tizen-petstore.sh ./bin/typescript-angular-petstore.sh ./bin/typescript-node-petstore.sh +./bin/lumen-petstore-server.sh \ No newline at end of file diff --git a/bin/lumen-petstore-server.sh b/bin/lumen-petstore-server.sh new file mode 100644 index 000000000000..15acb2fe2bd3 --- /dev/null +++ b/bin/lumen-petstore-server.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/lumen -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l lumen -o samples/server/petstore/lumen" + +java $JAVA_OPTS -jar $executable $ags diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/LumenServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/LumenServerCodegen.java new file mode 100644 index 000000000000..55e72f793846 --- /dev/null +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/LumenServerCodegen.java @@ -0,0 +1,235 @@ +package io.swagger.codegen.languages; + +import io.swagger.codegen.*; +import io.swagger.models.properties.*; + +import java.util.*; +import java.io.File; + +public class LumenServerCodegen extends DefaultCodegen implements CodegenConfig { + + // source folder where to write the files + protected String sourceFolder = "src"; + protected String apiVersion = "1.0.0"; + + /** + * Configures the type of generator. + * + * @return the CodegenType for this generator + * @see io.swagger.codegen.CodegenType + */ + public CodegenType getTag() { + return CodegenType.CLIENT; + } + + /** + * Configures a friendly name for the generator. This will be used by the generator + * to select the library with the -l flag. + * + * @return the friendly name for the generator + */ + public String getName() { + return "lumen"; + } + + /** + * Returns human-friendly help for the generator. Provide the consumer with help + * tips, parameters here + * + * @return A string value for the help message + */ + public String getHelp() { + return "Generates a LumenServerCodegen client library."; + } + + public LumenServerCodegen() { + super(); + + // set the output folder here + outputFolder = "generated-code/lumen"; + String packagePath = "lumen"; + + // modelPackage = packagePath + "\\lib\\Models"; + // apiPackage = packagePath + "\\lib"; + // // outputFolder = "generated-code" + File.separator + "slim"; + // modelTemplateFiles.put("model.mustache", ".php"); + + /** + * Models. You can write model files using the modelTemplateFiles map. + * if you want to create one template for file, you can do so here. + * for multiple files for model, just put another entry in the `modelTemplateFiles` with + * a different extension + */ + // modelTemplateFiles.put( + // "model.mustache", // the template to use + // ".sample"); // the extension for each file to write + + /** + * Api classes. You can write classes for each Api file with the apiTemplateFiles map. + * as with models, add multiple entries with different extensions for multiple files per + * class + */ + // apiTemplateFiles.put( + // "api.mustache", // the template to use + // ".sample"); // the extension for each file to write + + + // no api files + apiTemplateFiles.clear(); + + // embeddedTemplateDir = templateDir = "slim"; + + /** + * Template Location. This is the location which templates will be read from. The generator + * will use the resource stream to attempt to read the templates. + */ + templateDir = "lumen"; + + /** + * Api Package. Optional, if needed, this can be used in templates + */ + apiPackage = "io.swagger.client.api"; + + /** + * Model Package. Optional, if needed, this can be used in templates + */ + modelPackage = "io.swagger.client.model"; + + /** + * Reserved words. Override this with reserved words specific to your language + */ + reservedWords = new HashSet ( + Arrays.asList( + "sample1", // replace with static values + "sample2") + ); + + /** + * Additional Properties. These values can be passed to the templates and + * are available in models, apis, and supporting files + */ + additionalProperties.put("apiVersion", apiVersion); + + /** + * Supporting Files. You can write single files for the generator with the + * entire object tree available. If the input file has a suffix of `.mustache + * it will be processed by the template engine. Otherwise, it will be copied + */ + // supportingFiles.add(new SupportingFile("index.mustache", packagePath, "index.php")); + // supportingFiles.add(new SupportingFile("routes.mustache", packagePath, "routes.php")); + + supportingFiles.add(new SupportingFile("composer.json", packagePath, "composer.json")); + supportingFiles.add(new SupportingFile("readme.md", packagePath, "readme.md")); + supportingFiles.add(new SupportingFile("artisan", packagePath, "artisan")); + // supportingFiles.add(new SupportingFile("server.php", packagePath, "server.php")); + + supportingFiles.add(new SupportingFile("bootstrap" + File.separator + "app.php", packagePath + File.separator + "bootstrap", "app.php")); + + supportingFiles.add(new SupportingFile("public" + File.separator + "index.php", packagePath + File.separator + "public", "index.php")); + + supportingFiles.add(new SupportingFile("app" + File.separator + "User.php", packagePath + File.separator + "app", "User.php")); + supportingFiles.add(new SupportingFile("app" + File.separator + "Console" + File.separator + "Kernel.php", packagePath + File.separator + "app" + File.separator + "Console", "Kernel.php")); + supportingFiles.add(new SupportingFile("app" + File.separator + "Exceptions" + File.separator + "Handler.php", packagePath + File.separator + "app" + File.separator + "Exceptions", "Handler.php")); + // supportingFiles.add(new SupportingFile("app" + File.separator + "Http" + File.separator + "Kernel.php", packagePath + File.separator + "app" + File.separator + "Http", "Kernel.php")); + supportingFiles.add(new SupportingFile("app" + File.separator + "Http" + File.separator + "routes.mustache", packagePath + File.separator + "app" + File.separator + "Http", "routes.php")); + + supportingFiles.add(new SupportingFile("app" + File.separator + "Http" + File.separator + "Controllers" + File.separator + "Controller.php", packagePath + File.separator + "app" + File.separator + "Http" + File.separator + "Controllers" + File.separator, "Controller.php")); + supportingFiles.add(new SupportingFile("app" + File.separator + "Http" + File.separator + "Controllers" + File.separator + "ExampleController.php", packagePath + File.separator + "app" + File.separator + "Http" + File.separator + "Controllers" + File.separator, "ExampleController.php")); + // supportingFiles.add(new SupportingFile("app" + File.separator + "Http" + File.separator + "Controllers" + File.separator + "Auth" + File.separator + "AuthController.php", packagePath + File.separator + "app" + File.separator + "Http" + File.separator + "Controllers" + File.separator + "Auth" + File.separator, "AuthController.php")); + // supportingFiles.add(new SupportingFile("app" + File.separator + "Http" + File.separator + "Controllers" + File.separator + "Auth" + File.separator + "PasswordController.php", packagePath + File.separator + "app" + File.separator + "Http" + File.separator + "Controllers" + File.separator + "Auth" + File.separator, "PasswordController.php")); + + supportingFiles.add(new SupportingFile("app" + File.separator + "Http" + File.separator + "Middleware" + File.separator + "Authenticate.php", packagePath + File.separator + "app" + File.separator + "Http" + File.separator + "Middleware" + File.separator, "Authenticate.php")); + supportingFiles.add(new SupportingFile("app" + File.separator + "Http" + File.separator + "Middleware" + File.separator + "ExampleMiddleware.php", packagePath + File.separator + "app" + File.separator + "Http" + File.separator + "Middleware" + File.separator, "ExampleMiddleware.php")); + // supportingFiles.add(new SupportingFile("app" + File.separator + "Http" + File.separator + "Middleware" + File.separator + "RedirectIfAuthenticated.php", packagePath + File.separator + "app" + File.separator + "Http" + File.separator + "Middleware" + File.separator, "RedirectIfAuthenticated.php")); + // supportingFiles.add(new SupportingFile("app" + File.separator + "Http" + File.separator + "Middleware" + File.separator + "VerifyCsrfToken.php", packagePath + File.separator + "app" + File.separator + "Http" + File.separator + "Middleware" + File.separator, "VerifyCsrfToken.php")); + + // supportingFiles.add(new SupportingFile("app" + File.separator + "Http" + File.separator + "Requests" + File.separator + "Request.php", packagePath + File.separator + "app" + File.separator + "Http" + File.separator + "Requests" + File.separator, "Request.php")); + + supportingFiles.add(new SupportingFile("app" + File.separator + "Providers" + File.separator + "AppServiceProvider.php", packagePath + File.separator + "app" + File.separator + "Providers", "AppServiceProvider.php")); + supportingFiles.add(new SupportingFile("app" + File.separator + "Providers" + File.separator + "AuthServiceProvider.php", packagePath + File.separator + "app" + File.separator + "Providers", "AuthServiceProvider.php")); + supportingFiles.add(new SupportingFile("app" + File.separator + "Providers" + File.separator + "EventServiceProvider.php", packagePath + File.separator + "app" + File.separator + "Providers", "EventServiceProvider.php")); + // supportingFiles.add(new SupportingFile("app" + File.separator + "Providers" + File.separator + "RouteServiceProvider.php", packagePath + File.separator + "app" + File.separator + "Providers", "RouteServiceProvider.php")); + + // supportingFiles.add(new SupportingFile("config" + File.separator + "app.php", packagePath + File.separator + "config" + File.separator, "app.php")); + + /** + * Language Specific Primitives. These types will not trigger imports by + * the client generator + */ + languageSpecificPrimitives = new HashSet( + Arrays.asList( + "Type1", // replace these with your types + "Type2") + ); + } + + /** + * Escapes a reserved word as defined in the `reservedWords` array. Handle escaping + * those terms here. This logic is only called if a variable matches the reseved words + * + * @return the escaped term + */ + @Override + public String escapeReservedWord(String name) { + return "_" + name; // add an underscore to the name + } + + /** + * Location to write model files. You can use the modelPackage() as defined when the class is + * instantiated + */ + public String modelFileFolder() { + return outputFolder + "/" + sourceFolder + "/" + modelPackage().replace('.', File.separatorChar); + } + + /** + * Location to write api files. You can use the apiPackage() as defined when the class is + * instantiated + */ + @Override + public String apiFileFolder() { + return outputFolder + "/" + sourceFolder + "/" + apiPackage().replace('.', File.separatorChar); + } + + /** + * Optional - type declaration. This is a String which is used by the templates to instantiate your + * types. There is typically special handling for different property types + * + * @return a string value used as the `dataType` field for model templates, `returnType` for api templates + */ + @Override + public String getTypeDeclaration(Property p) { + if(p instanceof ArrayProperty) { + ArrayProperty ap = (ArrayProperty) p; + Property inner = ap.getItems(); + return getSwaggerType(p) + "[" + getTypeDeclaration(inner) + "]"; + } + else if (p instanceof MapProperty) { + MapProperty mp = (MapProperty) p; + Property inner = mp.getAdditionalProperties(); + return getSwaggerType(p) + "[String, " + getTypeDeclaration(inner) + "]"; + } + return super.getTypeDeclaration(p); + } + + /** + * Optional - swagger type conversion. This is used to map swagger types in a `Property` into + * either language specific types via `typeMapping` or into complex models if there is not a mapping. + * + * @return a string value of the type or complex model for this property + * @see io.swagger.models.properties.Property + */ + @Override + public String getSwaggerType(Property p) { + String swaggerType = super.getSwaggerType(p); + String type = null; + if(typeMapping.containsKey(swaggerType)) { + type = typeMapping.get(swaggerType); + if(languageSpecificPrimitives.contains(type)) + return toModelName(type); + } + else + type = swaggerType; + return toModelName(type); + } +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig b/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig index 070b084fdb62..00822e32b32f 100644 --- a/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig +++ b/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig @@ -40,3 +40,4 @@ io.swagger.codegen.languages.AkkaScalaClientCodegen io.swagger.codegen.languages.CsharpDotNet2ClientCodegen io.swagger.codegen.languages.ClojureClientCodegen io.swagger.codegen.languages.HaskellServantCodegen +io.swagger.codegen.languages.LumenServerCodegen \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/lumen/app/Console/Commands/.gitkeep b/modules/swagger-codegen/src/main/resources/lumen/app/Console/Commands/.gitkeep new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/modules/swagger-codegen/src/main/resources/lumen/app/Console/Kernel.php b/modules/swagger-codegen/src/main/resources/lumen/app/Console/Kernel.php new file mode 100644 index 000000000000..ad6e311cdd04 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/lumen/app/Console/Kernel.php @@ -0,0 +1,29 @@ +auth = $auth; + } + + /** + * Handle an incoming request. + * + * @param \Illuminate\Http\Request $request + * @param \Closure $next + * @param string|null $guard + * @return mixed + */ + public function handle($request, Closure $next, $guard = null) + { + if ($this->auth->guard($guard)->guest()) { + return response('Unauthorized.', 401); + } + + return $next($request); + } +} diff --git a/modules/swagger-codegen/src/main/resources/lumen/app/Http/Middleware/ExampleMiddleware.php b/modules/swagger-codegen/src/main/resources/lumen/app/Http/Middleware/ExampleMiddleware.php new file mode 100644 index 000000000000..166581c8e69b --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/lumen/app/Http/Middleware/ExampleMiddleware.php @@ -0,0 +1,20 @@ +get('/', function () use ($app) { + return $app->version(); +}); + +{{#apis}}{{#operations}}{{#operation}} +/** + * {{httpMethod}} {{nickname}} + * Summary: {{summary}} + * Notes: {{notes}} +{{#hasProduces}} * Output-Formats: [{{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}]{{/hasProduces}} + */ +$app->{{httpMethod}}('{{path}}', function({{#pathParams}}${{paramName}}, {{/pathParams}}$null = null) use ($app) { + {{#hasHeaderParams}}$headers = Request::header();{{/hasHeaderParams}} + {{#hasQueryParams}}{{#queryParams}}${{paramName}} = Request::input('{{paramName}}');{{newline}} + {{/queryParams}}{{/hasQueryParams}} + {{#hasFormParams}}{{#formParams}}${{paramName}} = Request::input('{{paramName}}');{{newline}} {{/formParams}}{{/hasFormParams}} + + return response('How about implementing {{nickname}} as a {{httpMethod}} method ?'); + }); + +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + diff --git a/modules/swagger-codegen/src/main/resources/lumen/app/Providers/AppServiceProvider.php b/modules/swagger-codegen/src/main/resources/lumen/app/Providers/AppServiceProvider.php new file mode 100644 index 000000000000..ddec04694c37 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/lumen/app/Providers/AppServiceProvider.php @@ -0,0 +1,18 @@ +input('api_token')) { + return User::where('api_token', $request->input('api_token'))->first(); + } + }); + } +} diff --git a/modules/swagger-codegen/src/main/resources/lumen/app/Providers/EventServiceProvider.php b/modules/swagger-codegen/src/main/resources/lumen/app/Providers/EventServiceProvider.php new file mode 100644 index 000000000000..0b8f3934fb3c --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/lumen/app/Providers/EventServiceProvider.php @@ -0,0 +1,19 @@ + [ + 'App\Listeners\EventListener', + ], + ]; +} diff --git a/modules/swagger-codegen/src/main/resources/lumen/app/User.php b/modules/swagger-codegen/src/main/resources/lumen/app/User.php new file mode 100644 index 000000000000..fd4de31172cf --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/lumen/app/User.php @@ -0,0 +1,34 @@ +make( + 'Illuminate\Contracts\Console\Kernel' +); + +exit($kernel->handle(new ArgvInput, new ConsoleOutput)); diff --git a/modules/swagger-codegen/src/main/resources/lumen/bootstrap/app.php b/modules/swagger-codegen/src/main/resources/lumen/bootstrap/app.php new file mode 100644 index 000000000000..9bc334dd8866 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/lumen/bootstrap/app.php @@ -0,0 +1,102 @@ +load(); +} catch (Dotenv\Exception\InvalidPathException $e) { + // +} + +/* +|-------------------------------------------------------------------------- +| Create The Application +|-------------------------------------------------------------------------- +| +| Here we will load the environment and create the application instance +| that serves as the central piece of this framework. We'll use this +| application as an "IoC" container and router for this framework. +| +*/ + +$app = new Laravel\Lumen\Application( + realpath(__DIR__.'/../') +); + +// $app->withFacades(); + +// $app->withEloquent(); + +/* +|-------------------------------------------------------------------------- +| Register Container Bindings +|-------------------------------------------------------------------------- +| +| Now we will register a few bindings in the service container. We will +| register the exception handler and the console kernel. You may add +| your own bindings here if you like or you can make another file. +| +*/ + +$app->singleton( + Illuminate\Contracts\Debug\ExceptionHandler::class, + App\Exceptions\Handler::class +); + +$app->singleton( + Illuminate\Contracts\Console\Kernel::class, + App\Console\Kernel::class +); + +class_alias('Illuminate\Support\Facades\Request', 'Request'); //to use the Reqesut facade + +/* +|-------------------------------------------------------------------------- +| Register Middleware +|-------------------------------------------------------------------------- +| +| Next, we will register the middleware with the application. These can +| be global middleware that run before and after each request into a +| route or middleware that'll be assigned to some specific routes. +| +*/ + +// $app->middleware([ +// App\Http\Middleware\ExampleMiddleware::class +// ]); + +// $app->routeMiddleware([ +// 'auth' => App\Http\Middleware\Authenticate::class, +// ]); + +/* +|-------------------------------------------------------------------------- +| Register Service Providers +|-------------------------------------------------------------------------- +| +| Here we will register all of the application's service providers which +| are used to bind services into the container. Service providers are +| totally optional, so you are not required to uncomment this line. +| +*/ + +// $app->register(App\Providers\AppServiceProvider::class); +// $app->register(App\Providers\AuthServiceProvider::class); +// $app->register(App\Providers\EventServiceProvider::class); + +/* +|-------------------------------------------------------------------------- +| Load The Application Routes +|-------------------------------------------------------------------------- +| +| Next we will include the routes file so that they can all be added to +| the application. This will provide all of the URLs the application +| can respond to, as well as the controllers that may handle them. +| +*/ + +$app->group(['namespace' => 'App\Http\Controllers'], function ($app) { + require __DIR__.'/../app/Http/routes.php'; +}); + +return $app; diff --git a/modules/swagger-codegen/src/main/resources/lumen/composer.json b/modules/swagger-codegen/src/main/resources/lumen/composer.json new file mode 100644 index 000000000000..62df199e76a7 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/lumen/composer.json @@ -0,0 +1,17 @@ +{ + "name": "laravel/lumen", + "description": "The Laravel Lumen Framework.", + "keywords": ["framework", "laravel", "lumen"], + "license": "MIT", + "type": "project", + "require": { + "php": ">=5.5.9", + "laravel/lumen-framework": "5.2.*", + "vlucas/phpdotenv": "~2.2" + }, + "autoload": { + "psr-4": { + "App\\": "app/" + } + } +} diff --git a/modules/swagger-codegen/src/main/resources/lumen/public/.htaccess b/modules/swagger-codegen/src/main/resources/lumen/public/.htaccess new file mode 100644 index 000000000000..8eb2dd0ddfa5 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/lumen/public/.htaccess @@ -0,0 +1,16 @@ + + + Options -MultiViews + + + RewriteEngine On + + # Redirect Trailing Slashes If Not A Folder... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule ^(.*)/$ /$1 [L,R=301] + + # Handle Front Controller... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^ index.php [L] + diff --git a/modules/swagger-codegen/src/main/resources/lumen/public/index.php b/modules/swagger-codegen/src/main/resources/lumen/public/index.php new file mode 100644 index 000000000000..04aa08688e00 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/lumen/public/index.php @@ -0,0 +1,28 @@ +run(); diff --git a/modules/swagger-codegen/src/main/resources/lumen/readme.md b/modules/swagger-codegen/src/main/resources/lumen/readme.md new file mode 100644 index 000000000000..9605e5f3f459 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/lumen/readme.md @@ -0,0 +1,21 @@ +## Lumen PHP Framework + +[![Build Status](https://travis-ci.org/laravel/lumen-framework.svg)](https://travis-ci.org/laravel/lumen-framework) +[![Total Downloads](https://poser.pugx.org/laravel/lumen-framework/d/total.svg)](https://packagist.org/packages/laravel/lumen-framework) +[![Latest Stable Version](https://poser.pugx.org/laravel/lumen-framework/v/stable.svg)](https://packagist.org/packages/laravel/lumen-framework) +[![Latest Unstable Version](https://poser.pugx.org/laravel/lumen-framework/v/unstable.svg)](https://packagist.org/packages/laravel/lumen-framework) +[![License](https://poser.pugx.org/laravel/lumen-framework/license.svg)](https://packagist.org/packages/laravel/lumen-framework) + +Laravel Lumen is a stunningly fast PHP micro-framework for building web applications with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Lumen attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as routing, database abstraction, queueing, and caching. + +## Official Documentation + +Documentation for the framework can be found on the [Lumen website](http://lumen.laravel.com/docs). + +## Security Vulnerabilities + +If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell at taylor@laravel.com. All security vulnerabilities will be promptly addressed. + +### License + +The Lumen framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT) diff --git a/modules/swagger-codegen/src/main/resources/lumen/routes.mustache b/modules/swagger-codegen/src/main/resources/lumen/routes.mustache new file mode 100644 index 000000000000..be2fac8d86e5 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/lumen/routes.mustache @@ -0,0 +1,28 @@ +get('/', function () use ($app) { + return $app->version(); +}); + +{{#apis}}{{#operations}}{{#operation}} +/** + * {{httpMethod}} {{nickname}} + * Summary: {{summary}} + * Notes: {{notes}} +{{#hasProduces}} * Output-Formats: [{{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}]{{/hasProduces}} + */ +Route::{{httpMethod}}('{{path}}', function({{#pathParams}}${{paramName}}, {{/pathParams}}null) use ($app) { + {{#hasHeaderParams}}$headers = Request::header();{{/hasHeaderParams}} + {{#hasQueryParams}}{{#queryParams}}${{paramName}} = Request::input('{{paramName}}');{{newline}} + {{/queryParams}}{{/hasQueryParams}} + {{#hasFormParams}}{{#formParams}}${{paramName}} = Request::input('{{paramName}}');{{newline}} {{/formParams}}{{/hasFormParams}} + + return response('How about implementing {{nickname}} as a {{httpMethod}} method ?'); + }); + +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + diff --git a/modules/swagger-codegen/src/main/resources/lumen/storage/app/.gitignore b/modules/swagger-codegen/src/main/resources/lumen/storage/app/.gitignore new file mode 100644 index 000000000000..d6b7ef32c847 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/lumen/storage/app/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/modules/swagger-codegen/src/main/resources/lumen/storage/framework/views/.gitignore b/modules/swagger-codegen/src/main/resources/lumen/storage/framework/views/.gitignore new file mode 100644 index 000000000000..d6b7ef32c847 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/lumen/storage/framework/views/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/modules/swagger-codegen/src/main/resources/lumen/storage/logs/.gitignore b/modules/swagger-codegen/src/main/resources/lumen/storage/logs/.gitignore new file mode 100644 index 000000000000..d6b7ef32c847 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/lumen/storage/logs/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/modules/swagger-codegen/src/main/resources/lumen/tests/ExampleTest.php b/modules/swagger-codegen/src/main/resources/lumen/tests/ExampleTest.php new file mode 100644 index 000000000000..2b206c66173e --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/lumen/tests/ExampleTest.php @@ -0,0 +1,20 @@ +get('/'); + + $this->assertEquals( + $this->response->getContent(), $this->app->version() + ); + } +} diff --git a/modules/swagger-codegen/src/main/resources/lumen/tests/TestCase.php b/modules/swagger-codegen/src/main/resources/lumen/tests/TestCase.php new file mode 100644 index 000000000000..651d9cbd67f3 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/lumen/tests/TestCase.php @@ -0,0 +1,14 @@ + createOptions() { + ImmutableMap.Builder builder = new ImmutableMap.Builder(); + return builder.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE) + .put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE) + .build(); + } + + @Override + public boolean isServer() { + return true; + } +} diff --git a/modules/swagger-generator/src/test/java/io/swagger/generator/online/OnlineGeneratorOptionsTest.java b/modules/swagger-generator/src/test/java/io/swagger/generator/online/OnlineGeneratorOptionsTest.java index 2ae76374adb1..9a50c9481f69 100644 --- a/modules/swagger-generator/src/test/java/io/swagger/generator/online/OnlineGeneratorOptionsTest.java +++ b/modules/swagger-generator/src/test/java/io/swagger/generator/online/OnlineGeneratorOptionsTest.java @@ -56,7 +56,7 @@ public class OnlineGeneratorOptionsTest { {new StaticHtmlOptionsProvider()}, {new SwaggerOptionsProvider()}, {new SwaggerYamlOptionsProvider()}, {new SwiftOptionsProvider()}, {new TizenClientOptionsProvider()}, {new TypeScriptAngularClientOptionsProvider()}, - {new TypeScriptNodeClientOptionsProvider()} + {new TypeScriptNodeClientOptionsProvider()}, {new LumenServerOptionsProvider()} }; } diff --git a/samples/server/petstore/lumen/lumen/app/Console/Kernel.php b/samples/server/petstore/lumen/lumen/app/Console/Kernel.php new file mode 100644 index 000000000000..ad6e311cdd04 --- /dev/null +++ b/samples/server/petstore/lumen/lumen/app/Console/Kernel.php @@ -0,0 +1,29 @@ +auth = $auth; + } + + /** + * Handle an incoming request. + * + * @param \Illuminate\Http\Request $request + * @param \Closure $next + * @param string|null $guard + * @return mixed + */ + public function handle($request, Closure $next, $guard = null) + { + if ($this->auth->guard($guard)->guest()) { + return response('Unauthorized.', 401); + } + + return $next($request); + } +} diff --git a/samples/server/petstore/lumen/lumen/app/Http/Middleware/ExampleMiddleware.php b/samples/server/petstore/lumen/lumen/app/Http/Middleware/ExampleMiddleware.php new file mode 100644 index 000000000000..166581c8e69b --- /dev/null +++ b/samples/server/petstore/lumen/lumen/app/Http/Middleware/ExampleMiddleware.php @@ -0,0 +1,20 @@ +get('/', function () use ($app) { + return $app->version(); +}); + + +/** + * POST addPet + * Summary: Add a new pet to the store + * Notes: + * Output-Formats: [application/xml, application/json] + */ +$app->POST('/pet', function($null = null) use ($app) { + + + + + return response('How about implementing addPet as a POST method ?'); + }); + + +/** + * DELETE deletePet + * Summary: Deletes a pet + * Notes: + * Output-Formats: [application/xml, application/json] + */ +$app->DELETE('/pet/{petId}', function($petId, $null = null) use ($app) { + $headers = Request::header(); + + + + return response('How about implementing deletePet as a DELETE method ?'); + }); + + +/** + * GET findPetsByStatus + * Summary: Finds Pets by status + * Notes: Multiple status values can be provided with comma separated strings + * Output-Formats: [application/xml, application/json] + */ +$app->GET('/pet/findByStatus', function($null = null) use ($app) { + + $status = Request::input('status'); + + + + return response('How about implementing findPetsByStatus as a GET method ?'); + }); + + +/** + * GET findPetsByTags + * Summary: Finds Pets by tags + * Notes: Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Output-Formats: [application/xml, application/json] + */ +$app->GET('/pet/findByTags', function($null = null) use ($app) { + + $tags = Request::input('tags'); + + + + return response('How about implementing findPetsByTags as a GET method ?'); + }); + + +/** + * GET getPetById + * Summary: Find pet by ID + * Notes: Returns a single pet + * Output-Formats: [application/xml, application/json] + */ +$app->GET('/pet/{petId}', function($petId, $null = null) use ($app) { + + + + + return response('How about implementing getPetById as a GET method ?'); + }); + + +/** + * PUT updatePet + * Summary: Update an existing pet + * Notes: + * Output-Formats: [application/xml, application/json] + */ +$app->PUT('/pet', function($null = null) use ($app) { + + + + + return response('How about implementing updatePet as a PUT method ?'); + }); + + +/** + * POST updatePetWithForm + * Summary: Updates a pet in the store with form data + * Notes: + * Output-Formats: [application/xml, application/json] + */ +$app->POST('/pet/{petId}', function($petId, $null = null) use ($app) { + + + $name = Request::input('name'); $status = Request::input('status'); + + return response('How about implementing updatePetWithForm as a POST method ?'); + }); + + +/** + * POST uploadFile + * Summary: uploads an image + * Notes: + * Output-Formats: [application/json] + */ +$app->POST('/pet/{petId}/uploadImage', function($petId, $null = null) use ($app) { + + + $additionalMetadata = Request::input('additionalMetadata'); $file = Request::input('file'); + + return response('How about implementing uploadFile as a POST method ?'); + }); + + +/** + * DELETE deleteOrder + * Summary: Delete purchase order by ID + * Notes: For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors + * Output-Formats: [application/xml, application/json] + */ +$app->DELETE('/store/order/{orderId}', function($orderId, $null = null) use ($app) { + + + + + return response('How about implementing deleteOrder as a DELETE method ?'); + }); + + +/** + * GET getInventory + * Summary: Returns pet inventories by status + * Notes: Returns a map of status codes to quantities + * Output-Formats: [application/json] + */ +$app->GET('/store/inventory', function($null = null) use ($app) { + + + + + return response('How about implementing getInventory as a GET method ?'); + }); + + +/** + * GET getOrderById + * Summary: Find purchase order by ID + * Notes: For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions + * Output-Formats: [application/xml, application/json] + */ +$app->GET('/store/order/{orderId}', function($orderId, $null = null) use ($app) { + + + + + return response('How about implementing getOrderById as a GET method ?'); + }); + + +/** + * POST placeOrder + * Summary: Place an order for a pet + * Notes: + * Output-Formats: [application/xml, application/json] + */ +$app->POST('/store/order', function($null = null) use ($app) { + + + + + return response('How about implementing placeOrder as a POST method ?'); + }); + + +/** + * POST createUser + * Summary: Create user + * Notes: This can only be done by the logged in user. + * Output-Formats: [application/xml, application/json] + */ +$app->POST('/user', function($null = null) use ($app) { + + + + + return response('How about implementing createUser as a POST method ?'); + }); + + +/** + * POST createUsersWithArrayInput + * Summary: Creates list of users with given input array + * Notes: + * Output-Formats: [application/xml, application/json] + */ +$app->POST('/user/createWithArray', function($null = null) use ($app) { + + + + + return response('How about implementing createUsersWithArrayInput as a POST method ?'); + }); + + +/** + * POST createUsersWithListInput + * Summary: Creates list of users with given input array + * Notes: + * Output-Formats: [application/xml, application/json] + */ +$app->POST('/user/createWithList', function($null = null) use ($app) { + + + + + return response('How about implementing createUsersWithListInput as a POST method ?'); + }); + + +/** + * DELETE deleteUser + * Summary: Delete user + * Notes: This can only be done by the logged in user. + * Output-Formats: [application/xml, application/json] + */ +$app->DELETE('/user/{username}', function($username, $null = null) use ($app) { + + + + + return response('How about implementing deleteUser as a DELETE method ?'); + }); + + +/** + * GET getUserByName + * Summary: Get user by user name + * Notes: + * Output-Formats: [application/xml, application/json] + */ +$app->GET('/user/{username}', function($username, $null = null) use ($app) { + + + + + return response('How about implementing getUserByName as a GET method ?'); + }); + + +/** + * GET loginUser + * Summary: Logs user into the system + * Notes: + * Output-Formats: [application/xml, application/json] + */ +$app->GET('/user/login', function($null = null) use ($app) { + + $username = Request::input('username'); + $password = Request::input('password'); + + + + return response('How about implementing loginUser as a GET method ?'); + }); + + +/** + * GET logoutUser + * Summary: Logs out current logged in user session + * Notes: + * Output-Formats: [application/xml, application/json] + */ +$app->GET('/user/logout', function($null = null) use ($app) { + + + + + return response('How about implementing logoutUser as a GET method ?'); + }); + + +/** + * PUT updateUser + * Summary: Updated user + * Notes: This can only be done by the logged in user. + * Output-Formats: [application/xml, application/json] + */ +$app->PUT('/user/{username}', function($username, $null = null) use ($app) { + + + + + return response('How about implementing updateUser as a PUT method ?'); + }); + + + diff --git a/samples/server/petstore/lumen/lumen/app/Providers/AppServiceProvider.php b/samples/server/petstore/lumen/lumen/app/Providers/AppServiceProvider.php new file mode 100644 index 000000000000..ddec04694c37 --- /dev/null +++ b/samples/server/petstore/lumen/lumen/app/Providers/AppServiceProvider.php @@ -0,0 +1,18 @@ +input('api_token')) { + return User::where('api_token', $request->input('api_token'))->first(); + } + }); + } +} diff --git a/samples/server/petstore/lumen/lumen/app/Providers/EventServiceProvider.php b/samples/server/petstore/lumen/lumen/app/Providers/EventServiceProvider.php new file mode 100644 index 000000000000..0b8f3934fb3c --- /dev/null +++ b/samples/server/petstore/lumen/lumen/app/Providers/EventServiceProvider.php @@ -0,0 +1,19 @@ + [ + 'App\Listeners\EventListener', + ], + ]; +} diff --git a/samples/server/petstore/lumen/lumen/app/User.php b/samples/server/petstore/lumen/lumen/app/User.php new file mode 100644 index 000000000000..fd4de31172cf --- /dev/null +++ b/samples/server/petstore/lumen/lumen/app/User.php @@ -0,0 +1,34 @@ +make( + 'Illuminate\Contracts\Console\Kernel' +); + +exit($kernel->handle(new ArgvInput, new ConsoleOutput)); diff --git a/samples/server/petstore/lumen/lumen/bootstrap/app.php b/samples/server/petstore/lumen/lumen/bootstrap/app.php new file mode 100644 index 000000000000..9bc334dd8866 --- /dev/null +++ b/samples/server/petstore/lumen/lumen/bootstrap/app.php @@ -0,0 +1,102 @@ +load(); +} catch (Dotenv\Exception\InvalidPathException $e) { + // +} + +/* +|-------------------------------------------------------------------------- +| Create The Application +|-------------------------------------------------------------------------- +| +| Here we will load the environment and create the application instance +| that serves as the central piece of this framework. We'll use this +| application as an "IoC" container and router for this framework. +| +*/ + +$app = new Laravel\Lumen\Application( + realpath(__DIR__.'/../') +); + +// $app->withFacades(); + +// $app->withEloquent(); + +/* +|-------------------------------------------------------------------------- +| Register Container Bindings +|-------------------------------------------------------------------------- +| +| Now we will register a few bindings in the service container. We will +| register the exception handler and the console kernel. You may add +| your own bindings here if you like or you can make another file. +| +*/ + +$app->singleton( + Illuminate\Contracts\Debug\ExceptionHandler::class, + App\Exceptions\Handler::class +); + +$app->singleton( + Illuminate\Contracts\Console\Kernel::class, + App\Console\Kernel::class +); + +class_alias('Illuminate\Support\Facades\Request', 'Request'); //to use the Reqesut facade + +/* +|-------------------------------------------------------------------------- +| Register Middleware +|-------------------------------------------------------------------------- +| +| Next, we will register the middleware with the application. These can +| be global middleware that run before and after each request into a +| route or middleware that'll be assigned to some specific routes. +| +*/ + +// $app->middleware([ +// App\Http\Middleware\ExampleMiddleware::class +// ]); + +// $app->routeMiddleware([ +// 'auth' => App\Http\Middleware\Authenticate::class, +// ]); + +/* +|-------------------------------------------------------------------------- +| Register Service Providers +|-------------------------------------------------------------------------- +| +| Here we will register all of the application's service providers which +| are used to bind services into the container. Service providers are +| totally optional, so you are not required to uncomment this line. +| +*/ + +// $app->register(App\Providers\AppServiceProvider::class); +// $app->register(App\Providers\AuthServiceProvider::class); +// $app->register(App\Providers\EventServiceProvider::class); + +/* +|-------------------------------------------------------------------------- +| Load The Application Routes +|-------------------------------------------------------------------------- +| +| Next we will include the routes file so that they can all be added to +| the application. This will provide all of the URLs the application +| can respond to, as well as the controllers that may handle them. +| +*/ + +$app->group(['namespace' => 'App\Http\Controllers'], function ($app) { + require __DIR__.'/../app/Http/routes.php'; +}); + +return $app; diff --git a/samples/server/petstore/lumen/lumen/composer.json b/samples/server/petstore/lumen/lumen/composer.json new file mode 100644 index 000000000000..62df199e76a7 --- /dev/null +++ b/samples/server/petstore/lumen/lumen/composer.json @@ -0,0 +1,17 @@ +{ + "name": "laravel/lumen", + "description": "The Laravel Lumen Framework.", + "keywords": ["framework", "laravel", "lumen"], + "license": "MIT", + "type": "project", + "require": { + "php": ">=5.5.9", + "laravel/lumen-framework": "5.2.*", + "vlucas/phpdotenv": "~2.2" + }, + "autoload": { + "psr-4": { + "App\\": "app/" + } + } +} diff --git a/samples/server/petstore/lumen/lumen/public/index.php b/samples/server/petstore/lumen/lumen/public/index.php new file mode 100644 index 000000000000..04aa08688e00 --- /dev/null +++ b/samples/server/petstore/lumen/lumen/public/index.php @@ -0,0 +1,28 @@ +run(); diff --git a/samples/server/petstore/lumen/lumen/readme.md b/samples/server/petstore/lumen/lumen/readme.md new file mode 100644 index 000000000000..9605e5f3f459 --- /dev/null +++ b/samples/server/petstore/lumen/lumen/readme.md @@ -0,0 +1,21 @@ +## Lumen PHP Framework + +[![Build Status](https://travis-ci.org/laravel/lumen-framework.svg)](https://travis-ci.org/laravel/lumen-framework) +[![Total Downloads](https://poser.pugx.org/laravel/lumen-framework/d/total.svg)](https://packagist.org/packages/laravel/lumen-framework) +[![Latest Stable Version](https://poser.pugx.org/laravel/lumen-framework/v/stable.svg)](https://packagist.org/packages/laravel/lumen-framework) +[![Latest Unstable Version](https://poser.pugx.org/laravel/lumen-framework/v/unstable.svg)](https://packagist.org/packages/laravel/lumen-framework) +[![License](https://poser.pugx.org/laravel/lumen-framework/license.svg)](https://packagist.org/packages/laravel/lumen-framework) + +Laravel Lumen is a stunningly fast PHP micro-framework for building web applications with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Lumen attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as routing, database abstraction, queueing, and caching. + +## Official Documentation + +Documentation for the framework can be found on the [Lumen website](http://lumen.laravel.com/docs). + +## Security Vulnerabilities + +If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell at taylor@laravel.com. All security vulnerabilities will be promptly addressed. + +### License + +The Lumen framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)