Download the PHP package luwes/wesc without Composer

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

wesc (PHP)

PHP extension bindings for wesc's streaming HTML/web-component bundler. The Rust core runs in-process — no subprocess, no WASM — so you can build and server-render web components straight from a PHP backend (plain PHP, Laravel, Symfony, Slim, the built-in dev server, …).

The extension targets PHP 8.1+ (non-thread-safe builds).

Install

The recommended way to install is with PIE, the official PHP extension installer (the successor to PECL). PIE downloads a prebuilt binary matching your PHP version and platform from GitHub releases — no Rust toolchain or compilation required:

Prebuilt binaries are published for PHP 8.1–8.4 (NTS) on:

OS Architectures
Linux (glibc) x86_64, arm64
macOS arm64, x86_64

The extension registers itself as wesc_php; PIE enables it for you. On a platform without a prebuilt binary, build from source.

ZTS (thread-safe) PHP is not supported: the bundler keeps a process-global file/template cache, so builds must be serialized within a process.

Usage

API

Argument Type Notes
input string[] First entry is the host document.
callback callable wesc_build_stream only. Gets each string chunk, then null at end-of-stream.
outcss ?string Path to write the bundled CSS file. '' returns the CSS in memory only (no file).
outjs ?string Path to write the bundled JS file. '' returns the JS in memory only (no file).
minify bool Minify generated assets. Defaults to false.

All trailing arguments are optional and support PHP 8 named arguments, e.g. wesc_build(['./index.html'], minify: true).

If the wesc_build_stream callback throws, the exception propagates out unchanged and the build stops.

The bundler keeps a process-global file/template cache, so builds should not run concurrently within a single process — serialize them (the examples/php-server demo does exactly this).

Building from source

This is an ext-php-rs project. It compiles to a native PHP extension (a cdylib).

Prerequisites:

Build the extension:

The artifact is named per platform:

Platform File
Linux libwesc_php.so
macOS libwesc_php.dylib
Windows wesc_php.dll

Load it with PHP via the extension ini directive — either on the command line or in your php.ini:

cargo php (cargo install cargo-php) can also build IDE stubs and install the extension into your active PHP automatically:

A hand-maintained stub for IDEs lives in stubs/wesc.php.

See the repo README's PHP section for the broader project and crates/wesc-php/src/lib.rs for the binding source.


All versions of wesc with dependencies

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

Loading the files please wait ...