ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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
8require_once $baseDir.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'_autoload.php';
9require_once SimpleSAML\Utils\Config::getConfigDir().DIRECTORY_SEPARATOR.'config.php';
10
11echo "Initializing Metadata Database...".PHP_EOL;
12
13# Iterate through configured metadata sources and ensure
14# that a PDO source exists.
15foreach ($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
An exception for terminatinating execution or to throw for unit testing.
$baseDir
Definition: initMDSPdo.php:5
$config
Definition: bootstrap.php:15