@@ -43,7 +43,7 @@ final class Updater
4343 * 'filename' => an array of release excluded filenames
4444 * @return void
4545 */
46- public function __construct (string $ username , string $ repository , string $ token , string $ version , string |null $ admin = '' , string |null $ mailer = '' , array |null $ sourceExclusions = ['path ' => [], 'filename ' => []], array |null $ releaseExclusions = ['path ' => [], 'filename ' => []], bool $ clear = true )
46+ public function __construct (string $ username , string $ repository , string $ token , string $ version , string |null $ admin = '' , string |null $ mailer = '' , array |null $ sourceExclusions = ['path ' => [], 'filename ' => []], array |null $ releaseExclusions = ['path ' => [], 'filename ' => []], bool $ clear = true , $ dir = "" )
4747 {
4848 $ this ->status = $ this ::STARTED ;
4949
@@ -86,7 +86,11 @@ public function __construct(string $username, string $repository, string $token,
8686 $ this ->exclude = ['source ' => $ sourceExclusions , 'release ' => $ releaseExclusions ];
8787 $ this ->clear = $ clear ;
8888
89- $ this ->dir = getcwd ();
89+ if ($ dir != "" ){
90+ $ this ->dir = $ dir ;
91+ } else {
92+ $ this ->dir = getcwd ();
93+ }
9094
9195 $ update = $ this ->Install ();
9296
@@ -96,17 +100,6 @@ public function __construct(string $username, string $repository, string $token,
96100 }
97101 }
98102 $ this ->Log ();
99- if ($ update == $ this ::UPDATED ) {
100- if (class_exists ('Composer\Autoload\ClassLoader ' )) {
101- if (is_dir (exec ('which composer ' ))) {
102- exec ('composer install -d ' . getcwd ());
103- } elseif (file_exists (getcwd () . '/composer.phar ' )) {
104- exec ('php composer.phar install -d ' . getcwd ());
105- } elseif (file_exists (($ composer_path = exec ('find / -name "composer.phar" 2>/dev/null ' )))) {
106- exec ('php ' . $ composer_path . ' install -d ' . getcwd ());
107- }
108- }
109- }
110103 $ this ->status = $ update ;
111104 }
112105
0 commit comments