Skip to content

Commit bca0f04

Browse files
committed
Add php 7.3.33 in deprecated + _aliases for CLI
1 parent a63ae68 commit bca0f04

File tree

4 files changed

+26
-8
lines changed

4 files changed

+26
-8
lines changed

LMPA.zip

221 KB
Binary file not shown.

controllers/PHPVersionsController.php

+12-7
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,12 @@ private function add() {
115115

116116
//TODO: Dynamic list
117117
$lists = [
118-
"5.5.38" => ["path" => "releases/archives/php-5.5.38-nts-Win32-VC11-x64.zip", "sha256" => "ABDF2FEFCD7D1DAF75D689E309E8571879B15D4B61726546E4E064F96167387A"],
119-
"5.6.40" => ["path" => "releases/archives/php-5.6.40-nts-Win32-VC11-x64.zip", "sha256" => "3D7668280FA4B16F70705539BA1E4EA17EEF344C81E82881CBECA26FB7F181F1"],
120-
"7.0.33" => ["path" => "releases/archives/php-7.0.33-nts-Win32-VC14-x64.zip", "sha256" => "BBA39BDE5B0BD50EFADC11E2716C7528669945F9D1397D707486E401E67E89FB"],
121-
"7.1.33" => ["path" => "releases/archives/php-7.1.33-nts-Win32-VC14-x64.zip", "sha256" => "071438BE5BBAEE8B34894DDBA7852B6040991A3C853AB8141EFCB1B6655BBBEF"],
122-
"7.2.34" => ["path" => "releases/archives/php-7.2.34-nts-Win32-VC15-x64.zip", "sha256" => "3C673EAB656E26FD6BC3AD27FE71169AD888B04E21D63D3C6B3151D5ED216563"]
118+
"5.5.38" => ["path" => "archives/php-5.5.38-nts-Win32-VC11-x64.zip", "sha256" => "ABDF2FEFCD7D1DAF75D689E309E8571879B15D4B61726546E4E064F96167387A"],
119+
"5.6.40" => ["path" => "archives/php-5.6.40-nts-Win32-VC11-x64.zip", "sha256" => "3D7668280FA4B16F70705539BA1E4EA17EEF344C81E82881CBECA26FB7F181F1"],
120+
"7.0.33" => ["path" => "archives/php-7.0.33-nts-Win32-VC14-x64.zip", "sha256" => "BBA39BDE5B0BD50EFADC11E2716C7528669945F9D1397D707486E401E67E89FB"],
121+
"7.1.33" => ["path" => "archives/php-7.1.33-nts-Win32-VC14-x64.zip", "sha256" => "071438BE5BBAEE8B34894DDBA7852B6040991A3C853AB8141EFCB1B6655BBBEF"],
122+
"7.2.34" => ["path" => "archives/php-7.2.34-nts-Win32-VC15-x64.zip", "sha256" => "3C673EAB656E26FD6BC3AD27FE71169AD888B04E21D63D3C6B3151D5ED216563"],
123+
"7.3.33" => ["path" => "archives/php-7.3.33-nts-Win32-VC15-x64.zip", "sha256" => "5EAF3CAD80E678623F222A42C99BCEFCC60EEA359D407FB51E805AFDB3B13E5E"]
123124
];
124125

125126
foreach($lists as $version => $path) {
@@ -175,7 +176,7 @@ private function add() {
175176
ksort($archives_versions[$major][$minor]);
176177
$patch = menu(array_combine(array_keys($archives_versions[$major][$minor]), array_map(function($v) use ($major, $minor) { return "PHP $major.$minor.<blue>$v</blue>"; }, array_keys($archives_versions[$major][$minor]))));
177178

178-
$packages["other"]["path"] = $archives_versions[$major][$minor][$patch];
179+
$packages["other"] = ['path' => substr($archives_versions[$major][$minor][$patch], 20) ];
179180
}
180181

181182
$this->climate->info("Start download\n");
@@ -199,7 +200,7 @@ private function add() {
199200
$this->climate->info(hash("sha256", $file['content']));
200201
$this->climate->info($packages[$choice]['sha256']);
201202

202-
if(hash("sha256", $file['content']) === $packages[$choice]['sha256']) {
203+
if(hash("sha256", $file['content']) === strtolower($packages[$choice]['sha256'])) {
203204
$this->climate->lightGreen("Download is OK");
204205
} else {
205206
$this->climate->error("Download have fail");
@@ -240,6 +241,10 @@ private function add() {
240241
$this->climate->info("Copy ini file ".realpath($target_dir)."/php.ini-production to ".realpath($target_dir)."/php.ini");
241242
copy($target_dir."/php.ini-production", $target_dir."/php.ini");
242243

244+
$this->climate->info("Add batch alias");
245+
$_aliases = '..\..\..\bin\php\_aliases';
246+
file_put_contents($_aliases.'\php'.implode('', array_slice(explode('.', $matches[1]), 0, 2)).'.bat', "@echo off\n".realpath($target_dir)."\php.exe %*");
247+
243248
$this->climate->clear();
244249

245250
(new PHPIniController($this->climate))->merge($sourceIni,$target_dir."/php.ini");

controllers/SetupController.php

+13
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@ public function init() {
1717
$this->climate->out("This will allow you the set the inital settings required to have the best experiance with LMPA!");
1818
$this->climate->br();
1919

20+
$this->climate->lightGreen("Check if _aliases folder exists");
21+
$_aliases = '..\..\..\bin\php\_aliases';
22+
if(!file_exists($_aliases)) {
23+
$this->climate->yellow("Not found, try to create-it");
24+
if(mkdir($_aliases)) {
25+
$this->climate->lightGreen("Created");
26+
$this->climate->magenta("Please add " . realpath($_aliases) . " to your PATH to be able to use php74 php80 php56 on cli");
27+
} else {
28+
$this->climate->red("Fail to create _aliases");
29+
exit;
30+
}
31+
}
32+
2033
$this->climate->lightGreen("Do you want to install phpMyAdmin?");
2134
$choice = menu(["no", "yes"]);
2235
if($choice === "1") {

index.php

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

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

0 commit comments

Comments
 (0)