A lightweight, framework-independent PHP library with a practical set of tools for building predictable and maintainable applications.

Eleanor PHP Library does not dictate application architecture or replace PHP with its own abstraction layer. It provides ready-to-use core tools while keeping the project structure under the developer's control.

Core principles

  • No mandatory installation. The library can simply be copied into a project and included. Composer installation is supported, but not required.
  • Framework independence. There is no mandatory router, dependency injection container, hidden application lifecycle, or other infrastructure that dictates how the project must be structured.
  • Shared hosting friendly. The library does not require containers, daemon processes, privileged server access, or special environment configuration.
  • Transparent architecture. The library complements PHP instead of trying to replace it with its own development model. The resulting code remains ordinary PHP with predictable behavior.
  • Delayed object creation. Resource-heavy objects can be initialized only when actually needed. For example, a MySQL connection is not established until the database is first accessed.

Built-in tools

  • Template engine. Built-in HTML rendering without requiring a third-party template engine.
  • Caching. Several cache storage mechanisms exposed through a common interface.
  • MySQL support. A dedicated MySQL wrapper with prepared statements and other common database operations.
  • Localization. Built-in tools for multilingual applications.
  • Structured error logging. Repeated errors are grouped together, while older logs are archived automatically.
  • Autoloading. Classes, interfaces, traits, and enums can be loaded automatically when placed in the corresponding directory structure.
  • Command-line support. The library includes a CLI class for terminal output and interaction.
  • TOTP. Built-in generation and verification of time-based one-time passwords compatible with standard authenticator applications.

Usage

  • The minimum supported version is PHP 8.5.
  • The library can be included directly or installed through Composer:
    composer require sunvas/eleanor-php-library

Usage examples are available in a separate GitHub repository.

Eleanor PHP Library is a toolbox, not a framework. It helps reduce boilerplate without taking control away from the application.