1 | <?php |
||
4 | class WebpackPageControllerExtension extends Extension |
||
|
|||
5 | { |
||
6 | |||
7 | /** |
||
8 | * you only need to set this if you have some themes that are enabled and some themes |
||
9 | * that do not run webpack |
||
10 | * @var {Array} |
||
11 | */ |
||
12 | private static $webpack_enabled_themes = []; |
||
13 | |||
14 | /** |
||
15 | * override webpack server for custom set ups |
||
16 | * set to true to make this class believe you are always running |
||
17 | * the webpack server |
||
18 | * @see IsWebpackDevServer |
||
19 | * @var bool |
||
20 | */ |
||
21 | private static $is_webpack_server = false; |
||
22 | |||
23 | /** |
||
24 | * override webpack server for custom set ups |
||
25 | * this is the server used for checking if the webpack server is running |
||
26 | * @see IsWebpackDevServer |
||
27 | * @var bool |
||
28 | */ |
||
29 | private static $webpack_socket_server = 'localhost'; |
||
30 | |||
31 | /** |
||
32 | * usually this is set to current domain |
||
33 | * only set if you need an alternative |
||
34 | * @see: WebpackBaseURL |
||
35 | * @var string |
||
36 | */ |
||
37 | private static $webpack_server = ''; |
||
38 | |||
39 | /** |
||
40 | * |
||
41 | * @var int |
||
42 | */ |
||
43 | private static $webpack_port = 3000; |
||
44 | |||
45 | /** |
||
46 | * this is the folder where the distilled files are placed. |
||
47 | * If your theme is foo then you will find the distilled files in themes/foo_dist |
||
48 | * @var string |
||
49 | */ |
||
50 | private static $webpack_distribution_folder_extension = 'dist'; |
||
51 | |||
52 | /** |
||
53 | * |
||
54 | * @return bool |
||
55 | */ |
||
56 | public function IsNotWebpackDevServer() |
||
60 | |||
61 | |||
62 | /** |
||
63 | * |
||
64 | * @return bool |
||
65 | */ |
||
66 | public function IsWebpackDevServer() |
||
83 | |||
84 | |||
85 | /** |
||
86 | * |
||
87 | * @return string |
||
88 | */ |
||
89 | public function WebpackBaseURL() |
||
101 | |||
102 | /** |
||
103 | * @return string |
||
104 | */ |
||
105 | public function WebpackDistributionFolderExtension() |
||
109 | |||
110 | /** |
||
111 | * |
||
112 | * @param string $type should be set to JS or CSS |
||
113 | * @return string |
||
114 | */ |
||
115 | public function WebpackFileHash($type = 'JS') |
||
129 | } |
||
130 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.