Download the PHP package barefootjs/php without Composer

On this page you can find all versions of the php package barefootjs/php. 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 php

@barefootjs/php

The engine-agnostic PHP runtime for BarefootJS — the BarefootJS class (BarefootJS.php) that compiled marked templates call as the bf object (bf.json(...), bf.spread_attrs(...), the array/string method helpers, hydration markers, child-component rendering).

This package has no dependencies beyond core PHP (>=8.2). Everything that depends on how a template is rendered — JSON marshalling, raw-string marking, JSX-children materialisation, named-template rendering, and template-variable-name mangling — is delegated to a pluggable backend, so the same runtime can drive any PHP template engine (Twig, Blade, ...).

Backend contract

A backend implements five methods:

Method Purpose
encode_json($data) JSON-encode a value (injectable; defaults to Barefoot\Json::canonicalEncode)
mark_raw($str) Mark a string so the engine emits it without re-escaping
materialize($value) Resolve a captured-children value to a string
render_named($name, $bf, $vars) Render a named template with $bf bound
ident($name) Mangle a template-variable name for this engine's reserved-word set

Inject a backend with new BarefootJS($c, ['backend' => $backend]).

Reference implementation

@barefootjs/twig provides Barefoot\TwigBackend (targeting twig/twig) plus the compile-time adapter that emits Twig templates (.twig).

Composer

The Packagist distribution name is barefootjs/php. The npm package ships the same src/ so the monorepo integrations can consume it without a separate install.

This package is maintained in the BarefootJS monorepo and is mirrored to a Packagist-facing repository only for Composer distribution.

Do not send implementation pull requests to the Packagist mirror. Send changes to the monorepo path above; the release workflow splits this directory and pushes the mirror automatically.

Tests

Zero-dependency, PHPUnit-free TAP-ish harness (tests/_harness.php). Every test_*.php file is also independently runnable via php tests/test_foo.php. Includes the golden helper-vector (test_helper_vectors.php) and ParsedExpr-evaluator (test_eval_vectors.php) conformance suites — see spec/template-helpers.md.


All versions of php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
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 barefootjs/php contains the following files

Loading the files please wait ...