Symfony HttpFoundation is a production-grade PHP library that implements an object-oriented layer for the HTTP specification. It provides the core abstractions for HTTP request/response handling, including Request, Response, RedirectResponse, JsonResponse, StreamedResponse, BinaryFileResponse, and EventStreamResponse. It also covers header and parameter containers, cookie parsing and serialization, file uploads, session management with multiple storage backends, IP validation and anonymization, content negotiation, request matchers, URI signing, rate limiting, and streaming JSON output. This is not an application or service; it is a library component consumed by the Symfony framework and standalone PHP projects, with no executable entry points or web endpoints. Architecturally, the code is organized around small, focused classes with clear separation of concerns: bag containers for parameters/headers, decorators and proxies for session handlers, immutable-ish value objects like Cookie, and static utility classes such as IpUtils and HeaderUtils. The component relies on modern PHP (>=8.4.1), optional integrations with Redis, Memcached, MongoDB, PDO/Doctrine DBAL, and Symfony Cache/Mime contracts. The test suite is extensive, covering both unit behavior and real HTTP functional scenarios against PHP's built-in server. The library demonstrates strong craftsmanship: type-safe getters, fluent builders, robust RFC-aware parsing utilities, and consistent deprecation policies. The most reusable pieces are self-contained utilities and value objects that can be extracted into other projects with minimal modification. Maintenance is active, with recent commits and a clear 8.2 branch; technical drift is low despite the long history because deprecations are systematically managed and PHP/Symfony versions are current.
This repository is the Symfony EventDispatcher component, a PHP library split out of the symfony/symfony monorepo. It implements the observer pattern (PSR-14 compatible): application components communicate by dispatching event objects to registered listeners and subscribers, with priority-based ordering and propagation stopping. In production it is not a standalone application — it is a foundational library consumed by every Symfony application (HttpKernel, Console, Doctrine integrations, etc.) and usable standalone via Composer. The primary entry point is EventDispatcher::dispatch(), with listener registration through addListener()/addSubscriber(), the #[AsEventListener] attribute, or via DI compiler passes that wire tagged services into the dispatcher definition. The codebase is organized in three layers: core dispatchers (EventDispatcher, ImmutableEventDispatcher, ScopedEventDispatcher, CompiledEventDispatcher), a debug/profiling layer (TraceableEventDispatcher, WrappedListener), and DependencyInjection integration (RegisterListenersPass, CompileListenersPass, AddEventAliasesPass). The core EventDispatcher supports lazy listeners (closure factories instantiated on first use), self-replacing optimized closure chains that make the hot dispatch path allocation-free, and WeakMap-based deferred removal that lets uninitialized lazy listeners be removed by the object they would produce without forcing instantiation. The 8.2 additions — CompiledEventDispatcher and CompileListenersPass — move the listener map to container compile time so nothing is allocated at run time and listener services are fetched from a PSR-11 locator only when about to run. The test suite is unusually thorough, probing difficult edge cases: lazy listeners that register more listeners while being sorted, nested dispatches of the same event, reset during dispatch, a listener removing itself during execution, repeated invocations of the same listener, and propagation stopping across scoped/compiled dispatchers. ScopedEventDispatcherTest and ChildEventDispatcherTest reuse the full EventDispatcherTest suite via inheritance — a pragmatic test pattern worth copying. Maintenance is active (Symfony 8.2 branch, zero open issues); the code targets PHP 8.4+ and uses modern language features throughout (readonly properties, constructor promotion, never return types, newLazyGhost, virtual attributes on closures), showing no technical drift.
Symfony Finder is a mature PHP library that locates files and directories through a fluent, rules-based API. The implementation is not a monolithic filesystem walker but a composition of small SPL iterator decorators: Finder::getIterator() builds a pipeline containing RecursiveDirectoryIterator, ExcludeDirectoryFilterIterator, depth/type/name/content/size/date filters, custom callbacks, and optional gitignore filtering. Multiple search roots are merged lazily through AppendIterator, and sorting is applied only when requested via SortableIterator. The library also exposes standalone, dependency-free pattern compilers, Glob::toRegex() and Gitignore::toRegex(), which translate glob and gitignore syntax into PCRE strings.
The Symfony TypeInfo component is a PHP library for extracting and representing PHP type information. It provides a rich type system that can resolve types from reflection objects, PHP doc comments, raw type strings, and values. The architecture cleanly separates type representation (Type classes), type resolution (Resolver classes), and contextual information (TypeContext). Key features include sophisticated type inference from values, support for complex type constructs (unions, intersections, generics), and integration with PHP doc block templates and type aliases.
Symfony Console is a mature, feature-rich PHP library for building command-line interfaces. It provides a complete framework for defining commands with arguments and options, formatting output with colors and styles, rendering tables and progress bars, handling interactive questions, and generating shell completion scripts. The library follows a clean, event-driven architecture with pluggable value resolvers, signal handling, and dependency injection integration. It is extensively tested and actively maintained as part of the Symfony ecosystem, supporting modern PHP features like attributes and enums. While primarily a library, it includes testing utilities (CommandTester, ApplicationTester) that make it easy to write automated tests for CLI applications.
The Symfony Filesystem component is a standalone PHP library (published on Packagist as symfony/filesystem) providing two primary utilities: the Filesystem class for filesystem operations — copy, mkdir, touch, remove, chmod/chown/chgrp, rename, symlink/hardlink, readlink, directory mirroring, tempnam, atomic dumpFile, appendToFile, and readFile — and the Path class for cross-platform path string manipulation: canonicalize, normalize, join, makeAbsolute/makeRelative, getLongestCommonBasePath, isBasePath, root/directory/extension extraction, and home-directory expansion. It targets PHP >= 8.4 and depends only on Symfony's deprecation-contracts plus ctype/mbstring polyfills, so it runs in any PHP project without framework baggage, with a small focused exception hierarchy (IOException, FileNotFoundException, InvalidArgumentException, RuntimeException). The craftsmanship lives in the details. dumpFile() writes via a private temporary file and an atomic rename, preserving existing file permissions and following symlinks to their real target; tempnam() uses fopen mode 'x+' to atomically check-and-create (eliminating TOCTOU races), forces umask(0o077) for secure default permissions, retries on collision, and supports stream wrappers like gs:// and file://. All native filesystem calls are routed through a box() wrapper that converts PHP warnings into structured IOException exceptions carrying the offending path. Path.php handles genuinely hard cases — Windows drive letters and the 'C:' special case, phar:// and other stream schemes, dot-segment collapse that preserves leading '..' on relative paths, and dotfile names when the base path is root — with a bounded memoization buffer to keep canonicalization fast. The architecture is deliberately minimal: no container, no services, no event system — just two well-factored classes backed by an exhaustive test suite. PathTest alone contains hundreds of data-provider cases covering UNIX, Windows, and stream-wrapper variants of every operation, and FilesystemTest exercises real filesystem behavior including permission edge cases, symlink privilege failures, read-only directories, and PHP bug workarounds. The component is the 8.2 development branch of Symfony, actively maintained with current dependency requirements and zero notable technical drift.
This is the Symfony HttpKernel component, a PHP library that provides the core request-to-response pipeline for the Symfony framework. It implements an event-driven architecture where the kernel dispatches events (REQUEST, CONTROLLER, CONTROLLER_ARGUMENTS, VIEW, RESPONSE, EXCEPTION, FINISH_REQUEST, TERMINATE) that listeners can modify. The library includes controller resolution, argument injection via a chain of value resolvers, HTTP caching (reverse proxy with ESI/SSI support), profiling and debugging infrastructure, rate limiting, locking, serialization, and attribute-based configuration. It is not a standalone application but a library used by Symfony applications and any PHP project needing a robust HTTP kernel.
This is the Symfony Security Core component, a pure PHP library providing a generic, extensible authorization and authentication framework. It is infrastructure code, not an application – it defines interfaces and implementations for token storage, access decision making (with pluggable voters and strategies), role hierarchies, user providers and checkers, signature hashing for secure links, and validation constraints. The architecture relies heavily on design patterns: Strategy (access decision strategies), Chain of Responsibility (user providers/checkers), Decorator (traceable managers, usage tracking token storage), and Template Method (abstract Voter class). It is well-typed with PHP 8.4 features and includes extensive unit tests. The repository also bundles 50+ locale translations for security-related exception messages. It is a mature, actively maintained component that forms the security foundation for Symfony applications.