Skip to content

Commit e0a74e8

Browse files
committed
first
0 parents  commit e0a74e8

File tree

23 files changed

+431
-0
lines changed

23 files changed

+431
-0
lines changed

.env.example

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
APP_ENV=local
2+
APP_DEBUG=true
3+
APP_KEY=SomeRandomKey!!!
4+
5+
APP_LOCALE=en
6+
APP_FALLBACK_LOCALE=en
7+
8+
DB_CONNECTION=mysql
9+
DB_HOST=localhost
10+
DB_DATABASE=homestead
11+
DB_USERNAME=homestead
12+
DB_PASSWORD=secret
13+
14+
CACHE_DRIVER=memcached
15+
SESSION_DRIVER=memcached
16+
QUEUE_DRIVER=database
17+
18+
# FILESYSTEM_DRIVER=local
19+
# FILESYSTEM_CLOUD=s3
20+
21+
# S3_KEY=null
22+
# S3_SECRET=null
23+
# S3_REGION=null
24+
# S3_BUCKET=null
25+
26+
# RACKSPACE_USERNAME=null
27+
# RACKSPACE_KEY=null
28+
# RACKSPACE_CONTAINER=null
29+
# RACKSPACE_REGION=null

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/lumen.log
2+
/vendor
3+
.env

app/Console/Commands/.gitkeep

Whitespace-only changes.

app/Console/Kernel.php

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php namespace App\Console;
2+
3+
use Illuminate\Console\Scheduling\Schedule;
4+
use Laravel\Lumen\Console\Kernel as ConsoleKernel;
5+
6+
class Kernel extends ConsoleKernel
7+
{
8+
9+
/**
10+
* The Artisan commands provided by your application.
11+
*
12+
* @var array
13+
*/
14+
protected $commands = [
15+
//
16+
];
17+
18+
/**
19+
* Define the application's command schedule.
20+
*
21+
* @param \Illuminate\Console\Scheduling\Schedule $schedule
22+
* @return void
23+
*/
24+
protected function schedule(Schedule $schedule)
25+
{
26+
//
27+
}
28+
}

app/Exceptions/Handler.php

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php namespace App\Exceptions;
2+
3+
use Exception;
4+
use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
5+
6+
class Handler extends ExceptionHandler {
7+
8+
/**
9+
* A list of the exception types that should not be reported.
10+
*
11+
* @var array
12+
*/
13+
protected $dontReport = [
14+
'Symfony\Component\HttpKernel\Exception\HttpException'
15+
];
16+
17+
/**
18+
* Report or log an exception.
19+
*
20+
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
21+
*
22+
* @param \Exception $e
23+
* @return void
24+
*/
25+
public function report(Exception $e)
26+
{
27+
return parent::report($e);
28+
}
29+
30+
/**
31+
* Render an exception into an HTTP response.
32+
*
33+
* @param \Illuminate\Http\Request $request
34+
* @param \Exception $e
35+
* @return \Illuminate\Http\Response
36+
*/
37+
public function render($request, Exception $e)
38+
{
39+
return parent::render($request, $e);
40+
}
41+
42+
}

app/Http/Controllers/Controller.php

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php namespace App\Http\Controllers;
2+
3+
use Laravel\Lumen\Routing\Controller as BaseController;
4+
5+
class Controller extends BaseController
6+
{
7+
//
8+
}
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php namespace App\Http\Middleware;
2+
3+
use Closure;
4+
5+
class ExampleMiddleware {
6+
7+
/**
8+
* Handle an incoming request.
9+
*
10+
* @param \Illuminate\Http\Request $request
11+
* @param \Closure $next
12+
* @return mixed
13+
*/
14+
public function handle($request, Closure $next)
15+
{
16+
return $next($request);
17+
}
18+
19+
}

app/Http/routes.php

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
/*
4+
|--------------------------------------------------------------------------
5+
| Application Routes
6+
|--------------------------------------------------------------------------
7+
|
8+
| Here is where you can register all of the routes for an application.
9+
| It's a breeze. Simply tell Laravel the URIs it should respond to
10+
| and give it the controller to call when that URI is requested.
11+
|
12+
*/
13+
14+
$app->get('/', function() {
15+
return 'Hello World';
16+
});

app/Jobs/Job.php

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php namespace App\Jobs;
2+
3+
use Illuminate\Queue\SerializesModels;
4+
use Illuminate\Queue\InteractsWithQueue;
5+
use Illuminate\Contracts\Bus\SelfHandling;
6+
use Illuminate\Contracts\Queue\ShouldBeQueued;
7+
8+
abstract class Job implements SelfHandling, ShouldBeQueued
9+
{
10+
use InteractsWithQueue, SerializesModels;
11+
}

app/Providers/AppServiceProvider.php

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php namespace App\Providers;
2+
3+
use Illuminate\Support\ServiceProvider;
4+
5+
class AppServiceProvider extends ServiceProvider
6+
{
7+
8+
/**
9+
* Register any application services.
10+
*
11+
* @return void
12+
*/
13+
public function register()
14+
{
15+
//
16+
}
17+
}

artisan

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
use Symfony\Component\Console\Input\ArgvInput;
5+
use Symfony\Component\Console\Output\ConsoleOutput;
6+
7+
/*
8+
|--------------------------------------------------------------------------
9+
| Create The Application
10+
|--------------------------------------------------------------------------
11+
|
12+
| First we need to get an application instance. This creates an instance
13+
| of the application / container and bootstraps the application so it
14+
| is ready to receive HTTP / Console requests from the environment.
15+
|
16+
*/
17+
18+
$app = require __DIR__.'/bootstrap/app.php';
19+
20+
/*
21+
|--------------------------------------------------------------------------
22+
| Run The Artisan Application
23+
|--------------------------------------------------------------------------
24+
|
25+
| When we run the console application, the current CLI command will be
26+
| executed in this console and the response sent back to a terminal
27+
| or another output device for the developers. Here goes nothing!
28+
|
29+
*/
30+
31+
$kernel = $app->make(
32+
'Illuminate\Contracts\Console\Kernel'
33+
);
34+
35+
exit($kernel->handle(new ArgvInput, new ConsoleOutput));

