Download the PHP package jmichaelward/contracts-wp without Composer

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

Contracts-WP

This library provides a small collection of interfaces intended for use in object-oriented development for WordPress. It is an evolution of the first such library I'd developed, OOPS-WP, which contained some of these concepts, but also included a series of abstract classes to help facilitate faster and more consistent scaffolding of plugins and themes.

This time around, I'm intentionally leaving the library much smaller; the intent is to allow developers to start with just these interfaces so that they might extend them to create other interfaces and abstract classes more specific to the particular needs of their projects. If you didn't like the approach of the abstract classes in OOPS-WP, but you saw the value in these smaller contracts, you may find this library useful as the basis for your own.

Notably, this iteration includes a few contracts that differ from my first attempt: Enqueueable, Initializable, and Hydratable. Enqueuable is definitely WordPress-specific, and can be implemented in classes responsible for enqueuing scripts and stylesheets with WordPress, and Initializable is a variation of Runnable, but they might be used in conjunction with one another.

Hydratable, on the other hand, is a concept prevalent in the PHP community that I wanted to add here because I use it myself all time. Those who are writing unit tests on a regular basis understand how challenging it can be to work with objects that call WordPress functionality within their constructor. If you need to populate data on an object before it can be used and want to do it the "right" way, you can implement the Hydratable interface and put the logic for your class that populates it with data from other sources into that method. Basically, it enables that separation of concerns, making your tests easier to write. I hope you'll give it a try.

Requirements

PHP 7.4 or higher must be installed in your environment in order to install Contracts-WP.

Installation

This library is best installed using Composer. Simply run composer require jmichaelward/contracts-wp and ensure you're autoloading the dependencies from Composer's vendor directory.


All versions of contracts-wp with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.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 jmichaelward/contracts-wp contains the following files

Loading the files please wait ....