Skip to content

Commit

Permalink
Remove ConsoleKernel & HttpKernel.
Browse files Browse the repository at this point in the history
Update addomnipot version.
  • Loading branch information
jumilla committed Jan 14, 2017
1 parent e0d23fa commit cf8b906
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 244 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -14,7 +14,7 @@
"require": {
"laravel/framework": "5.3.*",
"jumilla/laravel-versionia": "^1.3.2",
"jumilla/laravel-addomnipot": "^1.7.2",
"jumilla/laravel-addomnipot": "^1.8",
"jumilla/laravel-source-generator": "^1.2"
},
"require-dev": {
Expand Down
44 changes: 10 additions & 34 deletions readme-ja.md
Expand Up @@ -65,30 +65,6 @@ composer require laravel-plus/extension
],
```

#### 3. `App\Console\Kernel`クラスのベースクラスを設定します。

**app/Console/Kernel.php** ファイルを開き、`use Illuminate\Foundation\Console\Kernel as ConsoleKernel;`の行を次のように変更してください。

```php
use LaravelPlus\Extension\ConsoleKernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
}
```

#### 4. `App\Http\Kernel`クラスのベースクラスを設定します。

**app/Http/Kernel.php** ファイルを開き、`use Illuminate\Foundation\Http\Kernel as HttpKernel;`の行を次のように変更してください。

```php
use LaravelPlus\Extension\HttpKernel as HttpKernel;

class Kernel extends HttpKernel
{
}
```

## 動作確認

サンプルとして、アドオン`wiki`を作成します。
Expand Down Expand Up @@ -210,7 +186,7 @@ php artisan database:seed
php artisan addon:status
```

`addons`ディレクトリや`app/config/addon.php`ファイルが存在しない場合は作成します。
`addons`ディレクトリや`config/addon.php`ファイルが存在しない場合は作成します。

### addon:name

Expand Down Expand Up @@ -248,7 +224,7 @@ php artisan make:addon blog ui
ひな形は9種類から選べます。

- **minimum** - 最小構成
- **simple** - **views** ディレクトリと **Http/route.php** があるシンプルな構成
- **simple** - **views** ディレクトリと **route.php** があるシンプルな構成
- **library** - PHPクラスとデータベースを提供する構成
- **api** - APIのための構成
- **ui** - UIを含むフルセット
Expand Down Expand Up @@ -282,7 +258,7 @@ artisanコマンドクラスを生成します。
$ php artisan make:console foo
```

`--addon` オプションに `blog` を指定すると、`addons/blog/classes/Console/Commands/Foo.php` ファイルを生成します。
`--addon` オプションに `blog` を指定すると、`addons/blog/classes/Commands/Foo.php` ファイルを生成します。

```sh
$ php artisan make:console foo --addon=blog
Expand All @@ -304,7 +280,7 @@ $ php artisan make:controller FooController
$ php artisan make:controller FooController --resource
```

`--addon` オプションに `blog` を指定すると、`addons/blog/classes/Http/Controllers/FooController.php` ファイルを生成します。
`--addon` オプションに `blog` を指定すると、`addons/blog/classes/Controllers/FooController.php` ファイルを生成します。

```sh
$ php artisan make:controller FooController --addon=blog
Expand Down Expand Up @@ -387,7 +363,7 @@ $ php artisan make:listener FooListener --event=bar --addon=blog
$ php artisan make:middleware foo
```

`--addon` オプションに `blog` を指定すると、`addons/blog/classes/Http/Middleware/Foo.php` ファイルを生成します。
`--addon` オプションに `blog` を指定すると、`addons/blog/classes/Middleware/Foo.php` ファイルを生成します。

```sh
$ php artisan make:middleware foo --addon=blog
Expand Down Expand Up @@ -415,7 +391,7 @@ $ php artisan make:migration App_1_1 --create=materials
$ php artisan make:migration App_1_2 --update=materials
```

`--addon` オプションに `blog` を指定すると、`addons/blog/classes/Database/Migrations/Blog_1_0.php` ファイルを生成します。
`--addon` オプションに `blog` を指定すると、`addons/blog/classes/Migrations/Blog_1_0.php` ファイルを生成します。

```sh
$ php artisan make:migration Blog_1_0 --addon=blog
Expand Down Expand Up @@ -493,7 +469,7 @@ $ php artisan make:provider FooServiceProvider --addon=blog
$ php artisan make:request FooRequest
```

`--addon` オプションに `blog` を指定すると、`addons/blog/classes/Http/Requests/FooRequest.php` ファイルを生成します。
`--addon` オプションに `blog` を指定すると、`addons/blog/classes/Requests/FooRequest.php` ファイルを生成します。

```sh
$ php artisan make:request FooRequest --addon=blog
Expand All @@ -509,7 +485,7 @@ $ php artisan make:request FooRequest --addon=blog
$ php artisan make:request staging
```

`--addon` オプションに `blog` を指定すると、`addons/blog/classes/Database/Seeds/Staging.php` ファイルを生成します。
`--addon` オプションに `blog` を指定すると、`addons/blog/classes/Seeds/Staging.php` ファイルを生成します。

```sh
$ php artisan make:request staging --addon=blog
Expand Down Expand Up @@ -558,7 +534,7 @@ class BlogController
}
```

`addon()` 関数で取得した `LaravelPlus\Extension\Addons\Addon` オブジェクトを使って、アドオンの属性やリソースにアクセスすることができます。
`addon()` 関数で取得したオブジェクトを使って、アドオンの属性やリソースにアクセスすることができます。

```php
$addon = addon();
Expand Down Expand Up @@ -588,7 +564,7 @@ $name = addon_name(\Blog\Providers\AddonServiceProvider::class); // 'blog'
```php
<?php

namespace Blog\Http\Controllers;
namespace Blog\Controllers;

class PostsController
{
Expand Down
44 changes: 10 additions & 34 deletions readme.md
Expand Up @@ -69,30 +69,6 @@ Edit file `config/app.php`.
],
```

