13 return hash(
"sha256", implode(
"-", [
15 $this->config->getHost(),
16 $this->config->getPort(),
17 $this->config->getDatabase()
23 return "The database is populated with ILIAS-tables.";
33 if ($environment->getResource(Setup\Environment::RESOURCE_DATABASE)) {
37 new \ilDatabaseExistsObjective($this->config)
43 $db = $environment->
getResource(Setup\Environment::RESOURCE_DATABASE);
49 $path_to_db_dump = $this->config->getPathToDBDump();
50 if (!is_file(realpath($path_to_db_dump)) ||
51 !is_readable(realpath($path_to_db_dump))) {
52 throw new Setup\UnachievableException(
53 "Cannot read database dump file: $path_to_db_dump" 57 $sql = file_get_contents(realpath($path_to_db_dump));
58 $statement = $db->prepareManip($sql);
59 $db->execute($statement);
66 $probe_tables = [
'usr_data',
'object_data',
'object_reference'];
67 $number_of_probe_tables = count($probe_tables);
69 $number_of_tables = count($tables);
72 $number_of_tables > self::MIN_NUMBER_OF_ILIAS_TABLES
73 && count(array_intersect($tables, $probe_tables)) == $number_of_probe_tables;
getPreconditions(Setup\Environment $environment)
achieve(Setup\Environment $environment)
const MIN_NUMBER_OF_ILIAS_TABLES
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
isDatabasePopulated(\ilDBInterface $db)
An environment holds resources to be used in the setup process.