mirror of
https://github.com/php-win-ext/php-sdk-binary-tools.git
synced 2026-03-24 17:12:12 +01:00
Compare commits
14 Commits
php-sdk-2.
...
php-sdk-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70c3290c08 | ||
|
|
d84784d37a | ||
|
|
8ad74abf3f | ||
|
|
9ad145c154 | ||
|
|
f3001d950e | ||
|
|
01ab6a1bad | ||
|
|
659fb3a71d | ||
|
|
d7dcab4c2f | ||
|
|
15ec0845c4 | ||
|
|
a1bab3dc92 | ||
|
|
08b81a4ffc | ||
|
|
569072060e | ||
|
|
b13a2df162 | ||
|
|
96fa91e16a |
@@ -6,8 +6,8 @@ use SDK\Config;
|
||||
use SDK\Exception;
|
||||
use SDK\Build\PGO\Controller;
|
||||
|
||||
$sopt = "itudhs:fr";
|
||||
$lopt = array("init", "train", "up", "down", "help", "scenario:", "force", "ready");
|
||||
$sopt = "itudhs:frc:";
|
||||
$lopt = array("init", "train", "up", "down", "help", "scenario:", "force", "ready", "cases:");
|
||||
|
||||
$cmd = NULL;
|
||||
/* TODO For now we simply check the current php build, this could be extended to take arbitrary binaries. */
|
||||
@@ -15,6 +15,7 @@ $deps_root = NULL;
|
||||
$php_root = NULL;
|
||||
$scenario = NULL;
|
||||
$force = false;
|
||||
$cases = NULL;
|
||||
|
||||
try {
|
||||
$opt = getopt($sopt, $lopt);
|
||||
@@ -47,6 +48,12 @@ try {
|
||||
case "force":
|
||||
$force = true;
|
||||
break;
|
||||
/* XXX This option is for now only integrated for training. It
|
||||
would make sense to integrate it also with init. */
|
||||
case "c":
|
||||
case "cases":
|
||||
$cases = explode(",", $val);
|
||||
break;
|
||||
case "h": case "help":
|
||||
usage(0);
|
||||
break;
|
||||
@@ -73,7 +80,7 @@ try {
|
||||
}
|
||||
}
|
||||
|
||||
$controller = new Controller($cmd, $scenario);
|
||||
$controller = new Controller($cmd, $scenario, $cases);
|
||||
$controller->handle($force);
|
||||
|
||||
if ("check_init" == $cmd) {
|
||||
@@ -105,6 +112,7 @@ function usage(int $code = -1)
|
||||
echo " -d --down Shutdown training environment.", PHP_EOL;
|
||||
echo " -f --force Force requested operation. Not every option can be forced.", PHP_EOL;
|
||||
echo " -s --scenario Run training with a specified scenario.", PHP_EOL;
|
||||
echo " -c --cases Run training with specified cases only. If omited, all the active cases will be used.", PHP_EOL;
|
||||
|
||||
/*echo " -p --php-root PHP binary to train.", PHP_EOL;*/
|
||||
|
||||
|
||||
BIN
bin/vswhere.exe
BIN
bin/vswhere.exe
Binary file not shown.
@@ -17,8 +17,9 @@ class Controller
|
||||
protected $cmd;
|
||||
protected $scenario;
|
||||
protected $conf;
|
||||
protected $cases;
|
||||
|
||||
public function __construct(string $cmd, ?string $scenario)
|
||||
public function __construct(string $cmd, ?string $scenario, ?array $cases)
|
||||
{
|
||||
$this->cmd = $cmd;
|
||||
|
||||
@@ -26,6 +27,7 @@ class Controller
|
||||
$scenario = "default";
|
||||
}
|
||||
$this->scenario = $scenario;
|
||||
$this->cases = $cases;
|
||||
}
|
||||
|
||||
protected function vitalizeSrv()
|
||||
@@ -204,10 +206,24 @@ class Controller
|
||||
$pgo->clean();
|
||||
unset($pgo);
|
||||
|
||||
$cases = $this->cases;
|
||||
foreach (new TrainingCaseIterator($this->conf) as $handler) {
|
||||
$name = $handler->getName();
|
||||
/* Just a white list handling for now. */
|
||||
if (is_array($cases)) {
|
||||
if (!in_array($name, $cases)) {
|
||||
continue;
|
||||
}
|
||||
$key = array_search($name, $cases);
|
||||
unset($cases[$key]);
|
||||
}
|
||||
|
||||
echo "\n";
|
||||
$handler->run();
|
||||
}
|
||||
if (is_array($cases) && !empty($cases)) {
|
||||
echo "\n\033[31m WARNING: The cases " . implode(",", $cases) . " don't exist and was ignored!\033[0m\n\n";
|
||||
}
|
||||
|
||||
/* All the PGC files are merged, simply clean them out. */
|
||||
$pgo = new PGO($this->conf, $php);
|
||||
|
||||
@@ -130,7 +130,11 @@ class Config
|
||||
{/*{{{*/
|
||||
if (empty(self::$knownBranches)) {
|
||||
$cache_file = "known_branches.txt";
|
||||
$cache = new Cache(self::getDepsLocalPath());
|
||||
$deps_path = self::getDepsLocalPath();
|
||||
if (!$deps_path) {
|
||||
throw new Exception("Couldn't determine dependencies path. Please either switch to the PHP source root or use -d option.");
|
||||
}
|
||||
$cache = new Cache($deps_path);
|
||||
$fetcher = new Fetcher(self::$depsHost, self::$depsPort, self::$depsUriScheme);
|
||||
|
||||
$tmp = $fetcher->getByUri(self::$depsBaseUri . "/series/");
|
||||
|
||||
@@ -16,7 +16,7 @@ class TrainingCaseHandler extends Abstracts\TrainingCase implements Interfaces\T
|
||||
protected $nginx;
|
||||
protected $maria;
|
||||
protected $php;
|
||||
protected $max_runs = 8;
|
||||
protected $max_runs = 12;
|
||||
|
||||
public function __construct(Config $conf, ?Interfaces\Server $nginx, ?Interfaces\Server\DB $maria)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user