From 30d65c5bc48e3647c01c9fec432302ad9b6c52b1 Mon Sep 17 00:00:00 2001 From: NGUEREZA Tony Date: Wed, 19 Jul 2023 20:01:51 +0100 Subject: [PATCH] Fix typo --- src/contribution.md | 16 ++++++------- src/general/container.md | 6 ++--- src/general/lifecycle.md | 4 ++-- src/general/providers.md | 35 ++++++++++++++++++++++------ src/getting-started/architecture.md | 2 +- src/getting-started/configuration.md | 12 ++++++---- src/getting-started/deployment.md | 6 ++--- src/getting-started/installation.md | 11 +++++---- src/overview/action.md | 6 ++--- src/overview/middleware.md | 17 +++++++------- src/overview/routing.md | 6 ++--- src/overview/session.md | 6 ++--- src/overview/template.md | 12 +++++----- src/overview/url-generation.md | 6 ++--- src/packages/index.md | 2 +- src/requirements.md | 2 +- src/welcome.md | 4 ++-- 17 files changed, 89 insertions(+), 64 deletions(-) diff --git a/src/contribution.md b/src/contribution.md index 9aaa57f..434a868 100644 --- a/src/contribution.md +++ b/src/contribution.md @@ -10,7 +10,7 @@ To encourage active collaboration, Platine strongly encourages pull requests, no However, if you fill a bug report, your issue should contain a title and a clear description of the issue. You should also include as much relevant information as possible and a code sample that demonstrates the issue. The goal of a bug report is to make it easy for yourself - and others - to replicate the bug and develop a fix. -Remember, bug reports are created in the hope that others with the same problem will be able to collaborate with you on solving it. Do not expect that the bug report will automatically see any activity or that others will jump to fix it. Creating a bug report serves to help yourself and others start on the path of fixing the problem. If you want to chip in, you can help out by fixing [any bugs listed in our issue trackers](https://github.com/platine-php/app/issues). You must be authenticated with GitHub to view all of issues. +Remember, bug reports are created in the hope that others with the same problem will be able to collaborate with you on solving it. Do not expect that the bug report will automatically see any activity or that others will jump to fix it. Creating a bug report serves to help yourself and others start on the path of fixing the problem. If you want to chip in, you can help out by fixing [any bugs listed in our issue trackers](https://github.com/platine-php/framework/issues). You must be authenticated with GitHub to view all of issues. The Platine source code is managed on GitHub, and there are repositories for each of the Platine packages: @@ -21,8 +21,8 @@ The Platine source code is managed on GitHub, and there are repositories for eac - [Platine Container](https://github.com/platine-php/container) - [Platine Cookie](https://github.com/platine-php/cookie) - [Platine Database](https://github.com/platine-php/database) -- [Platine Docx template](https://github.com/platine-php/docx-template) -- [Platine Event dispatcher](https://github.com/platine-php/event-dispatcher) +- [Platine Docx Template](https://github.com/platine-php/docx-template) +- [Platine Event Dispatcher](https://github.com/platine-php/event-dispatcher) - [Platine Filesystem](https://github.com/platine-php/filesystem) - [Platine Framework](https://github.com/platine-php/framework) - [Platine HTTP](https://github.com/platine-php/http) @@ -32,14 +32,14 @@ The Platine source code is managed on GitHub, and there are repositories for eac - [Platine ORM](https://github.com/platine-php/orm) - [Platine Pagination](https://github.com/platine-php/pagination) - [Platine PDF](https://github.com/platine-php/pdf) -- [Platine Request handler](https://github.com/platine-php/request-handler) +- [Platine Request Handler](https://github.com/platine-php/request-handler) - [Platine Router](https://github.com/platine-php/router) - [Platine Security](https://github.com/platine-php/security) - [Platine Session](https://github.com/platine-php/session) -- [Platine Standard library](https://github.com/platine-php/stdlib) +- [Platine Standard Library](https://github.com/platine-php/stdlib) - [Platine Template](https://github.com/platine-php/template) - [Platine Upload](https://github.com/platine-php/upload) -- [Platine User agent](https://github.com/platine-php/user-agent) +- [Platine User Agent](https://github.com/platine-php/user-agent) - [Platine Validator](https://github.com/platine-php/validator) ## Support Questions @@ -52,7 +52,7 @@ Platine's GitHub issue trackers are not intended to provide Platine help or supp ## Core Development Discussion -You may propose new features or improvements of existing Platine behavior in the Platine framework repository's [GitHub discussion board](https://github.com/platine-php/app/discussions). If you propose a new feature, please be willing to implement at least some of the code that would be needed to complete the feature. +You may propose new features or improvements of existing Platine behavior in the Platine framework repository's [GitHub discussion board](https://github.com/platine-php/framework/discussions). If you propose a new feature, please be willing to implement at least some of the code that would be needed to complete the feature. Informal discussion regarding bugs, new features, and implementation of existing features takes place in the `#internals` channel of the [Platine Slack](https://platineframework.slack.com). Tony NGUEREZA, the maintainer of Platine, is typically present in the channel on weekdays from 8am-5pm (UTC+01:00 or Africa/Bangui), and sporadically present in the channel at other times. @@ -94,7 +94,7 @@ public function isLogged(int $id): bool } ``` -::: danger +::: warning Each PHP file must start with the declaration `declare(strict_types=1);` ::: diff --git a/src/general/container.md b/src/general/container.md index 06e5c54..1d67a33 100644 --- a/src/general/container.md +++ b/src/general/container.md @@ -160,9 +160,9 @@ $app->bind(ErrorHandlerInterface::class, function (ContainerInterface $app) { return new ErrorHandler($app->get(LoggerInterface::class)); }); ``` -!!! important - You need to bind classes into the container before use it. The container does not need to be instructed on how to build these objects if their dependencies are concrete, since it can automatically resolve these objects using reflection. - +::: warning +You need to bind classes into the container before use it. The container does not need to be instructed on how to build these objects if their dependencies are concrete, since it can automatically resolve these objects using reflection. +::: #### Binding A Singleton The `share` method binds a class or interface into the container that should only be resolved one time. Once a singleton binding is resolved, the same object instance will be returned on subsequent calls into the container: diff --git a/src/general/lifecycle.md b/src/general/lifecycle.md index 31235ee..b43b297 100644 --- a/src/general/lifecycle.md +++ b/src/general/lifecycle.md @@ -16,13 +16,13 @@ The goal of this document is to give you a good, high-level overview of how the The entry point for all requests to a Platine application is the `public/index.php` file. All requests are directed to this file by your web server (Apache / Nginx) configuration. The `index.php` file doesn't contain much code. Rather, it is a starting point for loading the rest of the framework. -The `index.php` file loads the Composer generated autoloader definition, and then create an instance of the Platine application from `Platine\Framework\App\Application`. The first action taken by Platine itself is to create an instance of the application / [container](container.md). +The `index.php` file loads the Composer generated autoloader definition, and then create an instance of the Platine application from `Platine\Framework\App\Application`. The first action taken by Platine itself is to create an instance of the application/[container](container.md). ### HTTP / Console Kernels Next, the incoming request is sent to either the HTTP kernel or the console kernel, depending on the type of request that is entering the application. These two kernels serve as the central location that all requests flow through. For now, let's just focus on the HTTP kernel, which is located in `Platine\Framework\Kernel\HttpKernel`. -The HTTP kernel extends the `Platine\Framework\Kernel\BaseKernel` class and implements ``Platine\Http\Handler\RequestHandlerInterface`, which contains the method `bootstrap` that will be run before the request is executed. The `bootstrap` method configure error handling, configure logging, detect the application environment, and perform other tasks that need to be done before the request is actually handled. Typically, these classes handle internal Platine configuration that you do not need to worry about. +The HTTP kernel extends the `Platine\Framework\Kernel\BaseKernel` class and implements `Platine\Http\Handler\RequestHandlerInterface`, which contains the method `bootstrap` that will be run before the request is executed. The `bootstrap` method configure error handling, configure logging, detect the application environment, and perform other tasks that need to be done before the request is actually handled. Typically, these classes handle internal Platine configuration that you do not need to worry about. The HTTP kernel also defines a list of HTTP [middleware](../overview/middleware.md) that all requests must pass through before being handled by the application. These middleware handle reading and writing the HTTP session, by verifying the CSRF token, and more. We'll talk more about these soon. diff --git a/src/general/providers.md b/src/general/providers.md index 0d73e10..557d40a 100644 --- a/src/general/providers.md +++ b/src/general/providers.md @@ -14,8 +14,9 @@ If you open the `config/providers.php` file included with Platine, you will see In this overview, you will learn how to write your own service providers and register them with your Platine application. -!!! tips - If you would like to learn more about how Platine handles requests and works internally, check out our documentation on the Platine [lifecycle](lifecycle.md). +::: tip Note +If you would like to learn more about how Platine handles requests and works internally, check out our documentation on the Platine [lifecycle](lifecycle.md). +::: ## Writing Service Providers @@ -39,7 +40,6 @@ public function register(): void ``` - This service provider only defines a `register` method, and uses that method to define an implementation of `Platine\Lang\Translator\TranslatorInterface` in the service container. If you're not yet familiar with Platine's service container, check out [its documentation](container.md). ### The Boot Method @@ -92,11 +92,31 @@ public function boot(): void $this->addCommand(MyCommand::class); } ``` -!!! important - The parameter should be the full class name that is binding to container or the class without constructor parameters that can be created using `new Mycommand()` +::: tip Important +The parameter should be the full class name that is binding to container or the class without constructor parameters that can be created using `new Mycommand()`. +::: For more details see [Console application](../advanced/console.md). +### The addTask Method + +If you want add tasks, this should be done using the `addTask ` method: + +```php +addTask(MyTask::class); +} +``` +::: tip Important +The parameter should be the full class name that is binding to container or the class without constructor parameters that can be created using `new MyTask()`. +::: + +For more details see [Console application](../advanced/console.md). ### The listen Method @@ -114,8 +134,9 @@ public function boot(): void ``` So when the event `MyEvent::class` is fired the listener `MyListener::class` will be called. -!!! important - If the listener parameter is a string this should be the full class name that is binding to container or the class without constructor parameters that can be created using `new MyListener()` +::: tip Important +If the listener parameter is a string this should be the full class name that is binding to container or the class without constructor parameters that can be created using `new MyListener()`. +::: See [Events](../advanced/events.md) for more details. diff --git a/src/getting-started/architecture.md b/src/getting-started/architecture.md index 103f612..07576fb 100644 --- a/src/getting-started/architecture.md +++ b/src/getting-started/architecture.md @@ -46,7 +46,7 @@ The `Console` directory contains all of the custom Platine commands for your app #### The Exception Directory -The `Exception` directory contains your application's exception and is also a good place to place any exceptions thrown by your application. In this directory you already have the application base exception class `Platine\App\Exception\ApplicationException`, it's recommended that all the application extend this base class. +The `Exception` directory contains your application's exception and is also a good place to place any exceptions thrown by your application. In this directory you already have the application base exception class `Platine\App\Exception\ApplicationException`, it's recommended that all the application Exception extend this base class. #### The Http Directory diff --git a/src/getting-started/configuration.md b/src/getting-started/configuration.md index 4917a00..b5eb2e6 100644 --- a/src/getting-started/configuration.md +++ b/src/getting-started/configuration.md @@ -20,9 +20,9 @@ Platine's default `.env` file contains some common configuration values that may If you are developing with a team, you may wish to continue including a `.env.example` file with your application. By putting placeholder values in the example configuration file, other developers on your team can clearly see which environment variables are needed to run your application. -!!! note - Any variable in your `.env` file can be overridden by external environment variables such as server-level or system-level environment variables. - +::: tip Note +Any variable in your `.env` file can be overridden by external environment variables such as server-level or system-level environment variables. +::: #### Environment File Security All variables in your `.env` files are typically parsed as strings, so some reserved values have been created to allow you to return a wider range of types from the `env()` helper function: @@ -108,8 +108,10 @@ The `debug` option in your `config/app.php` configuration file determines how mu For local development, you should set the `PL_APP_DEBUG` environment variable to `true`. **In your production environment, this value should always be `false`. If the variable is set to `true` in production, you risk exposing sensitive configuration values to your application's end users.** -!!! tips - `Platine\Config\Config` implements `ArrayAccess` so you can easily access or set the configuration values using array direct access, see example below: +::: tip Note +`Platine\Config\Config` implements `ArrayAccess` so you can easily access or set the configuration values using array direct access. +::: +See example below: ```php