An open API service indexing awesome lists of open source software.

https://github.com/danielhe4rt/yet-another-php-psr4-project

YET Another PHP PSR4 Class in my livestream please subscribe to twitch.tv/danielhe4rt
https://github.com/danielhe4rt/yet-another-php-psr4-project

Last synced: about 1 year ago
JSON representation

YET Another PHP PSR4 Class in my livestream please subscribe to twitch.tv/danielhe4rt

Awesome Lists containing this project

README

          

# PHP PSR4 Project

![Project Thumbnail](/.github/logo.png)

This is a simple PHP project that uses the PSR4 autoloading standard building a Routing System.

Please take a look at the [PSR4 Autoloading Standard](https://www.php-fig.org/psr/psr-4/). and
the [PSR12 Coding Standard](https://www.php-fig.org/psr/psr-12/).

## Dependencies

- PHP 8.2^
- Composer

## Database

```sql
CREATE DATABASE dev_aulinhas;

use dev_aulinhas;

CREATE TABLE posts
(
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
title varchar(255) NOT NULL,
slug varchar(255) NOT NULL,
content LONGTEXT NOT NULL,
published_at timestamp
);
```

## Installation

```bash
git clone https://github.com/DanielHe4rt/yet-another-php-psr4-project.git yet-another-psr4
cd yet-another-psr4
composer install
```

## Run

```bash
php -S localhost:8000
```

* Access `http://localhost:8000` in your browser.
* Routes:
* `/` - Home
* `/posts/{category}/{postSlug}` - get post based on category and slug
* `/404` - Not Found