Skip to content

Commit 5928c6d

Browse files
authored
Merge pull request #44 from dotkernel/arhimede
add doctrine 3 for v5 api
2 parents a414847 + c54a193 commit 5928c6d

File tree

3 files changed

+42
-22
lines changed

3 files changed

+42
-22
lines changed

docs/book/v5/introduction/introduction.md

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Introduction
22

3-
Based on Enrico Zimuel’s Zend Expressive API – Skeleton example, DotKernel API runs on Laminas and Mezzio components and implements standards like PSR-3, PSR-4, PSR-7, PSR-11 and PSR-15.
3+
Based on Enrico Zimuel’s Zend Expressive API – Skeleton example, DotKernel API runs on Laminas and Mezzio components and
4+
implements standards like PSR-3, PSR-4, PSR-7, PSR-11 and PSR-15.
45

56
Here is a list of the core components:
67

@@ -13,9 +14,9 @@ Here is a list of the core components:
1314
* Authorization (mezzio/mezzio-authorization)
1415
* Config Aggregator (laminas/laminas-config-aggregator)
1516
* Container (roave/psr-container-doctrine)
16-
* Annotations (dotkernel/dot-annotated-services)
17+
* Dependency Injection (dotkernel/dot-dependency-injection)
1718
* Input Filter (laminas/laminas-inputfilter)
18-
* Doctrine 2 ORM (doctrine/orm)
19+
* Doctrine 3 ORM (doctrine/orm)
1920
* Serializer/Deserializer (laminas/laminas-hydrator)
2021
* Paginator (laminas/laminas-paginator)
2122
* HAL (mezzio/mezzio-hal)
@@ -24,72 +25,90 @@ Here is a list of the core components:
2425
* Fixtures (dotkernel/dot-data-fixtures)
2526
* UUID (ramsey/uuid-doctrine)
2627

27-
## Doctrine 2 ORM
28+
## Doctrine 3 ORM
2829

2930
For the persistence in a relational database management system we chose Doctrine ORM (object-relational mapper).
3031

31-
The benefit of Doctrine for the programmer is the ability to focus on the object-oriented business logic and worry about persistence only as a secondary priority.
32+
The benefit of Doctrine for the programmer is the ability to focus on the object-oriented business logic and worry about
33+
persistence only as a secondary priority.
3234

3335
## Documentation
3436

35-
Our documentation is Postman based. We use the following files in which we store information about every available endpoint ready to be tested:
37+
Our documentation is Postman based. We use the following files in which we store information about every available
38+
endpoint ready to be tested:
3639

3740
* documentation/DotKernel_API.postman_collection.json
3841
* documentation/DotKernel_API.postman_environment.json
3942

4043
## Hypertext Application Language
4144

42-
For our API payloads (a value object for describing the API resource, its relational links and any embedded/child resources related to it) we chose mezzio-hal.
45+
For our API payloads (a value object for describing the API resource, its relational links and any embedded/child
46+
resources related to it) we chose mezzio-hal.
4347

4448
## CORS
4549

46-
By using `MezzioCorsMiddlewareCorsMiddleware`, the CORS preflight will be recognized and the middleware will start to detect the proper CORS configuration. The Router is used to detect every allowed request method by executing a route match with all possible request methods. Therefore, for every preflight request, there is at least one Router request.
50+
By using `MezzioCorsMiddlewareCorsMiddleware`, the CORS preflight will be recognized and the middleware will start to
51+
detect the proper CORS configuration. The Router is used to detect every allowed request method by executing a route
52+
match with all possible request methods. Therefore, for every preflight request, there is at least one Router request.
4753

4854
## OAuth 2.0
4955

50-
OAuth 2.0 is an authorization framework that enables applications to obtain limited access to user accounts on your DotKernel API. We are using mezzio/mezzio-authentication-oauth2 which provides OAuth 2.0 authentication for Mezzio and PSR-7/PSR-15 applications by using league/oauth2-server package.
56+
OAuth 2.0 is an authorization framework that enables applications to obtain limited access to user accounts on your
57+
DotKernel API. We are using mezzio/mezzio-authentication-oauth2 which provides OAuth 2.0 authentication for Mezzio and
58+
PSR-7/PSR-15 applications by using league/oauth2-server package.
5159

5260
## Email
5361

54-
It is not unlikely for an API to send emails depending on the use case. Here is another area where DotKernel API shines. Using `DotMailServiceMailService` provided by dotkernel/dot-mail you can easily send custom email templates.
62+
It is not unlikely for an API to send emails depending on the use case. Here is another area where DotKernel API shines.
63+
Using `DotMailServiceMailService` provided by dotkernel/dot-mail you can easily send custom email templates.
5564

5665
## Configuration
5766

