Skip to content

Commit 9dd758a

Browse files
committed
Fix composer setup
1 parent b08e8a7 commit 9dd758a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

controllers/PHPVersionsController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ private function add() {
264264
$this->climate->info("Add batch alias");
265265
$_aliases = '..\..\..\bin\php\_aliases';
266266
file_put_contents($_aliases.'\php'.implode('', array_slice(explode('.', $matches[1]), 0, 2)).'.bat', "@echo off\n".realpath($target_dir)."\php.exe %*");
267-
file_put_contents($_aliases."\composer".implode('', array_slice(explode('.', $matches[1]), 0, 2)).'.bat', str_replace(' %*', ' '.realpath($_aliases).'composer.phar %*', "@echo off\n".realpath($target_dir)."\php.exe %*"));
267+
file_put_contents($_aliases.'\composer'.implode('', array_slice(explode('.', $matches[1]), 0, 2)).'.bat', str_replace(' %*', ' '.realpath($_aliases).'\composer.phar %*', "@echo off\n".realpath($target_dir)."\php.exe %*"));
268268

269269
$this->climate->clear();
270270

controllers/SetupController.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ public function init() {
131131

132132
$this->climate->out("Composer setup");
133133
copy('https://getcomposer.org/installer', $_aliases.DIRECTORY_SEPARATOR.'composer-setup.php');
134-
if (hash_file('sha384', $_aliases.DIRECTORY_SEPARATOR.'composer-setup.php') === '906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8') {
134+
$exceptedSum = file_get_contents('https://composer.github.io/installer.sig');
135+
if (hash_file('sha384', $_aliases.DIRECTORY_SEPARATOR.'composer-setup.php') === $exceptedSum) {
135136
$this->climate->lightGreen('Installer verified');
136137
} else {
137138
$this->climate->error('Installer corrupt');
138139
unlink($_aliases.DIRECTORY_SEPARATOR.'composer-setup.php');
139-
exit;
140140
}
141141

142142
$argv = ['index.php', '--install-dir='.$_aliases];

index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
const LMPA_VERSION = '0.3.5';
2+
const LMPA_VERSION = '0.3.6';
33
define("APP_DIRECTORY", dirname(__FILE__));
44

55
if(PHP_OS !== "WINNT") exit("Only work on windows");

0 commit comments

Comments
 (0)