File tree 3 files changed +20
-18
lines changed
3 files changed +20
-18
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ Thumbs.db
26
26
# ######################
27
27
# PHPUnit
28
28
.phpunit.cache
29
+ .phpunit.result.cache
29
30
tests.sqlite
30
31
# vim
31
32
* ~
Original file line number Diff line number Diff line change @@ -19,6 +19,12 @@ The recommended way to install composer packages is:
19
19
composer require markstory/cakephp-feature-flags
20
20
```
21
21
22
+ Next, load the plugin by running the following command:
23
+
24
+ ```
25
+ bin/cake plugin load FeatureFlags
26
+ ```
27
+
22
28
## Usage
23
29
24
30
First you need to decide if you want simple boolean feature flags, or more complex
@@ -39,13 +45,6 @@ return [
39
45
];
40
46
```
41
47
42
- Next, in ` config/bootstrap.php ` add the following:
43
-
44
- ``` php
45
- // Load the feature configuration during application startup.
46
- Configure::load('features');
47
- ```
48
-
49
48
In your ` Application::services() ` method add the following:
50
49
51
50
``` php
@@ -104,13 +103,6 @@ return [
104
103
];
105
104
```
106
105
107
- Next, in ` config/bootstrap.php ` add the following:
108
-
109
- ``` php
110
- // Load the feature configuration during application startup.
111
- Configure::load('features');
112
- ```
113
-
114
106
In your ` Application::services() ` method add the following:
115
107
116
108
``` php
Original file line number Diff line number Diff line change 5
5
6
6
use Cake \Console \CommandCollection ;
7
7
use Cake \Core \BasePlugin ;
8
+ use Cake \Core \Configure ;
9
+ use Cake \Core \PluginApplicationInterface ;
8
10
9
11
/**
10
12
* Plugin for FeatureFlags
11
13
*/
12
14
class FeatureFlagsPlugin extends BasePlugin
13
15
{
14
16
/**
15
- * Add commands for the plugin.
16
- *
17
- * @param \Cake\Console\CommandCollection $commands The command collection to update.
18
- * @return \Cake\Console\CommandCollection
17
+ * @inheritDoc
19
18
*/
20
19
public function console (CommandCollection $ commands ): CommandCollection
21
20
{
@@ -26,4 +25,14 @@ public function console(CommandCollection $commands): CommandCollection
26
25
27
26
return $ commands ;
28
27
}
28
+
29
+ /**
30
+ * @inheritDoc
31
+ */
32
+ public function bootstrap (PluginApplicationInterface $ app ): void
33
+ {
34
+ parent ::bootstrap ($ app );
35
+
36
+ Configure::load ('features ' );
37
+ }
29
38
}
You can’t perform that action at this time.
0 commit comments