public function up()

in lib/php/libsdk/SDK/Build/PGO/Server/MariaDB.php [48:75]


	public function up() : void
	{
		echo "Starting " . $this->name . ".\n";

		$cwd = getcwd();

		chdir($this->base);

		$port = $this->conf->getSectionItem($this->name, "port");

		//$h = popen("start /b .\\bin\\mysqld.exe --port=$port >nul 2>&1", "r");
		$h = popen("start /b .\\bin\\mysqld.exe --port=$port 2>&1", "r");

		if (!is_resource($h)) {
			chdir($cwd);
			throw new Exception("Failed to start MariaDB.");
		}
		sleep(3);

		while (!feof($h)) {
			echo fread($h, 1024);
		}
		pclose($h);

		chdir($cwd);

		echo $this->name . " started.\n";
	}