ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
initMDSPdo.php
Go to the documentation of this file.
1 #!/usr/bin/env php
2 <?php
3 
4 // This is the base directory of the SimpleSAMLphp installation
5 $baseDir = dirname(dirname(__FILE__));
6 
7 // Add library autoloader and configuration
8 require_once $baseDir.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'_autoload.php';
9 require_once SimpleSAML\Utils\Config::getConfigDir().DIRECTORY_SEPARATOR.'config.php';
10 
11 echo "Initializing Metadata Database...".PHP_EOL;
12 
13 # Iterate through configured metadata sources and ensure
14 # that a PDO source exists.
15 foreach ($config['metadata.sources'] as $source) {
16  # If pdo is configured, create the new handler and initialize the DB.
17  if ($source['type'] === "pdo") {
18  $metadataStorageHandler = new SimpleSAML_Metadata_MetaDataStorageHandlerPdo($source);
19  $result = $metadataStorageHandler->initDatabase();
20 
21  if ($result === false) {
22  echo "Failed to initialize metadata database.".PHP_EOL;
23  } else {
24  echo "Successfully initialized metadata database.".PHP_EOL;
25  }
26  }
27 }
$result
$source
Definition: linkback.php:22
$baseDir
Definition: initMDSPdo.php:5