Download the PHP package wpfulcrum/container without Composer

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

Container Module

Build Status Latest Stable Version License

The Fulcrum DI Container Module provides a lean Dependency Injection Container.

The primary purpose of a a DI Container is to manage objects. By passing in a closure that wraps up the creation of objects, using the container, you can:

  1. Create a new object without having to use new in your code or having to specify it's dependencies.
  2. Get an object out of the container without having to use Singletons, statics, or globals. WooHoo!

The container also stores datasets. Think of it like a big array where you add values into it by a unique key. Powerful.

Seriously, a DI Container makes you job so much easier. Let it handle:

  1. Object creation along with all of the object's dependencies.
  2. Managing objects.
  3. Storing datasets in memory.
  4. Retrieving the object or dataset you need.

Functionality

It extends Pimple by providing the following functionality:

  1. has() method to check if a unique key exists in the container.
  2. get() method to fetch something out of the container by it's unique key.
  3. registerConcrete() method - providing the ability to register a closure.

Installation

The best way to use this component is through Composer:

Basic Usage

Creating Objects

Using the registerConcrete() method, you can register a closure that then handles creating the object and its dependencies.

For example, let's say you have an object that has several dependencies. For example, you are adding a Portfolio custom post type to your project using Fulcrum.

This might be the configuration for that CPT:

Let's stop and notice a few points:

  1. There are multiple dependencies including:
    • a Config object
    • a post type name
    • PostTypeSupports` object.
  2. Everything you need to create the CPT object is wrapped up in that closure.
  3. The autoload parameter is set to true. Therefore, the object is created immediately upon registering it into the container.

Using the above configuration, it can be registered into the container like this:

Contributing

All feedback, bug reports, and pull requests are welcome.


All versions of container with dependencies

PHP Build Version
Package Version
Requires php Version ^5.6|^7
pimple/pimple Version ^3.2
wpfulcrum/extender Version ^3
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 wpfulcrum/container contains the following files

Loading the files please wait ....