PluginProbe
UpStream: a Project Management Plugin for WordPress / 2.1.0
UpStream: a Project Management Plugin for WordPress v2.1.0
trunk 1.39.0 1.39.1 1.39.2 1.39.3 2.0.7 2.1.0
upstream / includes / class-container.php

class-container.php in UpStream: a Project Management Plugin for WordPress 2.1.0, at includes/class-container.php

70 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Pimple container
4 *
5 * @package Allex\Core
6 */
7
8 namespace UpStream;
9
10 use Allex\Core;
11
12 /**
13 * Pimple container
14 */
15 class Container extends \Pimple\Container {
16
17 /**
18 * Instance of the Pimple container
19 *
20 * @var $instance Class instance.
21 */
22 protected static $instance;
23
24 /**
25 * Get class instance.
26 */
27 public static function get_instance() {
28 if ( empty( static::$instance ) ) {
29 $instance = new self();
30
31 // Define the services.
32 $instance['PLUGIN_BASENAME'] = function ( $c ) {
33 return plugin_basename( 'upstream/upstream.php' );
34 };
35
36 $instance['EDD_API_URL'] = function ( $c ) {
37 return 'https://upstreamplugin.com';
38 };
39
40 $instance['PLUGIN_AUTHOR'] = function ( $c ) {
41 return 'UpStream';
42 };
43
44 $instance['UPDATES_DOC_URL'] = function ( $c ) {
45 // @todo: Update this link adding an specific page for this subject.
46 return 'http://upstreamplugin.com/docs/';
47 };
48
49 $instance['framework'] = function ( $c ) {
50 return new Core(
51 $c['PLUGIN_BASENAME'],
52 $c['EDD_API_URL'],
53 $c['PLUGIN_AUTHOR'],
54 $c['UPDATES_DOC_URL']
55 );
56 };
57
58 if ( is_admin() ) {
59 $instance['reviews'] = function ( $c ) {
60 return new \UpStream_Admin_Reviews();
61 };
62 }
63
64 static::$instance = $instance;
65 }
66
67 return static::$instance;
68 }
69 }
70