Download the PHP package themehybrid/hybrid-assets without Composer

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

Hybrid Assets

Asset (CSS/JS etc.) resolution for Hybrid Core.

Hybrid Assets gives themes and plugins a single, consistent API for resolving asset URLs, filesystem paths, dependencies, and cache-busting versions — with automatic support for child-theme overrides, wp-scripts .asset.php metadata, and Laravel Mix manifests.

Why

WordPress asset registration usually means hardcoding URLs, manually tracking filemtime() for cache busting, and writing bespoke logic every time a child theme needs to override a parent theme or plugin asset. Hybrid Assets handles all of that:

Requirements

Installation

Register the service provider on your container:

This binds ParentTheme and ChildTheme as singletons, and Plugin as a fresh (non-shared) binding — each plugin carries its own config (plugin file, override directory, manifest settings), so instances can't be shared between consumers.

Setting up a resolver

AssetsServiceProvider registers the underlying ParentTheme / ChildTheme / Plugin classes, but you still bind your own named instance — configured for your theme or plugin's specific asset directory — in your provider's register() method.

In a theme

In a plugin

Binding key names (my-theme/assets, my-plugin/assets) are your choice — just keep them unique across the container and reuse the same string in your Facade accessor (see below).

Usage

Direct container access

Via a Facade (recommended)

Wrapping your bound instance in a Facade gives you a clean, static-style call site without losing testability. Define one per theme/plugin:

Then enqueue assets with it directly:

The same pattern applies to plugins — just point getFacadeAccessor() at your plugin's binding key:

Child-theme / plugin-override inheritance

Pass inherit: true as the second argument to check the inheritance chain first. This lets a child theme override a parent theme's asset, or a theme override a plugin's asset:

Laravel Mix support

If your build uses Laravel Mix instead of @wordpress/scripts, point Hybrid Assets at the manifest when you bind it:

Metadata resolution order is always: .asset.php → mix-manifest.json → content hash fallback.

Inline SVG

svg() resolves a file through the same path and inheritance rules as asset(), then renders its markup inline — useful for icons you want to style with CSS or animate:

Markup is sanitized by default against an allow-list vendored from an open WordPress core pull request (#12197). It strips scripts, event handlers, javascript: / data: URLs (in href and xlink:href), <animate> / <set>, and disallowed elements. Once core ships that sanitizer, this package will call core's instead. A file that is missing, unreadable, or contains no valid SVG renders as an empty string rather than throwing.

On WordPress 7.0, wp_kses() cannot keep attribute names that contain a colon, so xmlns:xlink is dropped and xlink:href is rewritten to href. Unsafe URLs are still removed. WordPress 7.1 keeps both.

Inheritance works as it does for asset():

Skip sanitization only for build-pipeline output you control:

How resolution works

Exceptions

All exceptions implement Hybrid\Assets\Contracts\AssetsException, so the whole package can be caught with one type.

Exception Thrown when
InvalidAssetFileException asset() / svg() is called with a blank file path
PluginFileNotSetException A Plugin resolver is used before setPluginFile()
PathOutsideBaseException A resolved .asset.php escapes the resolver's base directory
UnresolvableBaseDirectoryException The resolver's base directory can't be resolved via realpath()

Architecture

Class Role
Contracts\AssetsResolver Contract: path(), url(), asset(), svg(), assetUrl(), assetPath()
AssetsResolver Abstract base: resolution, inheritance chain, manifest handling — extended by all three resolvers below
ParentTheme Resolves assets in the active parent theme
ChildTheme Resolves assets in the active child theme, if one exists
Plugin Resolves assets in a specific plugin; supports override directories
Asset Immutable, fully-resolved asset (URL, path, dependencies, version)
Svg Reads and sanitizes an SVG for inline rendering
Support\SvgSanitizer Allow-list sanitizer, vendored from WordPress core PR #12197
Concerns\AssetMetaData Trait: reads .asset.php / mix-manifest.json metadata, path-traversal safe
AssetsServiceProvider Registers the above with the Hybrid Core container

License

This project is licensed under the GNU GPL, version 2 or later.

2008 – 2026 © Theme Hybrid.


All versions of hybrid-assets with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
themehybrid/hybrid-core Version ^7.0
themehybrid/hybrid-tools Version ^2.0
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 themehybrid/hybrid-assets contains the following files

Loading the files please wait ...