This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
YesWiki is a PHP collaborative wiki platform with AGPL-3.0 license. It uses Symfony 5.x components (DependencyInjection, Routing, HttpKernel, Security, Console, EventDispatcher) with Twig templating and Vue 3.5 for interactive frontend components.
Requirements: PHP 7.3+ (up to 8.4), MySQL 8+/MariaDB
# Install dependencies
make install # Both composer and yarn
composer install # PHP dependencies only
yarn install # Node.js dependencies only
# Linting (run before committing)
make lint # All linters
make lint-php # PHP-CS-Fixer (PSR-12 + Symfony)
make lint-js # ESLint
make lint-other # Prettier (CSS, JSON, YAML, MD)
# Testing
make test # All unit tests
./vendor/bin/phpunit --stderr tests # Core tests
./vendor/bin/phpunit --stderr tests/path/to/TestFile.php # Single test file
./vendor/bin/phpunit --stderr --filter testMethodName tests # Single test method
# Docker development (recommended)
cd docker && docker compose up # Start dev environment
docker compose exec yeswiki-app composer install # Update PHP deps in containerDocker services: localhost:8085 (app), localhost:8086 (phpMyAdmin), localhost:1080 (mailcatcher)
index.php → YesWikiLoader → Wiki class → Symfony routing → Controller dispatch
includes/
├── YesWiki.php # Main Wiki class (~2100 lines)
├── YesWikiInit.php # Initialization, routing, DI setup
├── services/ # 29 core services (PageManager, UserManager, AclService, DbService, etc.)
├── controllers/ # 10 controllers (ApiController, AuthController, PageController, etc.)
├── commands/ # CLI commands (yeswicli)
└── migrations/ # Database migrations (timestamp-based)
handlers/ # Page request handlers (show, edit, delete, revisions)
actions/ # Wiki action markup (37+ actions)
formatters/ # Text formatters (wakka, code, action, raw)
tools/ # Extensions (bazar, contact, login, security, tags, etc.)
templates/ # Twig templates
javascripts/ # Frontend JS/Vue code
Each tool can contain: controllers/, services/, handlers/, actions/, fields/, migrations/, lang/, templates/, config.yaml
Extensions are loaded dynamically and registered in the DI container. Custom tools go in custom/tools/ to survive updates.
PageManager- Page CRUD & versioningUserManager- Authentication & user managementAclService- Access control listsDbService- Database abstractionTemplateEngine- Twig renderingPerformer- Action/formatter executionAssetsManager- CSS/JS asset management
- Vue 3.5 components in
javascripts/ - Global variables:
wiki,Vue,_t(translations),toastMessage - Bootstrap 3, jQuery 3.5, Leaflet for maps
PHPUnit tests mirror source structure:
tests/includes/for coretests/tools/{toolname}/for extensions
Test base class: YesWiki\Test\Core\YesWikiTestCase
- Use
$this->getWiki()to get a Wiki instance in tests
E2E tests (Playwright) in tests/e2e/ - run via Docker test compose file.
PHP: PSR-12 + Symfony conventions via php-cs-fixer
- Short array syntax, single quotes, no Yoda conditions
- Post-increment style, trailing commas in multiline arrays
JavaScript: ESLint with Airbnb base
- No semicolons, single quotes, no trailing commas
- Max line length: 104 characters
- File extensions required in imports
MySQL with timestamp-based migrations in includes/migrations/ and tools/*/migrations/. Uses prepared statements for SQL injection prevention.
wakka.config.php- Main config (generated on install)includes/services.yaml- Symfony DI container configtools/*/config.yaml- Extension service configs