# upstream/trunk/includes/class-container.php

UpStream: a Project Management Plugin for WordPress, version trunk. 70 lines.

- Page: https://pluginprobe.com/plugins/upstream/trunk/code/includes/class-container.php
- Raw: https://pluginprobe.com/plugins/upstream/trunk/raw/includes/class-container.php
- Modified: 2024-05-22T12:40:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/upstream/trunk/code/includes/class-container.php#L10-L20`.

```php
<?php
/**
 * Pimple container
 *
 * @package Allex\Core
 */

namespace UpStream;

use Allex\Core;

/**
 * Pimple container
 */
class Container extends \Pimple\Container {

	/**
	 * Instance of the Pimple container
	 *
	 * @var $instance Class instance.
	 */
	protected static $instance;

	/**
	 * Get class instance.
	 */
	public static function get_instance() {
		if ( empty( static::$instance ) ) {
			$instance = new self();

			// Define the services.
			$instance['PLUGIN_BASENAME'] = function ( $c ) {
				return plugin_basename( 'upstream/upstream.php' );
			};

				$instance['EDD_API_URL'] = function ( $c ) {
					return 'https://upstreamplugin.com';
				};

				$instance['PLUGIN_AUTHOR'] = function ( $c ) {
					return 'UpStream';
				};

				$instance['UPDATES_DOC_URL'] = function ( $c ) {
					// @todo: Update this link adding an specific page for this subject.
					return 'http://upstreamplugin.com/docs/';
				};

				$instance['framework'] = function ( $c ) {
					return new Core(
						$c['PLUGIN_BASENAME'],
						$c['EDD_API_URL'],
						$c['PLUGIN_AUTHOR'],
						$c['UPDATES_DOC_URL']
					);
				};

			if ( is_admin() ) {
					$instance['reviews'] = function ( $c ) {
						return new \UpStream_Admin_Reviews();
					};
			}

				static::$instance = $instance;
		}

		return static::$instance;
	}
}

```