bootstrap/app.php

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<?php
2+
3+
require_once __DIR__.'/../vendor/autoload.php';
4+
5+
// Dotenv::load(__DIR__.'/../');
6+
7+
/*
8+
|--------------------------------------------------------------------------
9+
| Create The Application
10+
|--------------------------------------------------------------------------
11+
|
12+
| Here we will load the environment and create the application instance
13+
| that servers as the central piece of the framework. We'll use this
14+
| application as an "IoC" container and router for this framework.
15+
|
16+
*/
17+
18+
$app = new Laravel\Lumen\Application;
19+
20+
// $app->withFacades();
21+
22+
// $app->withEloquent();
23+
24+
/*
25+
|--------------------------------------------------------------------------
26+
| Register Container Bindings
27+
|--------------------------------------------------------------------------
28+
|
29+
| Now we will register a few bindings in the service container. We will
30+
| register the exception handler and the console kernel. You may add
31+
| your own bindings here if you like or you can make another file.
32+
|
33+
*/
34+
35+
$app->singleton(
36+
'Illuminate\Contracts\Debug\ExceptionHandler',
37+
'App\Exceptions\Handler'
38+
);
39+
40+
$app->singleton(
41+
'Illuminate\Contracts\Console\Kernel',
42+
'App\Console\Kernel'
43+
);
44+
45+
/*
46+
|--------------------------------------------------------------------------
47+
| Register Middleware
48+
|--------------------------------------------------------------------------
49+
|
50+
| Next, we will register the middleware with the application. These can
51+
| be global middleware that run before and after each request into a
52+
| route or middleware that'll be assigned to some specific routes.
53+
|
54+
*/
55+
56+
// $app->middleware([
57+
// // 'Illuminate\Cookie\Middleware\EncryptCookies',
58+
// // 'Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse',
59+
// // 'Illuminate\Session\Middleware\StartSession',
60+
// // 'Illuminate\View\Middleware\ShareErrorsFromSession',
61+
// // 'Laravel\Lumen\Http\Middleware\VerifyCsrfToken',
62+
// ]);
63+
64+
// $app->routeMiddleware([
65+
66+
// ]);
67+
68+
/*
69+
|--------------------------------------------------------------------------
70+
| Register Service Providers
71+
|--------------------------------------------------------------------------
72+
|
73+
| Here we will register all of the application's service providers which
74+
| are used to bind services into the container. Service providers are
75+
| totally optional, so you are not required to uncomment this line.
76+
|
77+
*/
78+
79+
// $app->register('App\Providers\AppServiceProvider');
80+
81+
/*
82+
|--------------------------------------------------------------------------
83+
| Load The Application Routes
84+
|--------------------------------------------------------------------------
85+
|
86+
| Next we will include the routes file so that they can all be added to
87+
| the application. This will provide all of the URLs the application
88+
| can respond to, as well as the controllers that may handle them.
89+
|
90+
*/
91+
92+
require __DIR__.'/../app/Http/routes.php';
93+
94+
return $app;

composer.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"require": {
3+
"laravel/lumen-framework": "~1.0@dev",
4+
"vlucas/phpdotenv": "~1.0"
5+
},
6+
"require-dev": {
7+
"phpunit/phpunit": "~4.0"
8+
},
9+
"autoload": {
10+
"psr-4": {
11+
"App\\": "app/"
12+
},
13+
"classmap": [
14+
"tests/"
15+
]
16+
},
17+
"repositories": [
18+
{
19+
"type": "composer",
20+
"url": "http://airship.laravel.com"
21+
}
22+
]
23+
}

phpunit.xml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit backupGlobals="false"
3+
backupStaticAttributes="false"
4+
bootstrap="bootstrap/app.php"
5+
colors="true"
6+
convertErrorsToExceptions="true"
7+
convertNoticesToExceptions="true"
8+
convertWarningsToExceptions="true"
9+
processIsolation="false"
10+
stopOnFailure="false"
11+
syntaxCheck="false">
12+
<testsuites>
13+
<testsuite name="Application Test Suite">
14+
<directory>./tests/</directory>
15+
</testsuite>
16+
</testsuites>
17+
<php>
18+
<env name="APP_ENV" value="testing"/>
19+
<env name="CACHE_DRIVER" value="array"/>
20+
<env name="SESSION_DRIVER" value="array"/>
21+
<env name="QUEUE_DRIVER" value="sync"/>
22+
</php>
23+
</phpunit>

public/index.php

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
/*
4+
|--------------------------------------------------------------------------
5+
| Create The Application
6+
|--------------------------------------------------------------------------
7+
|
8+
| First we need to get an application instance. This creates an instance
9+
| of the application / container and bootstraps the application so it
10+
| is ready to receive HTTP / Console requests from the environment.
11+
|
12+
*/
13+
14+
$app = require __DIR__.'/../bootstrap/app.php';
15+
16+
/*
17+
|--------------------------------------------------------------------------
18+
| Run The Application
19+
|--------------------------------------------------------------------------
20+
|
21+
| Once we have the application, we can handle the incoming request
22+
| through the kernel, and send the associated response back to
23+
| the client's browser allowing them to enjoy the creative
24+
| and wonderful application we have prepared for them.
25+
|
26+
*/
27+
28+
$app->run();

0 commit comments

Comments
 (0)