19 declare(strict_types=1);
30 return "Migrate content styles to ILIAS 9.";
50 $this->db = $environment->
getResource(Environment::RESOURCE_DATABASE);
72 $set = $this->db->queryF(
73 "SELECT * FROM style_parameter " .
74 " WHERE type = %s AND tag = %s LIMIT 1",
78 if ($rec = $this->db->fetchAssoc($set)) {
80 $set2 = $this->db->queryF(
81 "SELECT * FROM style_parameter " .
82 " WHERE style_id = %s AND tag = %s AND class = %s AND type = %s AND parameter = %s",
83 [
"integer",
"text",
"text",
"text",
"text"],
84 [$rec[
"style_id"],
"p", $rec[
"class"],
"text_block", $rec[
"parameter"]]
86 if (!$this->db->fetchAssoc($set2)) {
90 "tag" => [
"text",
"p"]
93 "id" => [
"integer", $rec[
"id"]]
100 "uptodate" => [
"integer", 0]
103 "id" => [
"integer", $rec[
"style_id"]]
107 $this->db->manipulateF(
108 "DELETE FROM style_parameter WHERE " .
119 $set = $this->db->queryF(
120 "SELECT count(*) as amount FROM style_parameter " .
121 " WHERE type = %s AND tag = %s",
123 [
"text_block",
"div"]
125 if ($rec = $this->db->fetchAssoc($set)) {
126 return (
int) $rec[
"amount"];
prepare(Environment $environment)
Prepare the migration by means of some environment.
Class ilResourceStorageDB90.
A migration is a potentially long lasting operation that can be broken into discrete steps...
getPreconditions(Environment $environment)
Objectives the migration depend on.
step(Environment $environment)
Run one step of the migration.
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
An environment holds resources to be used in the setup process.
getDefaultAmountOfStepsPerRun()
Tell the default amount of steps to be executed for one run of the migration.
getRemainingAmountOfSteps()
Count up how many "things" need to be migrated.