Download the PHP package wrd/wp-objective without Composer

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

WP-Objective

:warning: This package is currently experimental.

Objective is a batteries-included framework for building consistent WordPress plugins.

It includes setup for many common plugin requirements - such as Custom Post Types, Admin Actions, HTTP Clients, Rest API Development, Migrations - all wrapped in a Laravel inspired API.

Created by Kyle Cooper at WRD Studio.

Installation

This project is available for installation via Composer.

Getting Started

Objective uses a global plugin which serves as a container to manage global objects. You can use the plugin() utility to grab the current instance.

The plugin is a container responsible for instantiating objects & injecting their dependencies, using it's bindings to do so.

Bindings

You can also register bindings, allowing every part of Objective to use the correct object/class when looking for it. Objective comes with a range a default bindings to provide sensible defaults and will also look for unbound classes directly when needed.

You can use this functionality override the default Plugin instance or any other piece of functionality. For example, by switching the Logging_Manager to store to the database.

:warning: You should always bind your own extension of the base Plugin class. This allows Objective to keep track of your plugin file/directory.

Service Providers

You can add in your service providers which come with convenient methods for the WordPress plugin lifecycle. Your service providers allow ways for separate 'components' too hook into the plugin lifecycle without needing to define loose hooks.

Configuration

You can configure your plugin's bindings & service providers by create an extension of the Plugin class, like below. In your plugin's entrypoint file you can then create a global instance and boot it.

Plugin Class

Your plugin should include your own extension of the base Plugin class. This is the only item that is required be bound in your config.

The plugin class is primarily responsible for storing your plugin file, directory and version.

It also comes with a range of pre-built hooks for you enqueue assets or spin off any effects need (though it's recommended to use service providers if possible).

Facades

Many of the Plugin's bindings can be easily accessed via Laravel-style Facades. Simply call these statically and your call will be mapped to the function in the current instance.

Deeper Dive

Actions

It's common for plugins to need to allow their users to perform actions that can be triggered from WordPress. Objective includes the 'Action' class to make this easier.

A permissions callback is required to ensure the user is allowed to perform the action.

You can provide the URL the user should be redirected to upon successful completion.

You can provide arguments, in the same format as the REST API. These will be sanitized & validated before they react your handle function.

Define your action like so,

You'll need to make sure you either bind or provide your class. Objects that inherit from the Service_Provider class (which Action does) will automatically be provided when they're bound.

Collections

Many of Objective's methods will return a Collection object, rather than an array. This is a class which includes many utility functions for manipulating the data in a fluent API.

You can create your own collection like so,

If you need to access the raw array underneath, you can always call $collection->all().

Migrations

Migrations allow you to lay out the steps your plugin needs to make for every new version. For example, you might want to create a database table in version 1.0.0 and then you may need to add an additional column to the table in version 1.1.0.

You simply define a migration for each new plugin version that needs to be migrated and Objective will handle running through them upon activation and storing the version currently migrated to.

Learn More

More documentation is coming soon. In the meantime dive into the code to learn more about,


All versions of wp-objective with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2.0
phpdocumentor/reflection-docblock Version ^5.6
adhocore/cli Version v1.0.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 wrd/wp-objective contains the following files

Loading the files please wait ...