mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Reorganize method position inside class
For consistency with the rest of private methods in the class,
"isContainerRegistered" is moved below the only public method in which
it is used ("cleanUp").
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
parent
03233b1d58
commit
4d71d37fe3
1 changed files with 15 additions and 15 deletions
|
|
@ -191,6 +191,21 @@ class NextcloudTestServerDockerHelper {
|
|||
$this->executeDockerCommand("rm --volumes --force " . $this->containerName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the container exists (no matter its state) or not.
|
||||
*
|
||||
* @return boolean true if the container exists, false otherwise.
|
||||
* @throws \Exception if the Docker command failed to execute.
|
||||
*/
|
||||
private function isContainerRegistered() {
|
||||
// With the "--quiet" option "docker ps" only shows the ID of the
|
||||
// matching containers, without table headers. Therefore, if the
|
||||
// container does not exist the output will be empty (not even a new
|
||||
// line, as the last line of output returned by "executeDockerCommand"
|
||||
// does not include a trailing new line character).
|
||||
return $this->executeDockerCommand("ps --all --quiet --filter 'name=" . $this->containerName . "'") !== "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the base URL of the Nextcloud test server.
|
||||
*
|
||||
|
|
@ -214,21 +229,6 @@ class NextcloudTestServerDockerHelper {
|
|||
return $this->executeDockerCommand("port " . $this->containerName . " 80");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the container exists (no matter its state) or not.
|
||||
*
|
||||
* @return boolean true if the container exists, false otherwise.
|
||||
* @throws \Exception if the Docker command failed to execute.
|
||||
*/
|
||||
private function isContainerRegistered() {
|
||||
// With the "--quiet" option "docker ps" only shows the ID of the
|
||||
// matching containers, without table headers. Therefore, if the
|
||||
// container does not exist the output will be empty (not even a new
|
||||
// line, as the last line of output returned by "executeDockerCommand"
|
||||
// does not include a trailing new line character).
|
||||
return $this->executeDockerCommand("ps --all --quiet --filter 'name=" . $this->containerName . "'") !== "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes the given Docker command.
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue