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
Copy file name to clipboardExpand all lines: docs/book/v5/core-features/dependency-injection.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
# Dependency Injection
2
2
3
-
> Introduced in Dotkernel API 5.0.0
4
-
5
3
Dependency injection is a design pattern used in software development to implement inversion of control.
6
4
In simpler terms, it's the act of providing dependencies for an object during instantiation.
7
5
8
6
In PHP, dependency injection can be implemented in various ways, including through constructor injection, setter injection and property injection.
9
7
8
+
> Introduced in Dotkernel API 5.0.0
9
+
10
10
Dotkernel API, through its [dot-dependency-injection](https://github.com/dotkernel/dot-dependency-injection) package focuses only on constructor injection.
Copy file name to clipboardExpand all lines: docs/book/v5/core-features/error-reporting.md
-2Lines changed: 0 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,5 @@
1
1
# Error reporting endpoint
2
2
3
-
> Backward incompatibility introduced in Dotkernel API 4.1.0
4
-
5
3
The error reporting endpoint was designed to allow the **frontend developers** of your API to report any bugs they encounter in a secure way that is fully under your control.
6
4
To prevent unauthorized usage, the endpoint is protected by a token in the request's header.
This directory is a storage for project data files and service caches.
70
+
It contains these folders:
71
+
72
+
*`cache`: cache for e.g. Twig files
73
+
*`doctrine`: database migrations and fixtures
74
+
*`oauth`: encryption, private and public keys needed for authentication
75
+
*`data/lock` - lock files generated by [`dotkernel/dot-cli`](https://docs.dotkernel.org/dot-cli/v3/lock-files/)
76
+
77
+
> AVOID storing sensitive data on VCS.
78
+
79
+
### `log` directory
80
+
81
+
This directory stores daily log files.
82
+
When you access the application from the browser, (if not already created) a new log file gets created in the format specified in the `config/autoload/error-handling.global.php` config file under the `stream` array key.
83
+
84
+
### `public` directory
85
+
86
+
This directory contains all publicly available assets and serves as the entry point of the application:
87
+
88
+
*`uploads`: a folder that normally contains files uploaded via the application
89
+
*`.htaccess`: server configuration file used by Apache web server; it enables the URL rewrite functionality
90
+
*`index.php`: the application's main entry point
91
+
*`robots.txt.dist`: a sample robots.txt file that allows/denies bot access to certain areas of your application; activate it by duplicating the file as `robots.txt` and comment out the lines that don't match your environment
92
+
27
93
## `src` directory
28
94
29
-
This directory contains all source code related to the Module. It should contain following directories, if they’re not empty:
95
+
This folder contains a separate folder for each Module.
96
+
Each Module folder, in turn, should contain following directories, unless they are empty:
30
97
31
98
* Handler - Action classes (similar to Controllers but can only perform one action)
32
-
* Entity - For database entities
99
+
* Entity - Used by database entities
33
100
* Service - Service classes
34
101
* Collection - Database entities collections
35
102
* Repository - Entity repository folder
36
103
37
-
> The above example is just some of the directories a project may include, but these should give you an idea of how the structure should look like.
104
+
> The above example is just some of the directories a project may include, but they should give you an idea about the recommended structure.
38
105
39
106
Other classes in the `src` directory may include `InputFilter`, `EventListener`, `Helper`, `Command`, `Factory` etc.
40
107
41
-
The `src` directory should also contain 2 files:
108
+
The `src` directory normally also contains these files:
42
109
43
-
*`ConfigProvider.php` - Provides configuration data
44
-
*`RoutesDelegator.php` - Module main routes entry file
110
+
*`ConfigProvider.php` - Configuration data for the module
111
+
*`OpenAPI.php` - Detailed descriptions for each endpoint in the OpenAPI format
112
+
*`RoutesDelegator.php` - Module specific route registrations Module main routes entry file
45
113
46
114
## `templates` directory
47
115
48
116
This directory contains the template files, used for example to help render e-mail templates.
49
117
50
118
> Dotkernel API uses twig as Templating Engine. All template files have the extension .html.twig
51
-
52
-
## `data` directory
53
-
54
-
This directory contains project-related data (such as cache, file uploads)
55
-
56
-
We recommend using the following directory structure:
57
-
58
-
*`data/cache` - location where caches are stored
59
-
*`data/oauth` - encryption, private and public keys needed for authentication.
60
-
*`data/doctrine` - fixtures and migrations
61
-
*`data/lock` - lock files generated by `dotkernel/dot-cli`[See more](https://docs.dotkernel.org/dot-cli/v3/lock-files/)
* Mechanism for event-based extension and collaboration.
25
+
* Mechanism for event-based extension and collaboration
26
+
* Interfaces implemented in [php-fig/event-dispatcher](https://github.com/php-fig/event-dispatcher)
20
27
* PSR-15: [HTTP Server Request Handlers](https://www.php-fig.org/psr/psr-15/)
21
-
* Interfaces for HTTP server request handlers and HTTP server middleware components that use HTTP messages.
28
+
* Interfaces for HTTP server request handlers and HTTP server middleware components that use HTTP messages
29
+
* Interfaces implemented in [php-fig/http-server-handler](https://github.com/php-fig/http-server-handler) and [php-fig/http-server-middleware](https://github.com/php-fig/http-server-middleware)
0 commit comments