ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
importPdoMetadata.php
Go to the documentation of this file.
1 #!/usr/bin/env php
2 <?php
3 $baseDir = dirname(dirname(__FILE__));
4 
5 require_once $baseDir.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'_autoload.php';
6 require_once SimpleSAML\Utils\Config::getConfigDir().DIRECTORY_SEPARATOR.'config.php';
7 
8 # Iterate through configured metadata sources and ensure
9 # that a PDO source exists.
10 foreach ($config['metadata.sources'] as $s) {
11  # If pdo is configured, create the new handler and add in the metadata sets.
12  if ($s['type'] === "pdo") {
14  $mdshp->initDatabase();
15 
16  foreach (glob("metadata/*.php") as $filename) {
17  $metadata = array();
18  require_once $filename;
19  $set = basename($filename, ".php");
20  echo "importing set '$set'...".PHP_EOL;
21 
22  foreach ($metadata as $k => $v) {
23  echo "\t$k".PHP_EOL;
24  $mdshp->addEntry($k, $set, $v);
25  }
26  }
27  }
28 }
$s
Definition: pwgen.php:45
$metadata['__DYNAMIC:1__']
Create styles array
The data for the language used.