Download the PHP package actra/yuf without Composer
On this page you can find all versions of the php package actra/yuf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package yuf
Short Description yuf (pronounced "[jʌf]" or "[jʊf]") - A smart, fast and lightweight php framework with zero dependencies.
License MIT
Homepage https://github.com/Actra-AG/yuf
Informations about the package yuf
yuf - A Smart, Fast, and Lightweight PHP Framework
yuf (pronounced "[jʌf]" or "[jʊf]") is a smart, fast, and lightweight PHP framework designed with a focus on
simplicity and performance. It has zero external dependencies, other than the actra/autoloader library which is
required for all setups.
Key Features
- Extremely Lightweight: Minimal overhead and fast execution.
- Zero Dependencies: Core framework functions without heavy external libraries.
- Composer Ready: Easy installation via Packagist.
- Standalone Support: Works perfectly without Composer.
- Forced Autoloading: Always uses the specialized
actra/autoloaderfor maximum performance and control. - Built-in Security: Includes features like CSP (Content Security Policy) nonce support.
- Authentication Helpers: Supports access rights, password login handling, and optional per-user IP whitelists.
Requirements
- PHP 8.5 or higher
- Common PHP extensions:
mbstring,openssl,pdo,intl,bcmath,simplexml,dom,iconv,curl,libxml,ctype
Installation
Install yuf and actra/autoloader via Composer or download them manually. Note that yuf always requires
actra/autoloader to be manually initialized.
Via Composer (Recommended)
Manual Installation
- Download the source code from GitHub.
- Download
actra/autoloader(https://github.com/Actra-AG/autoloader) and place it in your project. - Reference the
Autoloader.phpwhen initializing theCoreclass.
Quick Start
- Create a
.env.phpfile based on.env.example.php. - Create an
index.phpin your document root based onindex.example.php. - Initialize the Framework Core and provide the path to
Autoloader.phpif not using the default.
Database Query Helpers
DbQuery can be created from an SQL query and extended dynamically before execution.
addJoinPart() appends joins between the FROM and WHERE parts and accepts parameters in the same way as
addWherePart(). Every added part must contain exactly one parameter per ? placeholder, and each condition added with
addWherePart() is wrapped in parentheses before the conditions are combined with AND.
addOrderPart() only accepts columns consisting of letters, digits, _, . and backticks, because an order column
cannot be bound as a ? placeholder. Never pass a user-controlled value which was not checked against your own
whitelist of sortable columns.
addOrderPart() without parameters accepts column names only (one or several, separated by a comma), which are
validated and escaped because they cannot be bound as parameters. As soon as parameters are given, the first argument
is an SQL expression instead, e.g., to sort by the relevance of a fulltext search:
Such an expression is taken over unchanged and must therefore never contain user input; its values belong into
parameters. It must not end with ASC or DESC, because the sort direction is added according to ascending.
clearOrderParts() removes all sorting that has been added so far.
The query passed to createFromSqlQuery() must consist of SELECT, FROM, optional joins and an optional WHERE
only. GROUP BY, HAVING, ORDER BY, LIMIT and UNION are rejected, because sorting and paging are added by
DbQuery itself (addOrderPart() and the offset/row count of selectFromDb()).
REST/API Endpoints
yuf includes lightweight helpers for building REST-style endpoints without adding external dependencies.
Useful backend/API features include:
HttpRequest::getRequestMethod()returns a typedRequestMethodEnum.BaseView::getJsonRequestBody()reads and validates JSON request bodies.JsonRequestBodyprovides typed accessors for required and optional string, integer, float, and array values.BaseView::setSuccessResponseContent()creates standardized success responses.BaseView::setErrorResponseContent()creates standardized error responses and can set the HTTP status code.
JSON success responses use this structure:
JSON error responses use this structure:
Optional additional response data is returned in a top-level data property.
Template Tags
yuf templates support custom tags for common rendering logic.
Conditional snippet rendering
The tst:if tag can check whether a snippet file exists in the configured snippets directory by using
compare="hasSnippet".
The value of against is resolved relative to Core::get()->snippetsDirectory.
Documentation
For more detailed examples, please refer to:
.env.example.php: Configuration examples.index.example.php: Full usage example with manual autoloader initialization.- UPGRADE.md: Guide for developers updating to or working with new versions.
License
This project is licensed under the MIT License. See the LICENSE file for details.
© 2026 Actra AG
All versions of yuf with dependencies
ext-mbstring Version *
ext-openssl Version *
ext-pdo Version *
ext-intl Version *
ext-bcmath Version *
ext-simplexml Version *
ext-dom Version *
ext-iconv Version *
ext-curl Version *
actra/autoloader Version *
ext-libxml Version *
ext-ctype Version *