-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
147 lines (127 loc) · 5.68 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?php
/**
* Plugin name: Radiate Plugin
* Plugin URI: https://benrutlandweb.co.uk
* Description: A WordPress plugin boilerplate
* Version: 1.0.0
* Author: Ben Rutland
* Author URI: https://benrutlandweb.co.uk
* Text Domain: radiate
*/
/**
* -----------------------------------------------------------------------------
* Register The Auto Loader
* -----------------------------------------------------------------------------
*
* Composer provides a convenient, automatically generated class loader for
* our application. We just need to utilize it! We'll simply require it
* into the script here so that we don't have to worry about manual
* loading any of our classes later on. It feels great to relax.
*
*/
require __DIR__ . '/vendor/autoload.php';
/**
* -----------------------------------------------------------------------------
* Create The Application
* -----------------------------------------------------------------------------
*
* The first thing we will do is create a new Radiate application instance
* which serves as the "glue" for all the components, and is the IoC container
* for the system binding all of the various parts.
*
*/
$app = new Radiate\Foundation\Application(__DIR__);
/**
* -----------------------------------------------------------------------------
* Register the middleware
* -----------------------------------------------------------------------------
*
* The global and route middleware can be assigned here. The request is run
* through the global middleware on every request whilst the route
* middleware may be assigned to individual routes or groups of routes.
*
*/
$app->middleware([
Radiate\Foundation\Http\Middleware\TrimStrings::class,
Radiate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
]);
$app->routeMiddleware([
'auth' => Radiate\Auth\Middleware\Authenticate::class,
'auth.basic' => Radiate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'signed' => Radiate\Routing\Middleware\ValidateSignature::class,
]);
/**
* -----------------------------------------------------------------------------
* Autoloaded Service Providers
* -----------------------------------------------------------------------------
*
* The service providers listed here will be loaded on the request
* to your application. Feel free to add your own services to
* grant expanded functionality to your applications.
*
*/
$app->register(Radiate\Auth\AuthServiceProvider::class);
$app->register(Radiate\Cache\CacheServiceProvider::class);
$app->register(Radiate\Database\DatabaseServiceProvider::class);
$app->register(Radiate\Encryption\EncryptionServiceProvider::class);
$app->register(Radiate\Foundation\Providers\FormRequestServiceProvider::class);
$app->register(Radiate\Hashing\HashServiceProvider::class);
$app->register(Radiate\JWT\JwtServiceProvider::class);
$app->register(Radiate\Mail\MailServiceProvider::class);
$app->register(Radiate\Routing\RoutingServiceProvider::class);
$app->register(Radiate\Schedule\ScheduleServiceProvider::class);
$app->register(Radiate\Validation\ValidationServiceProvider::class);
$app->register(Radiate\View\ViewServiceProvider::class);
$app->register(Radiate\WordPress\WordPressServiceProvider::class);
$app->register(Plugin\Providers\AuthServiceProvider::class);
$app->register(Plugin\Providers\EventServiceProvider::class);
$app->register(Plugin\Providers\PluginServiceProvider::class);
$app->register(Plugin\Providers\RouteServiceProvider::class);
$app->register(Plugin\Providers\ScheduleServiceProvider::class);
$app->register(Plugin\Providers\WordPressServiceProvider::class);
/**
* -----------------------------------------------------------------------------
* Class Aliases
* -----------------------------------------------------------------------------
*
* This array of class aliases will be registered when this application
* is started. However, feel free to register as many as you wish as
* the aliases are "lazy" loaded so they don't hinder performance.
*
*/
$app->aliases([
'App' => \Radiate\Support\Facades\App::class,
'Arr' => \Radiate\Support\Arr::class,
'Auth' => \Radiate\Support\Facades\Auth::class,
'Cache' => \Radiate\Support\Facades\Cache::class,
'Collection' => \Radiate\Support\Collection::class,
'Config' => \Radiate\Support\Facades\Config::class,
'Crypt' => \Radiate\Support\Facades\Crypt::class,
'DB' => \Radiate\Support\Facades\DB::class,
'Event' => \Radiate\Support\Facades\Event::class,
'File' => \Radiate\Support\Facades\File::class,
'Gate' => \Radiate\Support\Facades\Gate::class,
'Hash' => \Radiate\Support\Facades\Hash::class,
'Http' => \Radiate\Support\Facades\Http::class,
'JWT' => \Radiate\Support\Facades\JWT::class,
'Mail' => \Radiate\Support\Facades\Mail::class,
'Option' => \Radiate\Support\Facades\Option::class,
'Request' => \Radiate\Support\Facades\Request::class,
'Response' => \Radiate\Support\Facades\Response::class,
'Route' => \Radiate\Support\Facades\Route::class,
'Str' => \Radiate\Support\Str::class,
'URL' => \Radiate\Support\Facades\URL::class,
'Validator' => \Radiate\Support\Facades\Validator::class,
'View' => \Radiate\Support\Facades\View::class,
]);
/**
* -----------------------------------------------------------------------------
* Run The Application
* -----------------------------------------------------------------------------
*
* Once we have the application, we can handle the incoming request and
* allow the client to enjoy the creative and wonderful
* application we have prepared for them.
*
*/
$app->boot();