27
27
use craft \utilities \ClearCaches ;
28
28
use craft \web \twig \variables \CraftVariable ;
29
29
use craft \web \UrlManager ;
30
- use nystudio107 \pluginvite \services \VitePluginService ;
31
- use nystudio107 \transcoder \assetbundles \transcoder \TranscoderAsset ;
32
30
use nystudio107 \transcoder \models \Settings ;
33
- use nystudio107 \transcoder \services \Transcode ;
31
+ use nystudio107 \transcoder \services \ServicesTrait ;
34
32
use nystudio107 \transcoder \variables \TranscoderVariable ;
35
33
use yii \base \ErrorException ;
36
34
use yii \base \Event ;
41
39
* @author nystudio107
42
40
* @package Transcode
43
41
* @since 1.0.0
44
- *
45
- * @property Transcode $transcode
46
- * @property Settings $settings
47
- * @property VitePluginService $vite
48
- * @method Settings getSettings()
49
42
*/
50
43
class Transcoder extends Plugin
51
44
{
45
+ // Traits
46
+ // =========================================================================
47
+
48
+ use ServicesTrait;
49
+
52
50
// Static Properties
53
51
// =========================================================================
54
52
@@ -62,46 +60,23 @@ class Transcoder extends Plugin
62
60
*/
63
61
public static ?Settings $ settings ;
64
62
65
- // Static Methods
66
- // =========================================================================
67
- /**
68
- * @var string
69
- */
70
- public string $ schemaVersion = '1.0.0 ' ;
71
-
72
63
// Public Properties
73
64
// =========================================================================
65
+
74
66
/**
75
67
* @var bool
76
68
*/
77
69
public bool $ hasCpSection = false ;
70
+
78
71
/**
79
72
* @var bool
80
73
*/
81
74
public bool $ hasCpSettings = false ;
82
75
83
76
/**
84
- * @inheritdoc
77
+ * @var string
85
78
*/
86
- public function __construct ($ id , $ parent = null , array $ config = [])
87
- {
88
- $ config ['components ' ] = [
89
- 'transcode ' => Transcode::class,
90
- // Register the vite service
91
- 'vite ' => [
92
- 'class ' => VitePluginService::class,
93
- 'assetClass ' => TranscoderAsset::class,
94
- 'useDevServer ' => true ,
95
- 'devServerPublic ' => 'http://localhost:3001 ' ,
96
- 'serverPublic ' => 'http://localhost:8000 ' ,
97
- 'errorEntry ' => 'src/js/app.ts ' ,
98
- 'devServerInternal ' => 'http://craft-transcoder-buildchain:3001 ' ,
99
- 'checkDevServer ' => true ,
100
- ],
101
- ];
102
-
103
- parent ::__construct ($ id , $ parent , $ config );
104
- }
79
+ public string $ schemaVersion = '1.0.0 ' ;
105
80
106
81
// Public Methods
107
82
// =========================================================================
0 commit comments