58-
From authorization at request route level to API keys for your application, you can find every configuration variable in the config directory.
67+
From authorization at request route level to API keys for your application, you can find every configuration variable in
68+
the config directory.
5969

6070
Registering a new module can be done by including its ConfigProvider.php in config.php.
6171

62-
Brand new middlewares should go into pipeline.php. Here you can edit the order in which they run and find more info about the currently included ones.
72+
Brand new middlewares should go into pipeline.php. Here you can edit the order in which they run and find more info
73+
about the currently included ones.
6374

6475
You can further customize your api within the autoload directory where each configuration category has its own file.
6576

6677
## Routing
6778

68-
Each module has a `RoutesDelegator.php` file for managing existing routes inside that specific module. It also allows a quick way of adding new routes by providing the route path, Middlewares that the route will use and the route name.
79+
Each module has a `RoutesDelegator.php` file for managing existing routes inside that specific module. It also allows a
80+
quick way of adding new routes by providing the route path, Middlewares that the route will use and the route name.
6981

70-
You can allocate permissions per route name in order to restrict access for a user role to a specific route in `config/autoload/authorization.global.php`.
82+
You can allocate permissions per route name in order to restrict access for a user role to a specific route
83+
in `config/autoload/authorization.global.php`.
7184

7285
## Commands
7386

74-
For registering new commands first make sure your command class extends `SymfonyComponentConsoleCommandCommand`. Then you can enable it by registering it in `config/autoload/cli.global.php`.
87+
For registering new commands first make sure your command class extends `Symfony\Component\Console\Command\Command`.
88+
Then you can enable it by registering it in `config/autoload/cli.global.php`.
7589

7690
## File locker
7791

78-
Here you will also find our brand-new file locker configuration, so you can easily turn it on or off (by default: `'enabled' => true`).
92+
Here you will also find our brand-new file locker configuration, so you can easily turn it on or off (by
93+
default: `'enabled' => true`).
7994

80-
Note: The File Locker System will create a `command-{command-default-name}.lock` file which will not let another instance of the same command to run until the previous one has finished.
95+
Note: The File Locker System will create a `command-{command-default-name}.lock` file which will not let another
96+
instance of the same command to run until the previous one has finished.
8197

8298
## PSR Standards
8399

84-
* [PSR-3](https://www.php-fig.org/psr/psr-3/): Logger Interface – the application uses `LoggerInterface` for error logging
100+
* [PSR-3](https://www.php-fig.org/psr/psr-3/): Logger Interface – the application uses `LoggerInterface` for error
101+
logging
85102
* [PSR-4](https://www.php-fig.org/psr/psr-4): Autoloader – the application locates classes using an autoloader
86103
* [PSR-7](https://www.php-fig.org/psr/psr-7): HTTP message interfaces – the handlers return `ResponseInterface`
87104
* [PSR-11](https://www.php-fig.org/psr/psr-11): Container interface – the application is container-based
88-
* [PSR-15](https://www.php-fig.org/psr/psr-15): HTTP Server Request Handlers – the handlers implement `RequestHandlerInterface`
105+
* [PSR-15](https://www.php-fig.org/psr/psr-15): HTTP Server Request Handlers – the handlers
106+
implement `RequestHandlerInterface`
89107

90108
## Tests
91109

92-
One of the best ways to ensure the quality of your product is to create and run functional and unit tests. You can find factory-made tests in the tests/AppTest/ folder, and you can also register your own.
110+
One of the best ways to ensure the quality of your product is to create and run functional and unit tests. You can find
111+
factory-made tests in the `tests/AppTest/` folder, and you can also register your own.
93112

94113
We have 2 types of tests: functional and unit tests, you can run both types at the same type by executing this command:
95114

docs/book/v5/introduction/packages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Packages
22

3-
* `dotkernel/dot-annotated-services` - Dependency injection component using class attributes.
3+
* `dotkernel/dot-dependency-injection` - Dependency injection component using class attributes.
44
* `dotkernel/dot-cache` - Cache component extending symfony-cache
55
* `dotkernel/dot-cli` - Component for creating console applications based on laminas-cli
66
* `dotkernel/dot-data-fixtures` - Provides a CLI interface for listing & executing doctrine data fixtures

docs/book/v5/introduction/server-requirements.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Both mod_php and FCGI (FPM) are supported.
2222

2323
## RDBMS
2424

25-
* MySQL / MariaDB >= 5.5.3
25+
* MariaDB >= 10.11 LTS
2626

2727
## Recommended extensions
2828

@@ -33,3 +33,4 @@ Both mod_php and FCGI (FPM) are supported.
3333
* gd, exif - if working with images
3434
* zlib, zip, bz2 - if compessing files
3535
* curl (required if APIs are used)
36+
* sqlite3 - for tests

0 commit comments

Comments
 (0)