#### 3. Set the base class of the class `App\Console\Kernel`.

Open the **app/Console/Kernel.php** file, Change `use Illuminate\Foundation\Console\Kernel as ConsoleKernel;` line to the following.

```php
use LaravelPlus\Extension\ConsoleKernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
}
```

#### 4. Set the base class of the class `App\Http\Kernel`.

Open the **app/Http/Kernel.php** file, Change `use Illuminate\Foundation\Http\Kernel as HttpKernel;` line to the following.

```php
use LaravelPlus\Extension\HttpKernel as HttpKernel;

class Kernel extends HttpKernel
{
}
```

## Check for running

Add-on `wiki` is made as a example.
Expand Down Expand Up @@ -214,7 +190,7 @@ Can check the status of addons.
php artisan addon:status
```

When `addons` directory and `app/config/addon.php` file don't exist, it's made.
When `addons` directory and `config/addon.php` file don't exist, it's made.

### `addon:name`

Expand Down Expand Up @@ -252,7 +228,7 @@ php artisan make:addon blog ui
A skeleton can be chosen from 9 kinds.

- **minimum** - Minimum structure.
- **simple** - The simple structure with the directory **views** and the file **Http/route.php**.
- **simple** - The simple structure with the directory **views** and the file **route.php**.
- **library** - The composition to which a PHP range and a database are offered.
- **api** - The structure for API.
- **ui** - Full-set including UI.
Expand Down Expand Up @@ -286,7 +262,7 @@ If you specify `foo` to name, to generate a file `app/Console/Commands/Foo.php`.
$ php artisan make:console foo
```

If you specify `blog` to option `--addon`, to generate a file `addons/blog/classes/Console/Commands/Foo.php`.
If you specify `blog` to option `--addon`, to generate a file `addons/blog/classes/Commands/Foo.php`.

```sh
$ php artisan make:console foo --addon=blog
Expand All @@ -308,7 +284,7 @@ If you specify option `--resource`, to generate a resource controller.
$ php artisan make:controller FooController --resource
```

If you specify `blog` to option `--addon`, to generate a file `addons/blog/classes/Http/Controllers/FooController.php`.
If you specify `blog` to option `--addon`, to generate a file `addons/blog/classes/Controllers/FooController.php`.

```sh
$ php artisan make:controller FooController --addon=blog
Expand Down Expand Up @@ -391,7 +367,7 @@ If you specify `foo` to name, to generate a file `app/Http/Middleware/Foo.php`.
$ php artisan make:middleware foo
```

If you specify `blog` to option `--addon`, to generate a file `addons/blog/classes/Http/Middleware/Foo.php`.
If you specify `blog` to option `--addon`, to generate a file `addons/blog/classes/Middleware/Foo.php`.

