PluginProbe
Scrollsequence – Cinematic Scroll Image Animation Plugin / 1.5.5
Scrollsequence – Cinematic Scroll Image Animation Plugin v1.5.5
1.4.3 1.4.4 1.4.5 1.4.6 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 trunk 0.9.92 0.9.93 0.9.94 0.9.96 1.0.072 1.0.073 All 61 releases
scrollsequence / includes / carbonfields / htmlburger / carbon-fields / core / Service / Service.php

Service.php in Scrollsequence – Cinematic Scroll Image Animation Plugin 1.5.5, at includes/carbonfields/htmlburger/carbon-fields/core/Service/Service.php

62 lines 860 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Carbon_Fields\Service;
4
5 abstract class Service {
6
7 /**
8 * Service enabled state
9 *
10 * @var boolean
11 */
12 protected $enabled = false;
13
14 /**
15 * Check whether the service is enabled
16 */
17 public function is_enabled() {
18 return $this->enabled;
19 }
20
21 /**
22 * Enable the service
23 *
24 * @return bool
25 */
26 public function enable() {
27 if ( $this->is_enabled() ) {
28 return false;
29 }
30 $this->enabled = true;
31
32 $this->enabled();
33
34 return true;
35 }
36
37 /**
38 * Enable actions for inheriting classes
39 */
40 abstract protected function enabled();
41
42 /**
43 * Disable the service
44 *
45 * @return bool
46 */
47 public function disable() {
48 if ( ! $this->is_enabled() ) {
49 return false;
50 }
51 $this->enabled = false;
52
53 $this->disabled();
54
55 return true;
56 }
57
58 /**
59 * Disable actions for inheriting classes
60 */
61 abstract protected function disabled();
62 }