Download the PHP package sailantis/clarity-engine without Composer

On this page you can find all versions of the php package sailantis/clarity-engine. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package clarity-engine

A fast, secure, and expressive PHP template engine – Maximum performance, whether sandboxed and secure or with the full power of PHP.


Features


Installation

Requirements: PHP 8.2 or higher


Quick Start

Basic Setup

Your First Template

views/welcome.clarity.html:

That's it! Clarity automatically compiles and caches your template.

What a Template May Reach

Every template compiles under a policy: a set of capabilities plus two allowlists. The default is the most restrictive one, and the syntax is the same in all of them — only what a template may reach changes:

Policy::open() is the full-power PHP mode and is equivalent to executing arbitrary PHP. A Policy::custom() grant is a real grant too — see the security model and the policy reference.


Documentation

For Template Authors

Start here if you're writing templates:

For Developers

Integration and advanced topics:

Reference


Output & Variables

Control Flow

Macros

Filters

Common filters: upper, lower, trim, length, number, date, sprintf, json, join, split, slug, map, filter, reduce, default, empty, striptags, escape, raw

See all filters and detailed syntax →

Template Inheritance

Includes

Full syntax reference →


Configuration

Configure the engine with these methods:

Configuration guide →


Security

Clarity is sandboxed by default:

Policies

What a template may reach is decided by a policy — a set of capabilities plus two allowlists, all resolved at compile time. The default is sandboxed and unreachable from PHP:

A policy that grants rawPhp, phpVariables or methodCalls is equivalent to executing arbitrary PHP and disables every guarantee listed above. Use it only for templates written and reviewed by trusted authors.

Templates record a digest of the policy that compiled them and are recompiled automatically when it changes — including when a single allowlist entry is added or removed. denyFunctions() adds guardrails on top of an open policy; nothing is denied by default, because an open policy is already the security decision.

The policy reference → Security best practices →


Performance

Clarity is designed for speed. Templates compile to native PHP classes and leverage OPcache for optimal performance:

Benchmark Results

Clarity is measured against the other mainstream PHP template engines rendering the same page, on the same machine and PHP build. The two charts below are generated from the benchmark.

The dot is the median render and the caps bound the fastest observation and p95, so an engine that is usually fast but occasionally slow looks different from one that is uniformly slower.

Measured in a fresh process per engine, so no engine inherits another's footprint. The bar runs from the floor that engine costs to have loaded (left cap) to the peak it reached (right cap), and the dot is what it still holds once the run is done — the figure a serving process actually carries.

The full comparison — every shape, every chart, and the environment and engine versions this run recorded — is in the benchmark report, with the public version of the same data at https://sailantis.github.io/azera-competition/benchmarks/view-engine.html.

Performance optimization guide →


Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Running Tests

Or run PHPUnit directly:


License

This project is licensed under the MIT License - see the LICENSE file for details.


Links


Built with ❤️ for developers who value security and performance


All versions of clarity-engine with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-mbstring Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sailantis/clarity-engine contains the following files

Loading the files please wait ...