PluginProbe
UpStream: a Project Management Plugin for WordPress / 2.0.7
UpStream: a Project Management Plugin for WordPress v2.0.7
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.0.7, at includes/class-container.php

68 lines 1.3 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 use Allex\Core;
9
10 /**
11 * Pimple container
12 */
13 class Container extends \Pimple\Container {
14
15 /**
16 * Instance of the Pimple container
17 *
18 * @var $instance Class instance.
19 */
20 protected static $instance;
21
22 /**
23 * Get class instance.
24 */
25 public static function get_instance() {
26 if ( empty( static::$instance ) ) {
27 $instance = new self();
28
29 // Define the services.
30 $instance['PLUGIN_BASENAME'] = function ( $c ) {
31 return plugin_basename( 'upstream/upstream.php' );
32 };
33
34 $instance['EDD_API_URL'] = function ( $c ) {
35 return 'https://upstreamplugin.com';
36 };
37
38 $instance['PLUGIN_AUTHOR'] = function ( $c ) {
39 return 'UpStream';
40 };
41
42 $instance['UPDATES_DOC_URL'] = function ( $c ) {
43 // @todo: Update this link adding an specific page for this subject.
44 return 'http://upstreamplugin.com/docs/';
45 };
46
47 $instance['framework'] = function ( $c ) {
48 return new Core(
49 $c['PLUGIN_BASENAME'],
50 $c['EDD_API_URL'],
51 $c['PLUGIN_AUTHOR'],
52 $c['UPDATES_DOC_URL']
53 );
54 };
55
56 if ( is_admin() ) {
57 $instance['reviews'] = function ( $c ) {
58 return new UpStream_Admin_Reviews();
59 };
60 }
61
62 static::$instance = $instance;
63 }
64
65 return static::$instance;
66 }
67 }
68