@@ -67,6 +67,7 @@ public function processPackages(PackageEvent $event)
6767
6868 $ configFile = $ directory . '/extend.console.config.yml ' ;
6969 $ servicesFile = $ directory . '/extend.console.services.yml ' ;
70+ $ servicesUnistallFile = $ directory . '/extend.console.uninstall.services.yml ' ;
7071
7172 if (file_exists ($ configFile )) {
7273 unlink ($ configFile );
@@ -78,6 +79,11 @@ public function processPackages(PackageEvent $event)
7879 $ this ->io ->write ('<info>Removing services cache file:</info> ' . $ servicesFile );
7980 }
8081
82+ if (file_exists ($ servicesUnistallFile )) {
83+ unlink ($ servicesUnistallFile );
84+ $ this ->io ->write ('<info>Removing services cache file:</info> ' . $ servicesUnistallFile );
85+ }
86+
8187 if ($ configData = $ extenderManager ->getConfigData ()) {
8288 file_put_contents (
8389 $ configFile ,
@@ -86,12 +92,22 @@ public function processPackages(PackageEvent $event)
8692 $ this ->io ->write ('<info>Creating config cache file:</info> ' . $ configFile );
8793 }
8894
89- if ($ servicesData = $ extenderManager ->getServicesData ()) {
95+ $ servicesData = $ extenderManager ->getServicesData ();
96+ if ($ servicesData && array_key_exists ('install ' , $ servicesData )) {
9097 file_put_contents (
9198 $ servicesFile ,
92- Yaml::dump ($ servicesData , 4 , 2 )
99+ Yaml::dump ($ servicesData[ ' install ' ] , 4 , 2 )
93100 );
94101 $ this ->io ->write ('<info>Creating services cache file: </info> ' . $ servicesFile );
95102 }
103+
104+ $ servicesData = $ extenderManager ->getServicesData ();
105+ if ($ servicesData && array_key_exists ('uninstall ' , $ servicesData )) {
106+ file_put_contents (
107+ $ servicesUnistallFile ,
108+ Yaml::dump ($ servicesData ['uninstall ' ], 4 , 2 )
109+ );
110+ $ this ->io ->write ('<info>Creating services cache file: </info> ' . $ servicesUnistallFile );
111+ }
96112 }
97113}
0 commit comments