1 | <?php namespace Arcanedev\LaravelTracker; |
||
13 | class Tracker implements TrackerContract |
||
14 | { |
||
15 | /* ------------------------------------------------------------------------------------------------ |
||
16 | | Properties |
||
17 | | ------------------------------------------------------------------------------------------------ |
||
18 | */ |
||
19 | /** |
||
20 | * The application container. |
||
21 | * |
||
22 | * @var \Illuminate\Contracts\Foundation\Application |
||
23 | */ |
||
24 | protected $app; |
||
25 | |||
26 | /** |
||
27 | * The request instance. |
||
28 | * |
||
29 | * @var \Illuminate\Http\Request |
||
30 | */ |
||
31 | private $request; |
||
32 | |||
33 | /** |
||
34 | * @var bool |
||
35 | */ |
||
36 | protected $enabled = false; |
||
37 | |||
38 | /* ------------------------------------------------------------------------------------------------ |
||
39 | | Constructor |
||
40 | | ------------------------------------------------------------------------------------------------ |
||
41 | */ |
||
42 | /** |
||
43 | * Tracker constructor. |
||
44 | * |
||
45 | * @param \Illuminate\Contracts\Foundation\Application $app |
||
46 | */ |
||
47 | public function __construct(Application $app) |
||
52 | |||
53 | /* ------------------------------------------------------------------------------------------------ |
||
54 | | Getters & Setters |
||
55 | | ------------------------------------------------------------------------------------------------ |
||
56 | */ |
||
57 | /** |
||
58 | * Get the config repository. |
||
59 | * |
||
60 | * @return \Illuminate\Contracts\Config\Repository |
||
61 | */ |
||
62 | private function config() |
||
66 | |||
67 | /** |
||
68 | * Get the tracker config. |
||
69 | * |
||
70 | * @param string $key |
||
71 | * @param mixed|null $default |
||
72 | * |
||
73 | * @return mixed |
||
74 | */ |
||
75 | private function getConfig($key, $default = null) |
||
79 | |||
80 | /** |
||
81 | * Set the request. |
||
82 | * |
||
83 | * @param \Illuminate\Http\Request $request |
||
84 | * |
||
85 | * @return self |
||
86 | */ |
||
87 | private function setRequest(Request $request) |
||
93 | |||
94 | /* ------------------------------------------------------------------------------------------------ |
||
95 | | Main Functions |
||
96 | | ------------------------------------------------------------------------------------------------ |
||
97 | */ |
||
98 | /** |
||
99 | * Start the tracking. |
||
100 | * |
||
101 | * @param \Illuminate\Http\Request $request |
||
102 | */ |
||
103 | public function track(Request $request) |
||
109 | |||
110 | /** |
||
111 | * Enable the tracker. |
||
112 | */ |
||
113 | public function enable() |
||
118 | |||
119 | /** |
||
120 | * Disable the tracker. |
||
121 | */ |
||
122 | public function disable() |
||
127 | |||
128 | /* ------------------------------------------------------------------------------------------------ |
||
129 | | Check Functions |
||
130 | | ------------------------------------------------------------------------------------------------ |
||
131 | */ |
||
132 | /** |
||
133 | * Check if the tracker is enabled. |
||
134 | * |
||
135 | * @return bool |
||
136 | */ |
||
137 | public function isEnabled() |
||
141 | |||
142 | /* ------------------------------------------------------------------------------------------------ |
||
143 | | Other Functions |
||
144 | | ------------------------------------------------------------------------------------------------ |
||
145 | */ |
||
146 | } |
||
147 |