commit e672216b8af3d487024bd0e8652c3d57e5ce206a Author: Egor Isaev Date: Mon Apr 27 15:28:15 2026 +0300 Initial commit: entry point and project structure Co-Authored-By: Claude Sonnet 4.6 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..90e7ab5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +vendor/ +.env +.mcp.json +storage/logs/*.log +storage/cache/* +*.DS_Store diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..93ee269 --- /dev/null +++ b/.htaccess @@ -0,0 +1,6 @@ +Options -Indexes + +RewriteEngine On +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule ^ index.php [L] diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..28d55a5 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,61 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project + +**Bicycle** — самописный PHP-фреймворк, разрабатываемый с нуля. Проект находится в стадии начальной разработки. + +## Предполагаемая архитектура + +Фреймворк строится по принципу **MVC + Service Container**: + +- `System/Core/` — ядро: Application, загрузка конфига, бутстрап +- `System/Http/` — Request, Response, обработка HTTP-цикла +- `System/Router/` — маршрутизация (регистрация роутов, диспатчинг) +- `System/Container/` — DI-контейнер (bind/make/singleton) +- `System/Middleware/` — цепочка middleware (Pipeline) +- `System/View/` — шаблонизатор +- `System/Database/` — QueryBuilder / ORM +- `System/Console/` — CLI-команды +- `System/Exceptions/` — обработчики ошибок +- `config/` — конфигурационные файлы (.php массивы) +- `index.php` — точка входа +- `bin/bicycle` — CLI-точка входа + +## Когда структура будет создана + +### Установка зависимостей +```bash +composer install +``` + +### Запуск встроенного сервера +```bash +php -S localhost:8000 -t public +``` + +### Запуск тестов +```bash +./vendor/bin/phpunit +# один тест: +./vendor/bin/phpunit tests/Unit/RouterTest.php +``` + +### Линтер / статический анализ +```bash +./vendor/bin/phpcs --standard=PSR12 src/ +./vendor/bin/phpstan analyse src --level=5 +``` + +### CLI фреймворка +```bash +php bin/bicycle +``` + +## Соглашения + +- PHP 8.1+, строгая типизация (`declare(strict_types=1)`) +- Стандарт кода — PSR-12 +- Пространство имён корня: `Bicycle\` +- Автозагрузка через Composer PSR-4: `"Bicycle\\": "src/"` \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..02f0ebe --- /dev/null +++ b/index.php @@ -0,0 +1,10 @@ +run();