-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.php
71 lines (58 loc) · 2.51 KB
/
start.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
// Prossegue com a execução do instalador
require_once __DIR__ . "/../../autoload.php";
use Luthier\Cli\Colors\Colors;
use Luthier\Cli\Cli;
use Luthier\Cli\Output;
// Mensagem inicial
Output::separator("#", [Colors::$textWhite, Colors::$backgroundLightMagenta]);
$changelog = __DIR__ . "/CHANGELOG.md";
$changelogFirstLine = fgets(fopen($changelog, 'r'));
$colors = [Colors::$textLightYellow, Colors::$backgroundBlack];
$versioColors = [Colors::$textLightGreen, Colors::$backgroundBlack];
$startMessage = <<<LUTHIER
.--d8b,
( '`YP) ┏┓╋╋┏┓┏┓┏┓
\ f||? / ┃┃┏┳┫┗┫┗╋╋━┳┳┓
/ j||t \ ┃┗┫┃┃┏┫┃┃┃┻┫┏┛
( || ) ┗━┻━┻━┻┻┻┻━┻┛
`-||-' ┏━━┓╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┏┓
|| ┃━┳╋┳┳━┓┏━━┳━┳┳┳┳━┳┳┫┣┓
|| ┃┏┛┃┏┫╋┗┫┃┃┃┻┫┃┃┃╋┃┏┫━┫
|| ┗┛╋┗┛┗━━┻┻┻┻━┻━━┻━┻┛┗┻┛
=JJ=
LUTHIER;
$message = "OLÁ! SEJA BEM VINDO AO LUTHIER FRAMEWORK";
echo "\n";
Output::charByChar($message, 5, $colors);
Output::output($startMessage, "\n", $colors);
Output::output("V $changelogFirstLine", "\n", $colors);
menu($colors);
// MENU - TESTING FRAMEWORK
Output::charByChar("SELECIONE UM FRAMEWORK DE TESTES", 5, $colors);
Output::output("[1] - PEST (https://pestphp.com/)", "\n", $colors);
Output::output("[*] - POR PADRÃO INSTALARÁ O PEST", "\n", $colors);
$result = trim(readline(">>> "));
$choose = match ($result) {
"1" => Cli::installTestFramework("pest"),
default => Cli::installTestFramework("default")
};
Output::separator("#", [Colors::$textWhite, Colors::$backgroundLightMagenta]);
function menu($colors)
{
// MENU - PROJECT SKELETON
$userProjectPath = dirname(__DIR__, 3);
$templatesPath = dirname(__DIR__) . "/luthier/templates";
Output::charByChar("SELECIONE UMA OPÇÃO", 5, $colors);
$dir = dir($templatesPath);
for ($i=1; $file = $dir->read() ; $i++) {
if($file == "." || $file == "..") continue;
Output::output("[$i] - CRIAR ESQUELETO DO PROJETO A PARTIR DO TEMPLATE ($file)", "\n", $colors);
$templates[$i] = $file;
}
Output::output("[*] - SAIR SEM FAZER NADA", "\n", $colors);
$result = trim(readline(">>> "));
if(!isset($templates[$result])) Cli::exitPrompt();
$templatePath = $templatesPath . DIRECTORY_SEPARATOR . $templates[$result] . "/files";
(new Cli($templates[$result]))->startProject($templatePath, $userProjectPath);
}