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
- Host: GitHub
- URL: https://github.com/danielhe4rt/yet-another-php-psr4-project
- Owner: danielhe4rt
- Created: 2024-07-16T16:40:31.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-16T16:49:49.000Z (almost 2 years ago)
- Last Synced: 2025-03-25T02:09:33.204Z (about 1 year ago)
- Language: PHP
- Size: 65.4 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PHP PSR4 Project

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