Skip to content

Commit

Permalink
Update docs to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
kpicaza committed Jul 3, 2023
1 parent f7d2ee9 commit 956900b
Show file tree
Hide file tree
Showing 12 changed files with 1,018 additions and 976 deletions.
82 changes: 56 additions & 26 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,69 @@
# Antidot Framework

A PHP full featured micro-framework designed to allow you to write 100% framework agnostic code.

## Key Features

* **Preconfigured Coding Style**: [Psr-1](https://www.php-fig.org/psr/psr-1) and [Psr-2](https://www.php-fig.org/psr/psr-2) code sniffer to help to respect standard
* **Logger**: [Psr-3](https://www.php-fig.org/psr/psr-3) implementation by [wshafer/monolog](https://github.com/wshafer/psr11-monolog)
* **Auto-loading**: [Psr-4](https://www.php-fig.org/psr/psr-4) Namespaces auto-loading
* **Request Response Lifecycle**: [Psr-7](https://www.php-fig.org/psr/psr-7) Request and responses using [Laminas Diactoros](https://docs.laminas.dev/laminas-diactoros/)
* **Auto-wired Dependency injection**: [Psr-11](https://www.php-fig.org/psr/psr-11) Auto-wired dependency injection container
* **Event Dispatcher**: [Psr-14](https://www.php-fig.org/psr/psr-14) Event dispatching system
* **Request pipeline**: [Psr-15](https://www.php-fig.org/psr/psr-15) Request handler and Middleware
* **Pipeline based router**: Intuitive to use route system
* **Different Config Translators**: [Laminas config](https://docs.laminas.dev/laminas-config/) style or [Symfony](https://symfony.com/doc/current/best_practices/configuration.html) style
* **Cli**: Ready to use Console Line Tool on top of [Symfony Console Tool](https://symfony.com/doc/current/components/console.html)
The Antidot PHP Framework offers a range of powerful features that make it a versatile choice for
building web applications. Some of the key features include:

### Dependency Injection Container

## Quick Start
Antidot utilizes the Antidot Container, which is a powerful dependency injection container.
It provides a way to manage and configure dependencies within your application, promoting
modularity and testability. With the container, you can easily define and resolve dependencies
across your application.

### Middleware Stack

Antidot supports a flexible middleware stack, allowing you to define and execute middleware
components in a specific order. Middleware provides a convenient way to intercept and modify
HTTP requests and responses, enabling functionalities such as authentication, logging, error
handling, and more. Antidot makes it easy to integrate and chain multiple middleware components
to process requests and generate responses.

### Routing and Controllers

Antidot provides a robust routing system based on the popular nikic/fast-route package. With
Antidot's fluent interface, you can define routes and bind them to controllers or request
handlers. This allows you to map incoming HTTP requests to specific actions in your application.
Controllers or request handlers implement the `Psr\Http\Server\RequestHandlerInterface`,
enabling you to handle requests and return responses in a standardized way.

### Error Handling

```bash
composer create-project antidot-fw/antidot-framework-starter project-name
cd project-name
bin/console
php -S 127.0.0.1:8000 ./public
```
Antidot offers comprehensive error handling capabilities. You can configure error handlers to
catch and process exceptions thrown during the execution of your application. This allows you
to handle errors gracefully and provide appropriate responses to clients. Antidot supports
custom error handlers, allowing you to define how different types of errors are handled based
on your application's requirements.

Or you can try ReactPHP version
### Testing

```bash
composer create-project antidot-fw/reactive-starter project-name
cd project-name
bin/console
php public/index.php # Creates server on 127.0.0.1:8000
```
Antidot emphasizes the importance of testing by providing built-in testing tools and utilities.
You can write unit tests for your application's components, including middleware, controllers,
and services. Antidot integrates well with popular testing frameworks like PHPUnit, allowing
you to easily set up and execute tests to verify the correctness of your code.

### ReactPHP Server with Synchronous API

One of the standout features of Antidot is its integration with ReactPHP, a powerful event-driven,
non-blocking I/O library for PHP. Antidot leverages ReactPHP to provide a high-performance,
asynchronous web server. Additionally, Antidot extends ReactPHP to support a synchronous API,
allowing developers to write code in a synchronous style without dealing with promises.
This feature provides a familiar programming experience while taking advantage of ReactPHP's
performance benefits.

### And More...

Antidot PHP Framework also offers a range of other features, including environment-specific
configuration, PSR-7 integration, PSR-15 middleware compatibility, extensibility through service
providers, and a vibrant community that actively contributes to the framework's development
and improvement.

---

## Quick Start

> Se the [Getting Started Guide](/framework/getting-started)
## Special thanks & Sponsors

Expand Down
2 changes: 0 additions & 2 deletions docs/framework/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
* **Docs**
* [Getting Started](/framework/getting-started.md "Getting started guide for Antidot Framework")
* [Running Application](/framework/running-application.md "Running guide for Antidot Framework")
* [Routing](/framework/routing.md)
* [Templating](/framework/templating.md)
* [Persistence Layer](/framework/persitence.md)
* [Dependency Injection](/framework/dependency-injection.md)
* [Logger](/framework/logger.md)
* [Event System](/framework/event-system.md)
* [Queues](/framework/queues.md)
* [Console Line Tool](/framework/console-line-tool.md)
Expand Down
52 changes: 0 additions & 52 deletions docs/framework/console-line-tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,56 +144,6 @@ final class SomeCommand extends Command

## Config

<!-- tabs:start -->

### ** Symfony style yaml **

````yaml
# config/autoload/dependencies.{prod,local,dev}.yaml
services:
App\Application\EventListener\SomeCommand:
tags:
- { name: 'console.command', command: 'some:command:name' }
````

### ** Zend style yaml **

````yaml
# config/autoload/dependencies.{prod,local,dev}.yaml
console:
commands:
'some:command:name': App\Application\EventListener\SomeCommand
dependencies:
invokables:
App\Application\EventListener\SomeCommand: App\Application\EventListener\SomeCommand

````

### ** Symfony style php **

````php
<?php
// config/autoload/dependencies.{prod,dev,local}.php

declare(strict_types=1);

return [
'services' => [
App\Application\EventListener\SomeCommand::class => [
'class' => App\Application\EventListener\SomeCommand::class,
'tags' => [
[
'name' => 'console.command',
'command' => App\Application\EventListener\SomeCommand::NAME
]
]
]
]
];
````

### ** Zend style php **

````php
<?php
// config/autoload/dependencies.{prod,dev,local}.php
Expand All @@ -215,5 +165,3 @@ return [
]
];
````

<!-- tabs:end -->
Loading

0 comments on commit 956900b

Please sign in to comment.