mirror of
https://github.com/php/php-sdk-binary-tools.git
synced 2026-03-23 23:22:08 +01:00
Add type hints
Some are not as specific as they should be, and some may even be wrong, but since these are only type hints (not type declarations) they won't affect code execution, but rather provide some help to better understand the code – for developers as well as tooling.
This commit is contained in:
@@ -8,13 +8,23 @@ class Fetcher
|
||||
{
|
||||
use FileOps;
|
||||
|
||||
/** @var string */
|
||||
protected $host;
|
||||
protected $port;
|
||||
protected $stability;
|
||||
protected $arch;
|
||||
protected $series;
|
||||
protected $scheme;
|
||||
|
||||
/** @var int */
|
||||
protected $port;
|
||||
|
||||
/** @var ?string */
|
||||
protected $stability;
|
||||
|
||||
/** @var ?string */
|
||||
protected $arch;
|
||||
|
||||
/** @var Series */
|
||||
protected $series;
|
||||
|
||||
/** @var string */
|
||||
protected $scheme;
|
||||
|
||||
public function __construct(string $host, int $port, string $scheme = "https", string $arch = NULL, string $stability = NULL, Series $series = NULL)
|
||||
{/*{{{*/
|
||||
|
||||
@@ -8,12 +8,25 @@ class Manager
|
||||
{
|
||||
use FileOps;
|
||||
|
||||
/** @var string */
|
||||
protected $stability;
|
||||
|
||||
/** @var string */
|
||||
protected $arch;
|
||||
|
||||
/** @var string */
|
||||
protected $path;
|
||||
|
||||
/** @var Cache */
|
||||
protected $cache;
|
||||
|
||||
/** @var Series */
|
||||
protected $series;
|
||||
|
||||
/** @var Fetcher */
|
||||
protected $fetcher;
|
||||
|
||||
/** @var ?bool */
|
||||
protected $updatesFlag = NULL;
|
||||
|
||||
public function __construct(string $path, string $stability, string $arch)
|
||||
|
||||
@@ -8,9 +8,16 @@ class Package
|
||||
{
|
||||
use FileOps;
|
||||
|
||||
/** @var string */
|
||||
protected $name;
|
||||
|
||||
/** @var Series */
|
||||
protected $series;
|
||||
|
||||
/** @var Fetcher */
|
||||
protected $fetcher;
|
||||
|
||||
/** @var string */
|
||||
protected $filepath;
|
||||
|
||||
public function __construct(string $name, Series $series, Fetcher $fetcher)
|
||||
|
||||
@@ -8,10 +8,19 @@ use SDK\Exception;
|
||||
|
||||
class Series
|
||||
{
|
||||
/** @var ?Fetcher */
|
||||
protected $fetcher;
|
||||
|
||||
/** @var string */
|
||||
protected $stability;
|
||||
|
||||
/** @var string */
|
||||
protected $arch;
|
||||
|
||||
/** @var string */
|
||||
protected $rawData;
|
||||
|
||||
/** @var Cache */
|
||||
protected $cache;
|
||||
|
||||
public function __construct(string $stability, string $arch, Cache $cache, Fetcher $fetcher = NULL)
|
||||
@@ -59,6 +68,7 @@ class Series
|
||||
return "$base/series/$file";
|
||||
}/*}}}*/
|
||||
|
||||
/** @return array<string>|string */
|
||||
public function getData(bool $raw = false, bool $cache = true)
|
||||
{/*{{{*/
|
||||
if ($cache && $this->rawData) {
|
||||
|
||||
@@ -7,13 +7,25 @@ use SDK\{Config as SDKConfig, Exception};
|
||||
|
||||
abstract class PHP
|
||||
{
|
||||
/** @var string */
|
||||
protected $php_root;
|
||||
|
||||
/** @var string */
|
||||
protected $php_ext_root;
|
||||
|
||||
/** @var string */
|
||||
protected $opcache_file_cache;
|
||||
|
||||
/** @var string */
|
||||
protected $id;
|
||||
|
||||
/** @var string */
|
||||
protected $scenario;
|
||||
|
||||
/** @var \SDK\Build\PGO\Config */
|
||||
protected $conf;
|
||||
|
||||
/** @return void */
|
||||
protected function setupPaths()
|
||||
{
|
||||
$this->php_root = $this->getRootDir();
|
||||
@@ -38,6 +50,7 @@ abstract class PHP
|
||||
return !file_exists("Makefile") && file_exists("php.exe");
|
||||
}
|
||||
|
||||
/** @return array<string,string> */
|
||||
protected function createEnv() : array
|
||||
{
|
||||
$env = getenv();
|
||||
@@ -133,6 +146,7 @@ abstract class PHP
|
||||
}
|
||||
|
||||
/* Need to cleanup it somewhere. */
|
||||
/** @return string */
|
||||
public function getIniFilename()
|
||||
{
|
||||
$ret = tempnam(sys_get_temp_dir(), "ini");
|
||||
@@ -165,6 +179,7 @@ abstract class PHP
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/** @return string */
|
||||
protected function getIniTplFilename()
|
||||
{
|
||||
$tpl_path = $this->conf->getTplDir("php");
|
||||
@@ -180,6 +195,7 @@ abstract class PHP
|
||||
return $construct;
|
||||
}
|
||||
|
||||
/** @param array<string,string> $extra_env */
|
||||
public function exec(string $php_cmd, string $args = NULL, array $extra_env = array()) : int
|
||||
{
|
||||
$env = $this->createEnv();
|
||||
|
||||
@@ -6,7 +6,10 @@ use SDK\Build\PGO\Interfaces;
|
||||
|
||||
abstract class Server
|
||||
{
|
||||
/** @var string */
|
||||
protected $name;
|
||||
|
||||
/** @var Interfaces\PHP */
|
||||
protected $php;
|
||||
|
||||
public function getName() : string
|
||||
|
||||
@@ -13,9 +13,13 @@ abstract class TrainingCase implements Interfaces\TrainingCase
|
||||
const TYPE_WEB = "web";
|
||||
const TYPE_CLI = "cli";
|
||||
|
||||
/** @var array<mixed> */
|
||||
protected $stat = array();
|
||||
|
||||
/** @var \SDK\Build\PGO\Config */
|
||||
protected $conf;
|
||||
|
||||
/** @var mixed */
|
||||
protected $php;
|
||||
|
||||
abstract public function getName() : string;
|
||||
|
||||
@@ -11,11 +11,22 @@ class Config
|
||||
const MODE_REINIT = 2; /* currently unused */
|
||||
const MODE_CHECK_INIT = 3;
|
||||
|
||||
/** @var int */
|
||||
protected $mode;
|
||||
|
||||
/** @var int */
|
||||
protected $last_port = 8081;
|
||||
|
||||
/** @var array<string,mixed> */
|
||||
protected $sections = array();
|
||||
|
||||
/** @var string */
|
||||
protected $scenario = "default";
|
||||
|
||||
/** @var array<mixed> */
|
||||
protected $tpl_vars = array();
|
||||
|
||||
/** @var array<mixed> */
|
||||
protected $srv = array();
|
||||
|
||||
public function __construct(int $mode = self::MODE_RUN)
|
||||
@@ -67,6 +78,7 @@ class Config
|
||||
}
|
||||
}
|
||||
|
||||
/** @return bool */
|
||||
public function isInitialized()
|
||||
{
|
||||
/* XXX Could be some better check. */
|
||||
@@ -161,6 +173,7 @@ class Config
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/** @param string ...$args */
|
||||
public function sectionItemExists(...$args) : bool
|
||||
{
|
||||
$i = 0;
|
||||
@@ -178,6 +191,10 @@ class Config
|
||||
return $i == count($args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string ...$args
|
||||
* @return mixed
|
||||
*/
|
||||
public function getSectionItem(...$args)
|
||||
{
|
||||
$i = 0;
|
||||
@@ -199,6 +216,7 @@ class Config
|
||||
return $it;
|
||||
}
|
||||
|
||||
/** @param string|int ...$args */
|
||||
public function setSectionItem(...$args) : void
|
||||
{
|
||||
$val = array_pop($args);
|
||||
@@ -238,6 +256,7 @@ class Config
|
||||
}
|
||||
}
|
||||
|
||||
/** @param string ...$args */
|
||||
public function buildTplVarName(...$args) : string
|
||||
{
|
||||
$tpl_k = array("PHP_SDK_PGO");
|
||||
@@ -249,6 +268,7 @@ class Config
|
||||
return implode("_", $tpl_k);
|
||||
}
|
||||
|
||||
/** @param array<string,mixed> $section */
|
||||
protected function importTplVars(string $section_name, array $section) : void
|
||||
{
|
||||
foreach($section as $k0 => $v0) {
|
||||
@@ -266,6 +286,7 @@ class Config
|
||||
}
|
||||
}
|
||||
|
||||
/** @param array<mixed> $additional_vars */
|
||||
public function processTpl(string $s, array $additional_vars = array()) : string
|
||||
{
|
||||
$vars = array_merge($this->tpl_vars, $additional_vars);
|
||||
@@ -275,6 +296,7 @@ class Config
|
||||
return $s;
|
||||
}
|
||||
|
||||
/** @param array<mixed> $additional_vars */
|
||||
public function processTplFile(string $tpl_fn, string $dst_fn, array $additional_vars = array()) : void
|
||||
{
|
||||
if (!file_exists($tpl_fn)) {
|
||||
@@ -293,6 +315,7 @@ class Config
|
||||
}
|
||||
}
|
||||
|
||||
/** @return string */
|
||||
public function getWorkSectionsFilename()
|
||||
{
|
||||
return $this->getWorkDir() . DIRECTORY_SEPARATOR . "phpsdk_pgo.json";
|
||||
@@ -338,6 +361,10 @@ class Config
|
||||
return getenv("PHP_SDK_PHP_CMD");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Interfaces\Server $item
|
||||
* @return void
|
||||
*/
|
||||
public function addSrv($item) : void
|
||||
{
|
||||
$name = strtolower($item->getName());
|
||||
@@ -350,6 +377,7 @@ class Config
|
||||
$this->srv[$name] = $item;
|
||||
}
|
||||
|
||||
/** @return array<string,Interfaces\Server>|Interfaces\Server|null */
|
||||
public function getSrv(?string $name = NULL)
|
||||
{
|
||||
$ret = NULL;
|
||||
|
||||
@@ -13,11 +13,19 @@ use SDK\Build\PGO\Tool\{PGO, PackageWorkman};
|
||||
|
||||
class Controller
|
||||
{
|
||||
/** @var string */
|
||||
protected $cmd;
|
||||
|
||||
/** @var ?string */
|
||||
protected $scenario;
|
||||
|
||||
/** @var PGOConfig */
|
||||
protected $conf;
|
||||
|
||||
/** @var array<string>|null */
|
||||
protected $cases;
|
||||
|
||||
/** @param array<string>|null $cases */
|
||||
public function __construct(string $cmd, ?string $scenario, ?array $cases)
|
||||
{
|
||||
$this->cmd = $cmd;
|
||||
@@ -29,6 +37,7 @@ class Controller
|
||||
$this->cases = $cases;
|
||||
}
|
||||
|
||||
/** @return mixed */
|
||||
protected function vitalizeSrv()
|
||||
{
|
||||
$all = $this->conf->getSrv("all");
|
||||
@@ -47,6 +56,10 @@ class Controller
|
||||
return $all;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $cmd
|
||||
* @return PGOConfig
|
||||
*/
|
||||
protected function setupConfig($cmd)
|
||||
{
|
||||
switch ($cmd) {
|
||||
@@ -68,6 +81,10 @@ class Controller
|
||||
return $cnf;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $force
|
||||
* @return void
|
||||
*/
|
||||
public function handle($force)
|
||||
{
|
||||
/*$mode = (int)("init" !== $this->cmd);
|
||||
@@ -146,6 +163,7 @@ class Controller
|
||||
}
|
||||
}
|
||||
|
||||
/** @return void */
|
||||
public function init(bool $force = false)
|
||||
{
|
||||
echo "\nInitializing PGO training environment.\n\n";
|
||||
@@ -179,11 +197,13 @@ class Controller
|
||||
echo "PGO training environment Initialization complete.\n";
|
||||
}
|
||||
|
||||
/** @return bool */
|
||||
public function isInitialized()
|
||||
{
|
||||
return $this->conf->isinitialized();
|
||||
}
|
||||
|
||||
/** @return void */
|
||||
public function train()
|
||||
{
|
||||
if (!$this->isInitialized()) {
|
||||
@@ -232,6 +252,7 @@ class Controller
|
||||
echo "PGO training complete.\n";
|
||||
}
|
||||
|
||||
/** @return void */
|
||||
public function up()
|
||||
{
|
||||
|
||||
@@ -250,6 +271,7 @@ class Controller
|
||||
echo "The PGO environment is up.\n";
|
||||
}
|
||||
|
||||
/** @return void */
|
||||
public function down(bool $force = false)
|
||||
{
|
||||
if (!$this->isInitialized()) {
|
||||
|
||||
@@ -12,5 +12,7 @@ interface Server
|
||||
public function up() : void;
|
||||
public function down(bool $force = false) : void;
|
||||
public function getName() : string;
|
||||
|
||||
/** @return \SDK\Build\PGO\Interfaces\PHP */
|
||||
public function getPhp();
|
||||
}
|
||||
|
||||
@@ -9,5 +9,10 @@ interface HTTP extends Interfaces\Server
|
||||
{
|
||||
public function __construct(Config $conf, Interfaces\PHP $php);
|
||||
public function getPhp() : Interfaces\PHP;
|
||||
|
||||
/**
|
||||
* @param array<mixed> $tpl_vars
|
||||
* @return void
|
||||
*/
|
||||
public function addServer(string $part_tpl_fn, array $tpl_vars = array());
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ class FCGI extends Abstracts\PHP implements Interfaces\PHP
|
||||
{
|
||||
use FileOps;
|
||||
|
||||
/** @var bool */
|
||||
protected $is_tcp;
|
||||
|
||||
public function __construct(PGOConfig $conf, bool $is_tcp)
|
||||
|
||||
@@ -12,8 +12,13 @@ class MariaDB extends Server implements DB
|
||||
{
|
||||
use FileOps;
|
||||
|
||||
/** @var PGOConfig */
|
||||
protected $conf;
|
||||
|
||||
/** @var string */
|
||||
protected $base;
|
||||
|
||||
/** @var string */
|
||||
protected $name = "MariaDB";
|
||||
|
||||
public function __construct(PGOConfig $conf)
|
||||
@@ -22,6 +27,7 @@ class MariaDB extends Server implements DB
|
||||
$this->base = $conf->getSrvDir(strtolower($this->name));
|
||||
}
|
||||
|
||||
/** @return void */
|
||||
protected function setupDist()
|
||||
{
|
||||
/* pass */
|
||||
|
||||
@@ -12,9 +12,16 @@ class NGINX extends Abstracts\Server implements Interfaces\Server\HTTP
|
||||
{
|
||||
use FileOps;
|
||||
|
||||
/** @var string */
|
||||
protected $name = "NGINX";
|
||||
|
||||
/** @var PGOConfig */
|
||||
protected $conf;
|
||||
|
||||
/** @var string */
|
||||
protected $base;
|
||||
|
||||
/** @var Interfaces\PHP */
|
||||
protected $php;
|
||||
|
||||
public function __construct(PGOConfig $conf, Interfaces\PHP $php)
|
||||
@@ -125,6 +132,10 @@ class NGINX extends Abstracts\Server implements Interfaces\Server\HTTP
|
||||
}
|
||||
|
||||
/* Use only for init phase! */
|
||||
/**
|
||||
* @param array<mixed> $tpl_vars
|
||||
* @return void
|
||||
*/
|
||||
public function addServer(string $part_tpl_fn, array $tpl_vars = array())
|
||||
{
|
||||
if (!file_exists($part_tpl_fn)) {
|
||||
|
||||
@@ -12,9 +12,16 @@ class PostgreSQL extends Server implements DB
|
||||
{
|
||||
use FileOps;
|
||||
|
||||
/** @var PGOConfig */
|
||||
protected $conf;
|
||||
|
||||
/** @var string */
|
||||
protected $base;
|
||||
|
||||
/** @var string */
|
||||
protected $data_dir;
|
||||
|
||||
/** @var string */
|
||||
protected $name = "PostgreSQL";
|
||||
|
||||
public function __construct(PGOConfig $conf)
|
||||
@@ -24,6 +31,7 @@ class PostgreSQL extends Server implements DB
|
||||
$this->data_dir = $this->base . DIRECTORY_SEPARATOR . "data";
|
||||
}
|
||||
|
||||
/** @return void */
|
||||
protected function setupDist()
|
||||
{
|
||||
$user = $this->conf->getSectionItem($this->name, "user");
|
||||
|
||||
@@ -8,8 +8,13 @@ use SDK\Build\PGO\Interfaces;
|
||||
|
||||
class PGO
|
||||
{
|
||||
/** @var Interfaces\PHP */
|
||||
protected $php;
|
||||
|
||||
/** @var PGOConfig */
|
||||
protected $conf;
|
||||
|
||||
/** @var int */
|
||||
protected $idx = 0;
|
||||
|
||||
public function __construct(PGOConfig $conf, Interfaces\PHP $php)
|
||||
@@ -34,6 +39,7 @@ class PGO
|
||||
return $dn . DIRECTORY_SEPARATOR . $bn . ".pgd";
|
||||
}
|
||||
|
||||
/** @return array<string> */
|
||||
protected function getWorkItems() : array
|
||||
{
|
||||
$exe = glob($this->php->getRootDir() . DIRECTORY_SEPARATOR . "*.exe");
|
||||
|
||||
@@ -10,6 +10,7 @@ class PackageWorkman
|
||||
{
|
||||
use FileOps;
|
||||
|
||||
/** @var PGOConfig */
|
||||
protected $conf;
|
||||
|
||||
public function __construct(PGOConfig $conf)
|
||||
|
||||
@@ -8,7 +8,10 @@ use SDK\Build\PGO\Interfaces\TrainingCase;
|
||||
|
||||
class Training
|
||||
{
|
||||
/** @var PGOConfig */
|
||||
protected $conf;
|
||||
|
||||
/** @var TrainingCase */
|
||||
protected $t_case;
|
||||
|
||||
public function __construct(PGOConfig $conf, TrainingCase $t_case)
|
||||
@@ -27,6 +30,7 @@ class Training
|
||||
return $this->t_case;
|
||||
}
|
||||
|
||||
/** @param array<string,mixed> $stat */
|
||||
public function runWeb(int $max_runs, ?array &$stat = array()) : void
|
||||
{
|
||||
$url_list_fn = $this->t_case->getJobFilename();
|
||||
@@ -105,6 +109,7 @@ class Training
|
||||
}
|
||||
|
||||
/* TODO Extend with number runs. */
|
||||
/** @param array<string,mixed> $stat */
|
||||
public function run(int $max_runs = 1, ?array &$stat = array()) : void
|
||||
{
|
||||
$type = $this->t_case->getType();
|
||||
|
||||
@@ -4,12 +4,21 @@ namespace SDK\Build\PGO;
|
||||
|
||||
use SDK\Build\PGO\Config as PGOConfig;
|
||||
|
||||
|
||||
/**
|
||||
* @implements \Iterator<?string,Interfaces\TrainingCase>
|
||||
*/
|
||||
class TrainingCaseIterator implements \Iterator
|
||||
{
|
||||
/** @var PGOConfig */
|
||||
protected $conf;
|
||||
|
||||
/** @var array<string> */
|
||||
protected $items = array();
|
||||
|
||||
/** @var int */
|
||||
protected $idx;
|
||||
|
||||
/** @var object */
|
||||
protected $el;
|
||||
|
||||
public function __construct(PGOConfig $conf)
|
||||
|
||||
@@ -4,7 +4,10 @@ namespace SDK;
|
||||
|
||||
class Cache
|
||||
{
|
||||
/** @var string */
|
||||
protected $id;
|
||||
|
||||
/** @var string */
|
||||
protected $hash;
|
||||
|
||||
public function __construct(string $id)
|
||||
|
||||
@@ -7,20 +7,40 @@ use SDK\Build\Dependency\Fetcher;
|
||||
class Config
|
||||
{
|
||||
/* Config variables. */
|
||||
|
||||
/** @var string */
|
||||
protected static $depsHost = 'downloads.php.net';
|
||||
|
||||
/** @var int */
|
||||
protected static $depsPort = 443;
|
||||
|
||||
/** @var string */
|
||||
protected static $depsUriScheme = "https";
|
||||
|
||||
/** @var string */
|
||||
protected static $depsBaseUri = "/~windows/php-sdk/deps";
|
||||
|
||||
/** @var string */
|
||||
protected static $sdkNugetFeedUrl = "http://127.0.0.1/sdk/nuget"; // experimental?
|
||||
|
||||
/** @var array<mixed> */
|
||||
protected static $knownBranches = array ();
|
||||
|
||||
/* Helper props and methods. */
|
||||
|
||||
/** @var ?string */
|
||||
protected static $currentBranchName = NULL;
|
||||
|
||||
/** @var ?string */
|
||||
protected static $currentArchName = NULL;
|
||||
|
||||
/** @var ?string */
|
||||
protected static $currentCrtName = NULL;
|
||||
|
||||
/** @var ?string */
|
||||
protected static $currentStabilityName = NULL;
|
||||
|
||||
/** @var ?string */
|
||||
protected static $depsLocalPath = NULL;
|
||||
|
||||
public static function getDepsHost() : string
|
||||
@@ -134,6 +154,7 @@ class Config
|
||||
return self::$currentStabilityName;
|
||||
} /*}}}*/
|
||||
|
||||
/** @return array<mixed> */
|
||||
public static function getKnownBranches() : array
|
||||
{/*{{{*/
|
||||
if (empty(self::$knownBranches)) {
|
||||
@@ -254,6 +275,7 @@ class Config
|
||||
return self::$currentBranchName;
|
||||
}/*}}}*/
|
||||
|
||||
/** @return array<mixed> */
|
||||
public static function getCurrentBranchData() : array
|
||||
{/*{{{*/
|
||||
$ret = array();
|
||||
|
||||
@@ -4,10 +4,19 @@ namespace SDK;
|
||||
|
||||
class Lock
|
||||
{
|
||||
/** @var ?resource */
|
||||
protected $fd;
|
||||
|
||||
/** @var string */
|
||||
protected $fn;
|
||||
|
||||
/** @var bool */
|
||||
protected $locked = false;
|
||||
|
||||
/** @var bool|int */
|
||||
protected $wouldBlock = false;
|
||||
|
||||
/** @var bool|int */
|
||||
protected $shared = false;
|
||||
|
||||
public function __construct(string $tag, bool $auto = true, bool $autoShared = false)
|
||||
|
||||
@@ -11,9 +11,16 @@ use SDK\Build\PGO\Tool;
|
||||
|
||||
class TrainingCaseHandler extends Abstracts\TrainingCase implements Interfaces\TrainingCase
|
||||
{
|
||||
/** @var string */
|
||||
protected $base;
|
||||
|
||||
/** @var ?Interfaces\Server $nginx */
|
||||
protected $nginx;
|
||||
|
||||
/** @var mixed */
|
||||
protected $php;
|
||||
|
||||
/** @var int */
|
||||
protected $max_runs = 8;
|
||||
|
||||
public function __construct(Config $conf, ?Interfaces\Server $nginx, ?Interfaces\Server\DB $maria)
|
||||
@@ -65,6 +72,7 @@ class TrainingCaseHandler extends Abstracts\TrainingCase implements Interfaces\T
|
||||
$this->nginx->addServer($tpl_fn, $vars);
|
||||
}
|
||||
|
||||
/** @return void */
|
||||
public function setupUrls()
|
||||
{
|
||||
$this->nginx->up();
|
||||
|
||||
@@ -11,10 +11,19 @@ use SDK\Build\PGO\Tool;
|
||||
|
||||
class TrainingCaseHandler extends Abstracts\TrainingCase implements Interfaces\TrainingCase
|
||||
{
|
||||
/** @var string */
|
||||
protected $base;
|
||||
|
||||
/** @var ?Interfaces\Server $nginx */
|
||||
protected $nginx;
|
||||
|
||||
/** @var mixed */
|
||||
protected $php;
|
||||
|
||||
/** @var ?Interfaces\Server\DB */
|
||||
protected $maria;
|
||||
|
||||
/** @var int */
|
||||
protected $max_runs = 4;
|
||||
|
||||
public function __construct(Config $conf, ?Interfaces\Server $nginx, ?Interfaces\Server\DB $maria)
|
||||
@@ -99,6 +108,7 @@ class TrainingCaseHandler extends Abstracts\TrainingCase implements Interfaces\T
|
||||
$this->maria->down(true);
|
||||
}
|
||||
|
||||
/** @return void */
|
||||
public function setupUrls()
|
||||
{
|
||||
$this->maria->up();
|
||||
|
||||
@@ -11,9 +11,16 @@ use SDK\Build\PGO\Tool;
|
||||
|
||||
class TrainingCaseHandler extends Abstracts\TrainingCase implements Interfaces\TrainingCase
|
||||
{
|
||||
/** @var string */
|
||||
protected $base;
|
||||
|
||||
/** @var ?Interfaces\Server $nginx */
|
||||
protected $nginx;
|
||||
|
||||
/** @var mixed */
|
||||
protected $php;
|
||||
|
||||
/** @var int */
|
||||
protected $max_runs = 4;
|
||||
|
||||
public function __construct(Config $conf, ?Interfaces\Server $nginx, ?Interfaces\Server\DB $srv_db)
|
||||
@@ -82,6 +89,7 @@ class TrainingCaseHandler extends Abstracts\TrainingCase implements Interfaces\T
|
||||
$php->exec($cmd);
|
||||
}
|
||||
|
||||
/** @return void */
|
||||
public function setupUrls()
|
||||
{
|
||||
$this->nginx->up();
|
||||
|
||||
@@ -11,10 +11,19 @@ use SDK\Build\PGO\Tool;
|
||||
|
||||
class TrainingCaseHandler extends Abstracts\TrainingCase implements Interfaces\TrainingCase
|
||||
{
|
||||
/** @var string */
|
||||
protected $base;
|
||||
|
||||
/** @var ?Interfaces\Server $nginx */
|
||||
protected $nginx;
|
||||
|
||||
/** @var ?Interfaces\Server\DB */
|
||||
protected $maria;
|
||||
|
||||
/** @var mixed */
|
||||
protected $php;
|
||||
|
||||
/** @var int */
|
||||
protected $max_runs = 12;
|
||||
|
||||
public function __construct(Config $conf, ?Interfaces\Server $nginx, ?Interfaces\Server\DB $maria)
|
||||
@@ -119,6 +128,7 @@ class TrainingCaseHandler extends Abstracts\TrainingCase implements Interfaces\T
|
||||
|
||||
}
|
||||
|
||||
/** @return void */
|
||||
public function setupUrls()
|
||||
{
|
||||
$url = "http://" . $this->getHttpHost() . ":" . $this->getHttpPort();
|
||||
|
||||
@@ -11,9 +11,16 @@ use SDK\Build\PGO\Tool;
|
||||
|
||||
class TrainingCaseHandler extends Abstracts\TrainingCase implements Interfaces\TrainingCase
|
||||
{
|
||||
/** @var string */
|
||||
protected $base;
|
||||
|
||||
/** @var ?Interfaces\Server $nginx */
|
||||
protected $nginx;
|
||||
|
||||
/** @var mixed */
|
||||
protected $php;
|
||||
|
||||
/** @var int */
|
||||
protected $max_runs = 4;
|
||||
|
||||
public function __construct(Config $conf, ?Interfaces\Server $nginx, ?Interfaces\Server\DB $srv_db)
|
||||
@@ -61,6 +68,7 @@ class TrainingCaseHandler extends Abstracts\TrainingCase implements Interfaces\T
|
||||
$this->nginx->addServer($tpl_fn, $vars);
|
||||
}
|
||||
|
||||
/** @return void */
|
||||
public function setupUrls()
|
||||
{
|
||||
$this->nginx->up();
|
||||
|
||||
@@ -11,10 +11,19 @@ use SDK\Build\PGO\Tool;
|
||||
|
||||
class TrainingCaseHandler extends Abstracts\TrainingCase implements Interfaces\TrainingCase
|
||||
{
|
||||
/** @var string */
|
||||
protected $base;
|
||||
|
||||
/** @var ?Interfaces\Server $nginx */
|
||||
protected $nginx;
|
||||
|
||||
/** @var ?Interfaces\Server\DB */
|
||||
protected $maria;
|
||||
|
||||
/** @var mixed */
|
||||
protected $php;
|
||||
|
||||
/** @var int */
|
||||
protected $max_runs = 4;
|
||||
|
||||
public function __construct(Config $conf, ?Interfaces\Server $nginx, ?Interfaces\Server\DB $srv_db)
|
||||
@@ -80,6 +89,7 @@ class TrainingCaseHandler extends Abstracts\TrainingCase implements Interfaces\T
|
||||
$this->nginx->addServer($tpl_fn, $vars);
|
||||
}
|
||||
|
||||
/** @return void */
|
||||
public function setupUrls()
|
||||
{
|
||||
$this->maria->up();
|
||||
|
||||
@@ -11,10 +11,19 @@ use SDK\Build\PGO\Tool;
|
||||
|
||||
class TrainingCaseHandler extends Abstracts\TrainingCase implements Interfaces\TrainingCase
|
||||
{
|
||||
/** @var string */
|
||||
protected $base;
|
||||
|
||||
/** @var ?Interfaces\Server $nginx */
|
||||
protected $nginx;
|
||||
|
||||
/** @var ?Interfaces\Server\DB */
|
||||
protected $maria;
|
||||
|
||||
/** @var mixed */
|
||||
protected $php;
|
||||
|
||||
/** @var int */
|
||||
protected $max_runs = 4;
|
||||
|
||||
public function __construct(Config $conf, ?Interfaces\Server $nginx, ?Interfaces\Server\DB $maria)
|
||||
@@ -106,6 +115,7 @@ class TrainingCaseHandler extends Abstracts\TrainingCase implements Interfaces\T
|
||||
|
||||
}
|
||||
|
||||
/** @return void */
|
||||
public function setupUrls()
|
||||
{
|
||||
$this->maria->up();
|
||||
|
||||
Reference in New Issue
Block a user