25 $extensionBaseDir = $mwConfig->
get(
'ExtensionDirectory' ) . DIRECTORY_SEPARATOR
26 .
'DonationInterface';
28 if ( !is_dir( $extensionBaseDir ) ) {
29 $extensionBaseDir = __DIR__ . DIRECTORY_SEPARATOR .
'..';
34 $generalBaseConfigDir = $extensionBaseDir . DIRECTORY_SEPARATOR .
'config';
35 $configurationReader->registerConfigDirectory( $generalBaseConfigDir );
38 $gatewayBaseConfigDir = $extensionBaseDir . DIRECTORY_SEPARATOR . $gateway .
'_gateway'
39 . DIRECTORY_SEPARATOR .
'config';
40 $configurationReader->registerConfigDirectory( $gatewayBaseConfigDir );
43 $localConfigDir = $mwConfig->
get(
'DonationInterfaceLocalConfigurationDirectory' );
44 if ( $localConfigDir ) {
45 $configurationReader->registerConfigDirectory( $localConfigDir );
46 $gatewaySpecificSuffix = DIRECTORY_SEPARATOR . $gateway;
47 $configurationReader->registerConfigDirectory( $localConfigDir . $gatewaySpecificSuffix );
53 $variantConfigDir = $mwConfig->
get(
'DonationInterfaceVariantConfigurationDirectory' );
54 if ( $variant !==
null
56 && preg_match(
'/^[a-zA-Z0-9_]+$/', $variant )
58 $variantConfigDirSuffix = DIRECTORY_SEPARATOR . $variant . DIRECTORY_SEPARATOR . $gateway;
59 $configurationReader->registerConfigDirectory( $variantConfigDir . $variantConfigDirSuffix );
62 return $configurationReader;
115 $yaml =
new Parser();
116 $globPattern = $directory . DIRECTORY_SEPARATOR .
'*.yaml';
117 foreach ( glob( $globPattern ) as
$path ) {
118 $pieces = explode( DIRECTORY_SEPARATOR,
$path );
119 $key = substr( array_pop( $pieces ), 0, -5 );
120 $config[$key] = $yaml->parse( file_get_contents(
$path ) );