Download the PHP package salesrender/plugin-component-info without Composer

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

salesrender/plugin-component-info

Plugin metadata container for the SalesRender plugin ecosystem, providing structured information about the plugin's type, name, description, and developer.

Overview

plugin-component-info is a core component required by every SalesRender plugin. It stores and exposes the metadata that identifies a plugin within the SalesRender platform: what type of plugin it is, what it does, who developed it, and any additional type-specific configuration.

The component is built around three key classes: Info (a singleton that holds the complete plugin metadata), PluginType (an enum-like class defining the supported plugin categories), and Developer (a value object with the developer's contact information). Together, they produce the JSON response served by the plugin's /info endpoint, which the SalesRender platform uses to register and display the plugin.

Both name and description fields support callable values, enabling dynamic content that can be resolved at runtime -- for example, to provide localized text via a translation component.

Installation

Requirements

Key Classes

Info

Namespace: SalesRender\Plugin\Components\Info

Singleton class that holds the complete plugin metadata. Configured once during bootstrap via the static config() method, then accessed via getInstance(). Implements JsonSerializable for direct JSON output.

Static methods:

Method Signature Description
config static config(PluginType $type, string\|callable $name, string\|callable $description, array\|JsonSerializable $extra, Developer $developer): void Configure the singleton instance with all plugin metadata
getInstance static getInstance(): self Get the configured singleton. Throws RuntimeException if not configured

Instance methods:

Method Signature Description
getType getType(): PluginType Get the plugin type
getName getName(): string Get the plugin name (resolves callable if provided)
getDescription getDescription(): string Get the plugin description (resolves callable if provided)
getExtra getExtra(): array\|JsonSerializable\|mixed Get the extra metadata (type-specific configuration)
getDeveloper getDeveloper(): Developer Get the developer information
jsonSerialize jsonSerialize(): array Serialize to JSON (includes name, description, type, extra, languages, developer)

config() parameter details:

Parameter Type Description
$type PluginType Plugin category (MACROS, LOGISTIC, PBX, CHAT, etc.)
$name string\|callable Plugin display name. If callable, it is invoked when getName() is called
$description string\|callable Plugin description (supports Markdown). If callable, it is invoked when getDescription() is called
$extra array\|JsonSerializable Type-specific metadata (e.g., plugin class, entity, currency, capabilities)
$developer Developer Developer contact information

Validation:

PluginType

Namespace: SalesRender\Plugin\Components\Info

Enum-like class (extends EnumHelper) representing the supported plugin categories in the SalesRender platform.

Constants:

Constant Value Description
PluginType::MACROS 'MACROS' Macro/batch processing plugins
PluginType::LOGISTIC 'LOGISTIC' Logistics and delivery plugins
PluginType::PBX 'PBX' Telephony/PBX integration plugins
PluginType::CHAT 'CHAT' Chat/messaging plugins
PluginType::GEOCODER 'GEOCODER' Geocoding plugins
PluginType::INTEGRATION 'INTEGRATION' Third-party integration plugins

Constructor:

Throws an exception if the provided type is not one of the valid values.

Methods:

Method Signature Description
get get(): string Get the type value as a string
values static values(): array Get all valid type values
__toString __toString(): string String representation of the type

Developer

Namespace: SalesRender\Plugin\Components\Info

Immutable value object containing the plugin developer's contact information. Implements JsonSerializable.

Constructor:

Parameter Type Description
$name string Developer or company name
$email string Support email address for this plugin
$hostname string\|null Developer's website hostname (without http:// or https://, e.g., "example.com")

Validation:

Methods:

Method Signature Description
getName getName(): string Get the developer name
getEmail getEmail(): string Get the support email (lowercased)
getHostname getHostname(): string Get the website hostname
jsonSerialize jsonSerialize(): array Serialize to JSON array

Usage

Basic Configuration

Configure the plugin info in your bootstrap.php:

Using Callables for Localized Names

Use callables for $name and $description to support runtime localization via the translations component:

Chat Plugin with Capabilities

For chat plugins, the $extra array typically describes messaging capabilities:

PBX Plugin Configuration

Accessing Plugin Info at Runtime

JSON Output Structure

When serialized to JSON (as returned by the /info endpoint), the output has the following structure:

Configuration

The Info component is configured once during the plugin bootstrap phase, typically in bootstrap.php. The config() static method must be called before any access to getInstance().

Configuration order in bootstrap.php:

  1. Configure the database connection (Connector::config(...))
  2. Configure the translator (Translator::config(...))
  3. Configure plugin info (Info::config(...))
  4. Configure settings, forms, and other components

API Reference

Info

PluginType

Valid values: MACROS, LOGISTIC, PBX, CHAT, GEOCODER, INTEGRATION, RESALE

Developer

Dependencies

Package Version Purpose
xakepehok/enum-helper ^0.1.0 Enum validation for PluginType values

Dev dependencies:

Package Version Purpose
salesrender/plugin-component-translations ^0.1.2 Used in tests for verifying localization support

See Also


All versions of plugin-component-info with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
ext-json Version *
xakepehok/enum-helper Version ^0.1.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 salesrender/plugin-component-info contains the following files

Loading the files please wait ...