@@ -15,6 +15,7 @@ class Installer extends LibraryInstaller
1515{
1616
1717 private $ phpDir = '' ;
18+ private $ packName = '' ;
1819
1920 /**
2021 * {@inheritDoc}
@@ -45,7 +46,8 @@ public function getInstallPath(PackageInterface $package)
4546 );
4647 }
4748
48- return '.php/Pack/ ' .ucfirst (substr ($ package ->getPrettyName (), 11 ));
49+ $ this ->packName = ucfirst (substr ($ package ->getPrettyName (), 11 ));
50+ return '.php/Pack/ ' .$ this ->packName ;
4951 }
5052
5153 /**
@@ -75,19 +77,33 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa
7577 }
7678
7779 //ME Code ----
78- $ packConfig = $ downloadPath .'/Config ' ;
7980 $ appConfig = $ this ->phpDir .'/Config ' ;
81+ $ publicWeb = dirname ($ this ->phpDir );
82+ $ appAssets = $ publicWeb .'/ ' .strtolower ($ this ->packName );
83+
84+ $ packConfig = $ downloadPath .'/Config ' ;
85+ $ packAssets = $ downloadPath .'/Assets ' ;
8086
81- echo "\n\n\tPackConfig: $ packConfig \n\tAppConfig: $ appConfig \n\n" ;
82- echo "\n\n\tHtmlPath: " .(defined ('_HTML ' ) ? _HTML : 'indefinido... ' )."\n\n" ;
87+ echo "\n\n\tPackConfig: $ packConfig \n\tAppConfig: $ appConfig \n\tPublicPath: $ publicWeb " ;
8388
8489 if (file_exists ($ packConfig ) && is_readable ($ packConfig )){
85- echo "\n\t--- Config exists --- " ;
90+ echo "\n\t--- Config exists --- \n " ;
8691 self ::checkAndOrCreateDir ($ appConfig , true );
8792 self ::copyDirectoryContents ($ packConfig , $ appConfig );
8893 } else {
89- echo "\n\t--- Config Not Exists!! --- " ;
94+ echo "\n\t--- Config Not Exists!! --- \n" ;
95+ }
96+
97+ //Copy ASSETS
98+ if (file_exists ($ packAssets ) && is_readable ($ packAssets )){
99+ echo "\n\t--- Assets exists --- \n" ;
100+ self ::checkAndOrCreateDir ($ appAssets , true );
101+ self ::copyDirectoryContents ($ packAssets , $ appAssets );
102+ } else {
103+ echo "\n\t--- Assets Not Exists!! --- \n" ;
90104 }
105+
106+
91107 }
92108
93109
0 commit comments