Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/book/v7/commands/create-admin-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ php ./bin/cli.php help admin:create

**Q: Can I choose the role of the created account?**

A: No. The command always assigns the `admin` role; other roles must be set afterwards.
A: No.
The command always assigns the `admin` role; other roles must be set afterwards.
See [Authorization](../core-features/authorization.md).

**Q: What can I use as the identity?**
Expand Down
3 changes: 2 additions & 1 deletion docs/book/v7/commands/display-available-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ php ./bin/cli.php route:list --help

**Q: Is the output generated from a static file?**

A: No. The command walks the application's registered routes in realtime, so it always reflects the current configuration.
A: No.
The command walks the application's registered routes in realtime, so it always reflects the current configuration.

**Q: Which filters are available?**

Expand Down
3 changes: 1 addition & 2 deletions docs/book/v7/commands/generate-database-migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ Run the following command in your application’s root directory:
vendor/bin/doctrine-migrations diff
```

If you have mapping modifications, this will create a new migration file under
`src/Core/src/App/src/Migration/`, in the `Core\App\Migration` namespace.
If you have mapping modifications, this will create a new migration file under `src/Core/src/App/src/Migration/`, in the `Core\App\Migration` namespace.
The location comes from the `doctrine.migrations.migrations_paths` key in `Core\App\ConfigProvider`.
Opening the migration file, you will notice that it contains some queries that will drop your `oauth_*` tables because they are unmapped (there is no doctrine entity describing them).
You should delete your latest migration with the DROP queries in it as we will create another one, without the DROP queries in it.
Expand Down
3 changes: 2 additions & 1 deletion docs/book/v7/commands/generate-tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,5 @@ Clear it with `php ./bin/clear-config-cache.php`.

**Q: Does the command store the token for me?**

A: No. It only prints the value; copying it into the configuration file is a manual step.
A: No.
It only prints the value; copying it into the configuration file is a manual step.
7 changes: 3 additions & 4 deletions docs/book/v7/core-features/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ Authentication in Dotkernel API is built around the `mezzio/mezzio-authenticatio
To customize authentication behavior (token lifetimes, algorithms, etc.), edit `config/autoload/local.php` under the `authentication` key.
See the [Mezzio OAuth2 documentation](https://docs.mezzio.dev/mezzio-authentication-oauth2/v1/intro/#configuration) for all available options.

> You can check the
> [mezzio/mezzio-authentication-oauth2](https://docs.mezzio.dev/mezzio-authentication-oauth2/v1/intro/#configuration)
> configuration part for more info.
> You can check the [mezzio/mezzio-authentication-oauth2](https://docs.mezzio.dev/mezzio-authentication-oauth2/v1/intro/#configuration) configuration part for more info.

## How it works

Expand Down Expand Up @@ -250,5 +248,6 @@ See [Middleware flow](../flow/middleware-flow.md).

**Q: Is authenticating enough to access an endpoint?**

A: No. Authentication establishes the identity; the role still needs permission for the route.
A: No.
Authentication establishes the identity; the role still needs permission for the route.
See [Authorization](authorization.md).
3 changes: 2 additions & 1 deletion docs/book/v7/core-features/authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ Because the middleware only knows `AuthorizationInterface`, no application code

**Q: Do the permissions cover every route?**

A: Yes, exactly. The three populated roles grant 38 permissions across the 38 declared routes, with no route ungranted and no permission naming a route that does not exist.
A: Yes, exactly.
The three populated roles grant 38 permissions across the 38 declared routes, with no route ungranted and no permission naming a route that does not exist.
`app::view-index` and `app::create-error-report` are the only two granted to two roles.

**Q: What does a rejected request look like?**
Expand Down
3 changes: 2 additions & 1 deletion docs/book/v7/core-features/content-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ A: The server attempts to deserialize the body as best it can, rather than rejec

**Q: Will `application/vnd.api+json` be rejected if I only configured `application/json`?**

A: No. Validation resolves to the more generic media type, so the request is served as JSON.
A: No.
Validation resolves to the more generic media type, so the request is served as JSON.

**Q: How do I configure a file upload endpoint?**

Expand Down
6 changes: 4 additions & 2 deletions docs/book/v7/core-features/error-reporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ A: The log entry includes the token used, and tokens can be defined as key-value

**Q: Do these tokens expire?**

A: No. Because they are indefinite, rotate them manually from time to time.
A: No.
Because they are indefinite, rotate them manually from time to time.
See [Basic security](../security/basic-security.md).

**Q: Where do the reports end up?**
Expand All @@ -176,5 +177,6 @@ If it does not exist, it is created automatically.

**Q: Does this endpoint need an auth token as well?**

A: No. It is authorized solely by the error reporting token.
A: No.
It is authorized solely by the error reporting token.
See [Using the documentation](../openapi/use-documentation.md).
3 changes: 2 additions & 1 deletion docs/book/v7/core-features/rendering-and-sending-emails.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ A: Files combining PHP and HTML with the `.phtml` extension.

**Q: Does `MailService` still need a renderer injected?**

A: No. Rendering happens in the handler, and the finished body is passed to the mail service as a parameter.
A: No.
Rendering happens in the handler, and the finished body is passed to the mail service as a parameter.

**Q: How do I render a template and send it?**

Expand Down
3 changes: 2 additions & 1 deletion docs/book/v7/extended-features/core-and-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,6 @@ See [File structure](../introduction/file-structure.md).

**Q: Was this split present before version 6.0?**

A: No. It was introduced in 6.0 when common logic was moved into the Core module.
A: No.
It was introduced in 6.0 when common logic was moved into the Core module.
See [Upgrading from 5.x to 6.0](../upgrading/UPGRADE-6.0.md).
3 changes: 2 additions & 1 deletion docs/book/v7/extended-features/injectable-input-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public function handle(ServerRequestInterface $request): ResponseInterface
}
```

While simple, this ties your handler directly to a concrete class. It’s harder to reuse logic across contexts and mock or replace the filter during testing.
While simple, this ties your handler directly to a concrete class.
It’s harder to reuse logic across contexts and mock or replace the filter during testing.

Our **current** approach uses constructor injection:

Expand Down
3 changes: 2 additions & 1 deletion docs/book/v7/extended-features/route-grouping.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ The result is less duplication, easier refactoring, and routes that belong toget
## Details

In Dotkernel API with the help of the new [dot-router](https://docs.dotkernel.org/dot-router/v1/overview/) package, we have managed to implement a nicer way of creating routes.
A lot of the times developers need to create sets of routes that have a similar format. As an example:
A lot of the times developers need to create sets of routes that have a similar format.
As an example:

```php
$app->post('/product/create', CreateProductHandler::class, 'product:create');
Expand Down
6 changes: 4 additions & 2 deletions docs/book/v7/installation/composer.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ Type `0` to select `[0] Do not inject`.

The next question is:

`Remember this option for other packages of the same type? (y/N)`
`Remember this option for other packages of the same type?
(y/N)`

Type `y` here, and hit `enter` to complete this stage.

Expand Down Expand Up @@ -124,7 +125,8 @@ A: It writes `composer.lock`, configures PHP CodeSniffer, generates the OAuth2 k

**Q: Will re-running `composer install` overwrite my configuration?**

A: No. The post-install scripts run on every `composer install` and `composer update`, but they check whether each file already exists before writing it.
A: No.
The post-install scripts run on every `composer install` and `composer update`, but they check whether each file already exists before writing it.

**Q: Composer asks where to inject `Laminas\Diactoros\ConfigProvider`. What do I answer?**

Expand Down
6 changes: 4 additions & 2 deletions docs/book/v7/installation/configuration-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ A: `config/autoload/local.php`, which is also where the API key and other enviro

**Q: Should I commit these files to version control?**

A: No. The `*.local.php` files hold environment-specific values and are excluded from the repository; only the `.dist` templates are tracked.
A: No.
The `*.local.php` files hold environment-specific values and are excluded from the repository; only the `.dist` templates are tracked.

**Q: When do I need to edit `cors.local.php`?**

Expand All @@ -66,5 +67,6 @@ See [Rendering and sending emails](../core-features/rendering-and-sending-emails

**Q: Do tests use my development database?**

A: No. `local.test.php` points the test suite at a separate in-memory database.
A: No.
`local.test.php` points the test suite at a separate in-memory database.
See [Test the installation](test-the-installation.md).
3 changes: 2 additions & 1 deletion docs/book/v7/installation/doctrine-orm.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ Only one active connection is allowed at a time, even if the array defines sever

**Q: Do I have to name the database `dotkernel`?**

A: No. That is only an example — use any name, as long as the configuration and the database you create agree.
A: No.
That is only an example — use any name, as long as the configuration and the database you create agree.

**Q: What is `table_prefix` for?**

Expand Down
3 changes: 2 additions & 1 deletion docs/book/v7/installation/test-the-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ The [FAQ page](faq.md) lists the exact error messages and their fixes.

**Q: Do I need a virtual host?**

A: No. `php -S 0.0.0.0:8080 -t public` serves the application without one, which is convenient for a quick check.
A: No.
`php -S 0.0.0.0:8080 -t public` serves the application without one, which is convenient for a quick check.

**Q: What is Bruno and why use it?**

Expand Down
3 changes: 1 addition & 2 deletions docs/book/v7/introduction/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ vendor/bin/phpunit --testsuite=FunctionalTests --testdox --colors=always

## Common Pitfalls

> !IMPORTANT
> Remember:
> !IMPORTANT Remember:

- Change default OAuth2 client credentials in production.
- Enable development mode only locally.
Expand Down
6 changes: 2 additions & 4 deletions docs/book/v7/introduction/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,13 @@ Composer refuses to install the project unless all of these are satisfied:
### Installed as dependencies

These are used directly by the application but are **not** declared in `composer.json`.
They are resolved transitively through the packages listed above, so a normal install provides them —
but the project pins no version of its own for them.
They are resolved transitively through the packages listed above, so a normal install provides them — but the project pins no version of its own for them.

* `doctrine/orm` - Object-Relational-Mapper for PHP; the persistence layer for every entity and repository
* `doctrine/dbal` - Database abstraction and schema layer that the ORM is built on; also where the migrations and the custom `UUID` type operate
* `laminas/laminas-servicemanager` - Factory-driven PSR-11 container; `config/container.php` instantiates it directly

To see which versions you actually have, run `composer show doctrine/orm` (or `composer show --tree`)
rather than relying on a constraint, since there is none to read.
To see which versions you actually have, run `composer show doctrine/orm` (or `composer show --tree`) rather than relying on a constraint, since there is none to read.

### Development requirements

Expand Down
30 changes: 12 additions & 18 deletions docs/book/v7/introduction/psr.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ PSR-7 (HTTP messages), PSR-15 (handlers and middleware) and PSR-11 (container) a

## PHP Standards Recommendations (PSRs)

Dotkernel API adheres to PHP Standards Recommendations (PSRs) established by the PHP-FIG (Framework Interoperability Group). These standards ensure code interoperability and allow Dotkernel API to work seamlessly with other PSR-compliant libraries.
Dotkernel API adheres to PHP Standards Recommendations (PSRs) established by the PHP-FIG (Framework Interoperability Group).
These standards ensure code interoperability and allow Dotkernel API to work seamlessly with other PSR-compliant libraries.

Some PSRs are at the **core** of Dotkernel API's architecture, while others are installed as dependencies through third-party packages.

Expand Down Expand Up @@ -68,71 +69,63 @@ Defines the standard interface for dependency injection containers.

Provides a standard interface for logging libraries.

**Usage**: Error handling, debugging, audit trails
**Implemented in**: `dotkernel/dot-errorhandler`
**Usage**: Error handling, debugging, audit trails **Implemented in**: `dotkernel/dot-errorhandler`

### PSR-4: Autoloader

**Repository**: [php-fig/log](https://github.com/php-fig/log)

Defines how PHP files are automatically loaded based on namespaces and file paths.

**Usage**: Automatic class loading without manual `require` statements
**Implemented in**: `Laminas\Loader`
**Usage**: Automatic class loading without manual `require` statements **Implemented in**: `Laminas\Loader`

### PSR-6: Caching Interface

**Repository**: [php-fig/cache](https://github.com/php-fig/cache)

Defines standard interfaces for caching systems to improve application performance.

**Usage**: Caching query results, configuration, templates
**Implemented in**: `dotkernel/dot-cache`
**Usage**: Caching query results, configuration, templates **Implemented in**: `dotkernel/dot-cache`

### PSR-13: Link Definition Interfaces

**Repository**: [php-fig/link](https://github.com/php-fig/link)

Describes how to represent hypermedia links independently of serialization format.

**Usage**: HAL (Hypertext Application Language) resource links
**Implemented in**: `mezzio/mezzio-hal`
**Usage**: HAL (Hypertext Application Language) resource links **Implemented in**: `mezzio/mezzio-hal`

### PSR-14: Event Dispatcher

**Repository**: [php-fig/event-dispatcher](https://github.com/php-fig/event-dispatcher)

Mechanism for event-based extension and collaboration between components.

**Usage**: Triggering events on user actions, logging events, notifications
**Implemented in**: Third-party packages as needed
**Usage**: Triggering events on user actions, logging events, notifications **Implemented in**: Third-party packages as needed

### PSR-17: HTTP Factories

**Repository**: [php-fig/http-factory](https://github.com/php-fig/http-factory)

Standard for factories that create PSR-7 compliant HTTP objects.

**Usage**: Creating requests, responses, and streams programmatically
**Implemented in**: `Laminas\Diactoros`
**Usage**: Creating requests, responses, and streams programmatically **Implemented in**: `Laminas\Diactoros`

### PSR-18: HTTP Client

**Repository**: [php-fig/http-client](https://github.com/php-fig/http-client)

Interface for sending HTTP requests and receiving HTTP responses.

**Usage**: Calling external APIs from your Dotkernel API
**Implemented in**: `symfony/http-client` or similar packages
**Usage**: Calling external APIs from your Dotkernel API **Implemented in**: `symfony/http-client` or similar packages

### PSR-20: Clock

**Repository**: [php-fig/clock](https://github.com/php-fig/clock)

Provides a standard interface for reading the system clock.

**Usage**: Getting current time in a testable way
**Implemented in**: Third-party packages as needed
**Usage**: Getting current time in a testable way **Implemented in**: Third-party packages as needed

### PSR Implementation Hierarchy

Expand Down Expand Up @@ -193,7 +186,8 @@ See [File structure](file-structure.md).

**Q: Do I need to install anything to use PSR-3 logging or PSR-6 caching?**

A: No. They come with `dotkernel/dot-errorhandler` and `dotkernel/dot-cache` respectively.
A: No.
They come with `dotkernel/dot-errorhandler` and `dotkernel/dot-cache` respectively.
See [Packages](packages.md).

**Q: How do I call an external API from Dotkernel API?**
Expand Down
Loading