Download the PHP package pollora/meta without Composer

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

Pollora Meta: typed WordPress meta declared with attributes

Latest version Total downloads Tests

Typed WordPress meta, declared with attributes: a property of a class is a meta, its PHP type is the meta's type, its initial value is the default. The package registers it with register_meta(), reads and writes it with its PHP type (an int, a bool, a CarbonImmutable, an enum, a list, a data object), checks its rules on every write, and gives the compiled schemas to the tooling and to the UI drivers (ACF, Meta Box) that build the editing fields.

Part of Pollora, the Laravel framework for WordPress, where it is installed and wired for you: see Typed meta. It runs without Laravel too: in a plugin, a Bedrock site or any PHP project.

Installation

Requires PHP 8.3+ and WordPress. It builds on pollora/attributes (the #[Meta] attribute), pollora/discovery and pollora/hook.

Declaring

#[Meta] takes key, showInRest, label, description, sanitize, capability, revisions, rules, single, items, control, group, hints, media and public; see the attribute's own documentation in pollora/attributes. #[PostMeta], #[TermMeta], #[UserMeta] and #[CommentMeta] declare the meta of a type you do not own.

Reading and writing

A write goes through WordPress's meta API, under the declared key. A value that breaks a rule throws MetaValidationException and nothing is written; a stored value that cannot be read as its type reads as the property default.

The rules are checked by a MetaValidatorInterface. In a Pollora application it is Laravel's validator (min:0, max:5000, in:…, email…); without Laravel, pass your own to MetaAccessor, or none: the rules are then not checked.

Schemas and UI drivers

MetaAccessor::schemas() and schemaFor('post', 'event') give the compiled MetaSchemas. A package that builds editing fields implements MetaUiDriver and registers it by name with MetaAccessor::extend('acf', AcfDriver::class); MetaUiDriverConformance::check($driver) checks it against the contract from any test framework.

Wiring it outside Pollora

Discover the classes that declare meta, then build the accessor with the same pieces the framework's provider builds:

The meta are registered with WordPress on init. The Eloquent accessors (HasTypedMeta), the Laravel validator, the pollora:meta:* commands and the pollora:doctor check stay in the framework.

Testing

License

MIT. See LICENSE.


All versions of meta with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
nesbot/carbon Version ^3.0
pollora/attributes Version ^0.1 || ^1.0
pollora/discovery Version ^0.1 || ^1.0
pollora/hook Version ^2.0.1
psr/container Version ^2.0
psr/log Version ^3.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 pollora/meta contains the following files

Loading the files please wait ...