You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>If you have never used composer before make sure you read
45
-
>the [`Composer Basic Usage`](https://getcomposer.org/doc/01-basic-usage.md) section in Composer's documentation
44
+
> If you have never used composer before make sure you read the [`Composer Basic Usage`](https://getcomposer.org/doc/01-basic-usage.md) section in Composer's documentation.
46
45
47
-
## Choosing an installation path for Dotkernel `admin`
46
+
## Choosing an installation path for Dotkernel Admin
48
47
49
48
Example:
50
49
51
50
- absolute path `/var/www/dk-admin`
52
51
- or relative path `dk-admin` (equivalent with `./dk-admin`)
53
52
54
-
## Installing Dotkernel `admin`
53
+
## Installing Dotkernel Admin
55
54
56
55
After choosing the path for Dotkernel (`dk-admin` will be used for the remainder of this example) it must be installed.
57
56
There are two installation methods.
58
57
59
-
### I. Installing Dotkernel `admin` using composer
58
+
### I. Installing Dotkernel Admin using Composer
60
59
61
-
>please use the below CLI commands in terminal, do NOT use the PhpStorm buttons
60
+
>please use the below CLI commands in terminal, do NOT use the PhpStorm buttons
62
61
63
62
The advantage of using this command is that it runs through the whole installation process. Run the following command:
64
63
@@ -72,23 +71,24 @@ The setup script prompts for some configuration settings, for example the lines
72
71
73
72
```text
74
73
Please select which config file you wish to inject 'Laminas\Diactoros\ConfigProvider' into:
75
-
[0] Do not inject
76
-
[1] config/config.php
77
-
Make your selection (default is 1):
74
+
[0] Do not inject
75
+
[1] config/config.php
76
+
Make your selection (default is 1):
78
77
```
79
78
80
-
Simply select `[0] Do not inject`, because Dotkernel includes its own configProvider which already contains the prompted
81
-
configurations.
79
+
Simply select `[0] Do not inject`, because Dotkernel includes its own configProvider which already contains the prompted configurations.
82
80
83
-
If you choose `[1] config/config.php` Laminas's`ConfigProvider` from `session` will be injected.
81
+
If you choose `[1] config/config.php` Laminas' `ConfigProvider` from `session` will be injected.
84
82
85
83
The next question is:
86
84
87
-
`Remember this option for other packages of the same type? (y/N)`
85
+
```shell
86
+
Remember this option for other packages of the same type? (y/N)
87
+
```
88
88
89
-
Type `y` here, and hit `enter`
89
+
Type `y` here, and hit `Enter`.
90
90
91
-
### II. Installing Dotkernel `admin` using git clone
91
+
### II. Installing Dotkernel Admin using git clone
92
92
93
93
This method requires more manual input, but it ensures that the default branch is installed, even if it is not released.
94
94
Run the following command:
@@ -103,85 +103,83 @@ The dependencies have to be installed separately, by running this command
103
103
composer install
104
104
```
105
105
106
-
Just like for `II Installing Dotkernel admin using composer` (see above), the setup asks for configuration settings
107
-
regarding injections (type `0` and hit `enter`) and a confirmation to use this setting for other packages (type `y` and
108
-
hit `enter`)
106
+
Just like when [Installing Dotkernel admin using Composer](#i-installing-dotkernel-admin-using-composer), the setup asks for configuration settings regarding injections (type `0` and hit `enter`) and the confirmation to use this setting for other packages (type `y` and hit `Enter`).
109
107
110
108
## Configuration - First Run
111
109
112
110
- Remove the `.dist` extension from the files `config/autoload/local.php.dist`
113
111
- Edit `config/autoload/local.php` according to your dev machine and fill in the `database` configuration
114
112
113
+
> Charset recommendation: utf8mb4_general_ci
114
+
115
115
Run the migrations and seeds with these commands:
116
116
117
117
```shell
118
-
php bin/doctrine-migrations migrate
118
+
php ./bin/doctrine-migrations migrate
119
119
```
120
120
121
121
```shell
122
-
php bin/doctrine fixtures:execute
122
+
php ./bin/doctrine fixtures:execute
123
123
```
124
124
125
-
- If you use `composer create-project`, the project will go into development mode automatically after installing. The
126
-
development mode status can be checked and toggled by using these composer commands:
125
+
- If you use `composer create-project`, the project will go into development mode automatically after installing.
127
126
128
-
You can check if you have development mode enabled by running:
127
+
The development mode status can be checked and toggled by using the below Composer commands:
128
+
129
+
Check development status by running:
129
130
130
131
```shell
131
132
composer development-status
132
133
```
133
134
134
-
You can enable development mode by running:
135
+
Enable development mode by running:
135
136
136
137
```shell
137
138
composer development-enable
138
139
```
139
140
140
-
You can disable development mode by running:
141
+
Disable development mode by running:
141
142
142
143
```shell
143
144
composer development-disable
144
145
```
145
146
146
147
- If not already done on installation, remove the `.dist` extension from `config/autoload/development.global.php.dist`.
147
-
This will enable dev mode by turning debug flag to `true` and turning configuration caching to `off`. It will also
148
-
make sure that any existing config cache is cleared.
149
148
150
-
> Charset recommendation: utf8mb4_general_ci
149
+
This will enable dev mode by turning debug flag to `true` and turning configuration caching to `off`.
150
+
It will also make sure that any existing config cache is cleared.
151
151
152
152
## Manage GeoLite2 database
153
153
154
154
You can download/update a specific GeoLite2 database, by running the following command:
155
155
156
156
```shell
157
-
php bin/cli.php geoip:synchronize -d {DATABASE}
157
+
php ./bin/cli.php geoip:synchronize -d {DATABASE}
158
158
```
159
159
160
160
Where _{DATABASE}_ takes one of the following values: `asn`, `city`, `country`.
161
161
162
162
You can download/update all GeoLite2 databases at once, by running the following command:
163
163
164
164
```shell
165
-
php bin/cli.php geoip:synchronize
165
+
php ./bin/cli.php geoip:synchronize
166
166
```
167
167
168
-
The output should be similar to the below, displaying per
The output should be similar to the below, displaying per row:
170
169
171
-
> asn: n/a -> 2021-07-01 02:09:34
172
-
>
173
-
> city: n/a -> 2021-07-01 02:09:20
174
-
>
175
-
> country: n/a -> 2021-07-01 02:05:12
170
+
```shell
171
+
asn: n/a -> 2015-10-21 04:29:00
172
+
city: n/a ->2015-10-21 04:29:00
173
+
country: n/a -> 2015-10-21 04:29:00
174
+
```
176
175
177
176
Get help for this command by running:
178
177
179
178
```shell
180
-
php bin/cli.php help geoip:synchronize
179
+
php ./bin/cli.php help geoip:synchronize
181
180
```
182
181
183
-
**Tip**: If you setup the synchronizer command as a cronjob, you can add the `-q|--quiet` option, and it will output
184
-
data only if an error has occurred.
182
+
> If you set up the synchronizer command as a cronjob, you can add the `-q|--quiet` option, and it will output data only if an error has occurred.
185
183
186
184
## NPM Commands
187
185
@@ -191,8 +189,8 @@ To install dependencies into the `node_modules` directory run this command.
191
189
npm install
192
190
```
193
191
194
-
If `npm install` fails, this could be caused by user permissions of npm. Recommendation is to install npm
195
-
through `Node Version Manager`.
192
+
If `npm install` fails, this could be caused by user permissions of npm.
193
+
Recommendation is to install npm through `Node Version Manager`.
196
194
197
195
The watch command compiles the components then watches the files and recompiles when one of them changes.
198
196
@@ -208,15 +206,12 @@ npm run prod
208
206
209
207
## Authorization Guards
210
208
211
-
The packages responsible for restricting access to certain parts of the application
212
-
are [dot-rbac-guard](https://github.com/dotkernel/dot-rbac-guard) and [dot-rbac](https://github.com/dotkernel/dot-rbac).
213
-
These packages work together to create an infrastructure that is customizable and diversified to manage user access to
214
-
the platform by specifying the type of role the user has.
209
+
The packages responsible for restricting access to certain parts of the application are [dot-rbac-guard](https://github.com/dotkernel/dot-rbac-guard) and [dot-rbac](https://github.com/dotkernel/dot-rbac).
210
+
These packages work together to create an infrastructure that is customizable and diversified to manage user access to the platform by specifying the type of role the user has.
215
211
216
-
The `authorization.global.php` file provides multiple configurations specifying multiple roles as well as the types of
217
-
permissions to which these roles have access.
212
+
The `authorization.global.php` file provides multiple configurations specifying multiple roles as well as the types of permissions to which these roles have access.
218
213
219
-
```text
214
+
```php
220
215
'roles' => [
221
216
'superuser' => [
222
217
'permissions' => [
@@ -235,11 +230,9 @@ permissions to which these roles have access.
235
230
]
236
231
```
237
232
238
-
The `authorization-guards.global.php` file provides configuration to restrict access to certain actions based on the
239
-
permissions defined in `authorization.global.php` so basically we have to add the permissions in the dot-rbac
240
-
configuration file first to specify the action restriction permissions.
233
+
The `authorization-guards.global.php` file provides configuration to restrict access to certain actions based on the permissions defined in `authorization.global.php` so basically we have to add the permissions in the dot-rbac configuration file first to specify the action restriction permissions.
241
234
242
-
```text
235
+
```php
243
236
'rules' => [
244
237
[
245
238
'route' => 'account',
@@ -264,9 +257,9 @@ configuration file first to specify the action restriction permissions.
264
257
]
265
258
```
266
259
267
-
## Testing (Running)
260
+
## Testing (Running) the application
268
261
269
-
Note:**Do not enable dev mode in production**
262
+
>**Do not enable dev mode in production**
270
263
271
264
- Run the following command in your project's directory to start PHPs built-in server:
272
265
@@ -280,31 +273,27 @@ php -S 0.0.0.0:8080 -t public
280
273
`127.0.0.1` means that the server can only be accessed locally (localhost only)
281
274
`8080` the port on which the server is started (the listening port for the server)
282
275
283
-
**NOTE:**
284
-
If you are still getting exceptions or errors regarding some missing services, try running the following command
276
+
> If you are still getting exceptions or errors regarding some missing services, try running the following command:
285
277
286
278
```shell
287
-
php bin/clear-config-cache.php
279
+
php ./bin/clear-config-cache.php
288
280
```
289
281
290
-
> If `config-cache.php` is present that config will be loaded regardless of the `ConfigAggregator::ENABLE_CACHE`
291
-
> in `config/autoload/mezzio.global.php`
282
+
> If `config-cache.php` is present that config will be loaded regardless of the `ConfigAggregator::ENABLE_CACHE` in `config/autoload/mezzio.global.php`
292
283
293
284
- Open a web browser and visit `http://localhost:8080/`
294
285
295
286
You should see the `Dotkernel admin` login page.
296
-
297
287
If you ran the migrations you will have an admin user in the database with the following credentials:
298
288
299
289
-**User**: `admin`
300
290
-**Password**: `dotadmin`
301
291
302
-
**NOTE:**
303
-
304
-
-**Production only**: Make sure you modify the default admin credentials.
305
-
-**Development only**: `session.cookie_secure` does not work locally so make sure you modify your `local.php`, as per the following:
292
+
> **Production only**: Make sure you modify the default admin credentials.
293
+
>
294
+
> **Development only**: `session.cookie_secure` does not work locally so make sure you modify your `local.php`, as per the following:
0 commit comments