PluginProbe
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration / 1.13
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration v1.13
2.0.15 2.0.12 2.0.10 2.0.4 2.0.1 2.0.0 1.95.3 1.95.2 1.95 1.91.6 trunk 1.11 1.12 1.13 1.20 1.21 1.22 1.23 1.30 1.31 1.32 1.35 1.40 1.41 1.45 All 41 releases
fluent-boards / app / Api / Api.php

Api.php in FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration 1.13, at app/Api/Api.php

53 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentBoards\App\Api;
4
5 /**
6 * Internal PHP API Class
7 *
8 * Please do not use this class directly. use FluentBoardsApi($module) instead.
9 *
10 * @package FluentBoards\App\Api\Classes
11 *
12 * @version 1.0.0
13 */
14
15 final class Api
16 {
17 public function __construct($app)
18 {
19 $this->app = $app;
20 $this->register();
21 }
22
23 private function register()
24 {
25 foreach ($this->getClasses() as $key => $class) {
26 $this->app->singleton($this->key($key), function($app) use ($class) {
27 return new FBSApi($app->make($class));
28 });
29 }
30 }
31
32 private function getClasses()
33 {
34 return require_once(
35 $this->app['path.app'].'Api/config.php'
36 );
37 }
38
39 private function key($key)
40 {
41 return '__fluentboards_api__.' . $key;
42 }
43
44 public function __get($key)
45 {
46 try {
47 return $this->app[$this->key($key)];
48 } catch(\Exception $e) {
49 throw new \Exception("The '$key' doesn't exist in FluentBoardsApi.");
50 }
51 }
52 }
53