```sh
$ php artisan make:middleware foo --addon=blog
Expand Down Expand Up @@ -419,7 +395,7 @@ If you specify `materials` to option `--update`, to generate a migration class f
$ php artisan make:migration App_1_2 --update=materials
```

If you specify `blog` to option `--addon`, to generate a file `addons/blog/classes/Database/Migrations/Blog_1_0.php`.
If you specify `blog` to option `--addon`, to generate a file `addons/blog/classes/Migrations/Blog_1_0.php`.

```sh
$ php artisan make:migration Blog_1_0 --addon=blog
Expand Down Expand Up @@ -497,7 +473,7 @@ If you specify `FooRequest` to name, to generate a file `app/Http/Requests/FooRe
$ php artisan make:request FooRequest
```

If you specify `blog` to option `--addon`, to generate a file `addons/blog/classes/Http/Requests/FooRequest.php`.
If you specify `blog` to option `--addon`, to generate a file `addons/blog/classes/Requests/FooRequest.php`.

```sh
$ php artisan make:request FooRequest --addon=blog
Expand All @@ -513,7 +489,7 @@ If you specify `staging` to name, to generate a file `app/Database/Seeds/Staging
$ php artisan make:request staging
```

If you specify `blog` to option `--addon`, to generate a file `addons/blog/classes/Database/Seeds/Staging.php`.
If you specify `blog` to option `--addon`, to generate a file `addons/blog/classes/Seeds/Staging.php`.

```sh
$ php artisan make:request staging --addon=blog
Expand Down Expand Up @@ -562,7 +538,7 @@ class BlogController
}
```

`LaravelPlus\Extension\Addons\Addon` object retrieved by the `addon()` function, you can access the add-on attributes and resources.
object retrieved by the `addon()` function, you can access the add-on attributes and resources.

```php
$addon = addon();
Expand Down Expand Up @@ -592,7 +568,7 @@ If you omit the argument, returns the name of the add-on contains the caller of
```php
<?php

namespace Blog\Http\Controllers;
namespace Blog\Controllers;

class PostsController
{
Expand Down
22 changes: 0 additions & 22 deletions sources/ConsoleKernel.php

This file was deleted.

30 changes: 15 additions & 15 deletions sources/Generators/GeneratorCommandRegistrar.php
Expand Up @@ -12,21 +12,21 @@ class GeneratorCommandRegistrar
*/
protected static $commands = [
// make:
'command+.command.make' => Console\CommandMakeCommand::class,
'command+.controller.make' => Console\ControllerMakeCommand::class,
'command+.event.make' => Console\EventMakeCommand::class,
'command+.job.make' => Console\JobMakeCommand::class,
'command+.listener.make' => Console\ListenerMakeCommand::class,
'command+.mail.make' => Console\MailMakeCommand::class,
'command+.middleware.make' => Console\MiddlewareMakeCommand::class,
'command+.migration.make' => Database\Console\MigrationMakeCommand::class,
'command+.model.make' => Console\ModelMakeCommand::class,
'command+.notification.make' => Console\NotificationMakeCommand::class,
'command+.policy.make' => Console\PolicyMakeCommand::class,
'command+.provider.make' => Console\ProviderMakeCommand::class,
'command+.request.make' => Console\RequestMakeCommand::class,
'command+.seeder.make' => Database\Console\SeederMakeCommand::class,
'command+.test.make' => Console\TestMakeCommand::class,
'command.console.make' => Console\CommandMakeCommand::class,
'command.controller.make' => Console\ControllerMakeCommand::class,
'command.event.make' => Console\EventMakeCommand::class,
'command.job.make' => Console\JobMakeCommand::class,
'command.listener.make' => Console\ListenerMakeCommand::class,
'command.mail.make' => Console\MailMakeCommand::class,
'command.middleware.make' => Console\MiddlewareMakeCommand::class,
'command.migration.make' => Database\Console\MigrationMakeCommand::class,
'command.model.make' => Console\ModelMakeCommand::class,
'command.notification.make' => Console\NotificationMakeCommand::class,
'command.policy.make' => Console\PolicyMakeCommand::class,
'command.provider.make' => Console\ProviderMakeCommand::class,
'command.request.make' => Console\RequestMakeCommand::class,
'command.seeder.make' => Database\Console\SeederMakeCommand::class,
'command.test.make' => Console\TestMakeCommand::class,
];

/**
Expand Down
23 changes: 0 additions & 23 deletions sources/HttpKernel.php

This file was deleted.

0 comments on commit cf8b906

Please sign in to comment.