Download the PHP package stellarwp/schema without Composer

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

Schema Builder

CI Static Analysis

A library for simplifying the creation, update, and field modification of custom tables within WordPress.

Installation

It's recommended that you install Schema as a project dependency via Composer:

We actually recommend that this library gets included in your project using Strauss.

Luckily, adding Strauss to your composer.json is only slightly more complicated than adding a typical dependency, so checkout our strauss docs.

Usage prerequisites

To actually use the schema library, you must have two additional libraries in your project:

  1. A Dependency Injection Container (DI Container) that is compatible with di52 (We recommend using di52.).
  2. The stellarwp/db library.

In order to keep this library as light as possible, those dependencies are not included in the library itself. To avoid version compatibility issues, those libraries are also not included as Composer dependencies. Instead, you must include them in your project. We recommend including them via composer using Strauss, just like you have done with this library.

Important note on ALL examples

All examples within the documentation for this project will be assuming that you are using Strauss to prefix the namespaces provided by this library.

The examples will be using:

Getting started

For a full understanding of what is available in this library and how to use it, definitely read through the full documentation. But for folks that want to get rolling with the basics quickly, try out the following.

Initializing the library

Creating a table

Let's say you want a new custom table called sandwiches (with the default WP prefix, it'd be wp_sandwiches). You'll need a class file for the table. For the sake of this example, we'll be assuming this class is going into a Tables/ directory and is reachable via the Boom\Shakalaka\Tables namespace.

Here's what the properties and method mean:

Registering the table

The Schema library gets initialized automatically when you register at table or a field schema. To register your table, simply use the handy Register::table() method within the plugins_loaded:

That's it!

The table will be automatically registered, created, and updated during the plugins_loaded action at priority 1000! _(that priority number is filterable via the stellarwp_schema_up_plugins_loaded_priority filter)_

Documentation

Here's some more advanced documentation to get you rolling on using this library at a deeper level:

  1. Setting up Strauss
  2. Schema management
  3. Table schemas
    1. Versioning
    2. Registering tables
    3. Deregistering tables
    4. Table collection
    5. Publicly accessible methods
  4. Field schemas
    1. Versioning
    2. Registering fields
    3. Deregistering fields
    4. Field collection
    5. Publicly accessible methods
  5. Automated testing

Acknowledgements

Special props go to @lucatume and @stratease for their initial work on this structure before it was extracted into a standalone library.


All versions of schema with dependencies

PHP Build Version
Package Version
Requires psr/container Version ^1.0
stellarwp/container-contract Version ^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 stellarwp/schema contains the following files

Loading the files please wait ....