64 $this->db =
$DIC->database();
80 final public function init(
string $a_entity,
string $a_schema_version): void
82 $this->entity = $a_entity;
83 $this->schema_version = $a_schema_version;
84 $this->data = array();
96 abstract protected function getTypes(
string $a_entity,
string $a_version): array;
98 abstract protected function getXmlNamespace(
string $a_entity,
string $a_schema_version): string;
112 $this->relative_export_dir = $a_relative;
113 $this->absolute_export_dir = $a_absolute;
118 $this->import_directory = $a_val;
128 $this->ds_prefix = $a_val;
150 bool $a_convert_to_leading_upper =
true,
155 $set =
$ilDB->query($a_query);
156 $this->data = array();
158 while ($rec =
$ilDB->fetchAssoc($set)) {
159 if ($a_convert_to_leading_upper) {
161 foreach ($rec as $k => $v) {
169 $this->data[] = $rec;
181 $a_str = strtoupper(substr($a_str, 0, 1)) . substr($a_str, 1);
182 while (($pos = strpos($a_str,
"_")) !==
false) {
183 $a_str = substr($a_str, 0, $pos) .
184 strtoupper(substr($a_str, $pos + 1, 1)) .
185 substr($a_str, $pos + 2);
214 string $a_schema_version,
216 string $a_field =
"",
217 bool $a_omit_header =
false,
218 bool $a_omit_types =
false
224 if (!$a_omit_header) {
225 $writer->xmlHeader();
229 $namespaces = $prefixes = array();
230 $this->getNamespaces($namespaces, $a_entity, $a_schema_version);
232 "InstallationUrl" => ILIAS_HTTP_PATH,
"TopEntity" => $a_entity);
234 foreach ($namespaces as $entity => $ns) {
235 $prefix =
"ns" . $cnt;
236 $prefixes[$entity] = $prefix;
241 $this->ds_log->debug(
"Start writing Dataset, entity: " . $a_entity .
", schema version: " . $a_schema_version .
242 ", ids: " . print_r($a_ids,
true));
243 $writer->xmlStartTag($this->getDSPrefixString() .
'DataSet', $atts);
246 if (!$a_omit_types) {
247 $this->ds_log->debug(
"...write types");
248 $this->addTypesXml($writer, $a_entity, $a_schema_version);
252 $this->ds_log->debug(
"...write records");
253 $this->addRecordsXml($writer, $prefixes, $a_entity, $a_schema_version, $a_ids, $a_field);
255 $writer->xmlEndTag($this->getDSPrefixString() .
"DataSet");
257 return $writer->xmlDumpMem(
false);
265 string $a_schema_version,
267 ?
string $a_field =
""
269 $types = $this->getXmlTypes($a_entity, $a_schema_version);
271 $this->ds_log->debug(
"...read data");
272 $this->readData($a_entity, $a_schema_version, $a_ids);
273 $this->ds_log->debug(
"...data: " . print_r($this->data,
true));
274 foreach ($this->data as
$d) {
276 $this->getDSPrefixString() .
"Rec",
277 array(
"Entity" => $this->getXMLEntityName($a_entity, $a_schema_version))
279 $a_writer->
xmlStartTag($this->getXMLEntityTag($a_entity,
''));
280 $rec = $this->getXmlRecord($a_entity, $a_schema_version,
$d);
281 foreach ($rec as
$f =>
$c) {
282 if ((($types[
$f] ??
"") ==
"directory") && $this->absolute_export_dir !==
"" && $this->relative_export_dir !==
"") {
284 $sdir = realpath(
$c);
285 $tdir = realpath($this->absolute_export_dir .
"/dsDir_" . $this->dircnt);
289 $this->ds_log->error(
$e->getMessage());
291 $c = $this->relative_export_dir .
"/dsDir_" . $this->dircnt;
300 $a_writer->
xmlEndTag($this->getXMLEntityTag($a_entity,
''));
301 $a_writer->
xmlEndTag($this->getDSPrefixString() .
"Rec");
303 $this->afterXmlRecordWriting($a_entity, $a_schema_version,
$d);
306 $this->ds_log->debug(
"...get dependencies");
307 $deps = $this->getDependencies($a_entity, $a_schema_version, $rec, $a_ids);
308 $this->ds_log->debug(
"...dependencies: " . print_r($deps,
true));
309 foreach ($deps as $dp => $par) {
310 $ids = !is_array($par[
"ids"])
313 $this->addRecordsXml($a_writer, $a_prefixes, $dp, $a_schema_version, $ids, $par[
"field"] ??
null);
321 ?array $a_rec =
null,
335 $types = $this->getXmlTypes($a_entity, $a_schema_version);
338 if (count($types) > 0) {
340 $this->getDSPrefixString() .
"Types",
341 array(
"Entity" => $this->getXMLEntityName($a_entity, $a_schema_version),
342 "SchemaVersion" => $a_schema_version)
344 foreach ($this->getXmlTypes($a_entity, $a_schema_version) as
$f => $t) {
346 $this->getDSPrefixString() .
'FieldType',
347 array(
"Name" =>
$f,
"Type" => $t)
350 $a_writer->
xmlEndTag($this->getDSPrefixString() .
"Types");
354 $deps = $this->getDependencies($a_entity, $a_schema_version,
null,
null);
355 foreach ($deps as $dp => $w) {
356 $this->addTypesXml($a_writer, $dp, $a_schema_version);
361 public function getNamespaces(array &$namespaces,
string $a_entity,
string $a_schema_version): void
363 $ns = $this->getXmlNamespace($a_entity, $a_schema_version);
365 $namespaces[$a_entity] = $ns;
368 $deps = $this->getDependencies($a_entity, $a_schema_version,
null,
null);
369 foreach ($deps as $dp => $w) {
370 $this->getNamespaces($namespaces, $dp, $a_schema_version);
378 public function getXmlRecord(
string $a_entity,
string $a_version, array $a_set): array
387 public function getXmlTypes(
string $a_entity,
string $a_version): array
389 return $this->getTypes($a_entity, $a_version);
406 return $this->convertToLeadingUpper($a_entity);
411 $this->
import = $a_val;
416 return $this->import;
421 $this->current_installation_id = $a_val;
426 return $this->current_installation_id;
434 return "il_" .
IL_INST_ID .
"_" . $a_type .
"_" . $a_id;
444 if (strpos($a_id,
"il_") === 0) {
445 $parts = explode(
"_", $a_id);
446 if (count(
$parts) !== 4) {
447 throw new ilException(
"Invalid import ID '" . $a_id .
"'.");
454 if (($inst_id == 0 ||
IL_INST_ID ===
"0") && !DEVMODE) {
455 return array(
"type" => self::EXPORT_NO_INST_ID,
"id" => $a_fallback_id);
462 return array(
"type" => self::EXPORT_ID_ILIAS_LOCAL,
"id" =>
$id);
466 return array(
"type" => self::EXPORT_ID_ILIAS_LOCAL_INVALID,
"id" => $a_fallback_id);
474 return array(
"type" => self::EXPORT_ID_ILIAS_REMOTE,
"id" =>
$id);
478 return array(
"type" => self::EXPORT_ID_ILIAS_REMOTE_INVALID,
"id" => $a_fallback_id);
485 return array(
"type" => self::EXPORT_ID,
"id" =>
$id);
487 return array(
"type" => self::EXPORT_ID_INVALID,
"id" => $a_fallback_id);
500 string $a_schema_version
504 protected
function stripTags(array $rec, array $omit_keys = []): array
507 foreach ($rec as $k => $v) {
508 if (in_array($k, $omit_keys,
true)) {
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static return function(ContainerConfigurator $containerConfigurator)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const EXPORT_ID_ILIAS_REMOTE_INVALID
getTypes(string $a_entity, string $a_version)
Get (abstract) types for (abstract) field names.
getXMLEntityName(string $a_entity, string $a_version)
Get entity name for xml (may be overwritten)
importRecord(string $a_entity, array $a_types, array $a_rec, ilImportMapping $a_mapping, string $a_schema_version)
Needs to be overwritten for import use case.
convertToLeadingUpper(string $a_str)
Make xyz_abc a XyzAbc string.
addRecordsXml(ilXmlWriter $a_writer, array $a_prefixes, string $a_entity, string $a_schema_version, array $a_ids, ?string $a_field="")
getXmlTypes(string $a_entity, string $a_version)
Get xml types.
const EXPORT_ID_ILIAS_LOCAL_INVALID
getNamespaces(array &$namespaces, string $a_entity, string $a_schema_version)
string $current_installation_id
readData(string $a_entity, string $a_version, array $a_ids)
Read data from DB.
getDirectDataFromQuery(string $a_query, bool $a_convert_to_leading_upper=true, bool $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
setDSPrefix(string $a_val)
init(string $a_entity, string $a_schema_version)
Init.
parseObjectExportId(string $a_id, ?string $a_fallback_id=null)
Parse export id.
createObjectExportId(string $a_type, string $a_id)
Build ilias export id.
addTypesXml(ilXmlWriter $a_writer, string $a_entity, string $a_schema_version)
getCurrentInstallationId()
getXmlRepresentation(string $a_entity, string $a_schema_version, ?array $a_ids, string $a_field="", bool $a_omit_header=false, bool $a_omit_types=false)
Get xml representation <dataset install_id="123" install_url="..."> <types entity="table_name" versio...
getDependencies(string $a_entity, string $a_version, ?array $a_rec=null, ?array $a_ids=null)
const EXPORT_ID_ILIAS_REMOTE
getXmlNamespace(string $a_entity, string $a_schema_version)
getXMLEntityTag(string $a_entity, string $a_schema_version)
Get entity tag.
setExportDirectories(string $a_relative, string $a_absolute)
setImport(ilSurveyImporter $a_val)
afterXmlRecordWriting(string $a_entity, string $a_version, array $a_set)
setImportDirectory(string $a_val)
const EXPORT_ID_ILIAS_LOCAL
setCurrentInstallationId(string $a_val)
string $absolute_export_dir
getXmlRecord(string $a_entity, string $a_version, array $a_set)
Get xml record for version.
string $relative_export_dir
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
static rCopy(string $a_sdir, string $a_tdir, bool $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getLogger(string $a_component_id)
Get component logger.
Component logger with individual log levels by component id.
static _lookupType(int $id, bool $reference=false)
static _getIdForImportId(string $import_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
xmlEndTag(string $tag)
Writes an endtag.
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
return['3gp', '7z', 'ai', 'aif', 'aifc', 'aiff', 'au', 'arw', 'avi', 'backup', 'bak', 'bas', 'bpmn', 'bpmn2', 'bmp', 'bib', 'bibtex', 'bz', 'bz2', 'c', 'c++', 'cc', 'cct', 'cdf', 'cer', 'class', 'cls', 'conf', 'cpp', 'crt', 'crs', 'crw', 'cr2', 'css', 'cst', 'csv', 'cur', 'db', 'dcr', 'des', 'dng', 'doc', 'docx', 'dot', 'dotx', 'dtd', 'dvi', 'el', 'eps', 'epub', 'f', 'f77', 'f90', 'flv', 'for', 'g3', 'gif', 'gl', 'gan', 'ggb', 'gsd', 'gsm', 'gtar', 'gz', 'gzip', 'h', 'hpp', 'htm', 'html', 'htmls', 'ibooks', 'ico', 'ics', 'ini', 'ipynb', 'java', 'jbf', 'jpeg', 'jpg', 'js', 'jsf', 'jso', 'json', 'latex', 'lang', 'less', 'log', 'lsp', 'ltx', 'm1v', 'm2a', 'm2v', 'm3u', 'm4a', 'm4v', 'markdown', 'm', 'mat', 'md', 'mdl', 'mdown', 'mid', 'min', 'midi', 'mobi', 'mod', 'mov', 'movie', 'mp2', 'mp3', 'mp4', 'mpa', 'mpeg', 'mpg', 'mph', 'mpga', 'mpp', 'mpt', 'mpv', 'mpx', 'mv', 'mw', 'mv4', 'nb', 'nbp', 'nef', 'nif', 'niff', 'obj', 'obm', 'odt', 'ods', 'odp', 'odg', 'odf', 'oga', 'ogg', 'ogv', 'old', 'p', 'pas', 'pbm', 'pcl', 'pct', 'pcx', 'pdf', 'pgm', 'pic', 'pict', 'png', 'por', 'pov', 'project', 'properties', 'ppa', 'ppm', 'pps', 'ppsx', 'ppt', 'pptx', 'ppz', 'ps', 'psd', 'pwz', 'qt', 'qtc', 'qti', 'qtif', 'r', 'ra', 'ram', 'rar', 'rast', 'rda', 'rev', 'rexx', 'ris', 'rf', 'rgb', 'rm', 'rmd', 'rmi', 'rmm', 'rmp', 'rt', 'rtf', 'rtx', 'rv', 's', 's3m', 'sav', 'sbs', 'sec', 'sdml', 'sgm', 'sgml', 'smi', 'smil', 'srt', 'sps', 'spv', 'stl', 'svg', 'swa', 'swf', 'swz', 'tar', 'tex', 'texi', 'texinfo', 'text', 'tgz', 'tif', 'tiff', 'ttf', 'txt', 'tmp', 'uvproj', 'vdf', 'vimeo', 'viv', 'vivo', 'vrml', 'vsdx', 'wav', 'webm', 'wmv', 'wmx', 'wmz', 'woff', 'wwd', 'xhtml', 'xif', 'xls', 'xlsx', 'xmind', 'xml', 'xsl', 'xsd', 'zip']
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Class FlySystemFileAccessTest \Provider\FlySystem @runTestsInSeparateProcesses @preserveGlobalState d...
Class ChatMainBarProvider \MainMenu\Provider.