Reputation: 20224
How can I include typo3's LocalConfiguration.php into my script (which is NOT inside typo3)? Since that file returns an array:
<?php
return [
'BE' => [
...
I thought I have to put the include into a function:
function getConf() {
include_once("typo3conf/LocalConfiguration.php");
}
$conf = getConf();
print_r($conf);
but the output is empty.
Upvotes: 1
Views: 824
Reputation: 2269
You should use $GLOBALS
to read values from TYPO3 configuration, wich values are written/overwritten by these files in this order DefaultConfiguration
+ LocalConfiguration
+ AdditionalConfiguration
Upvotes: 0
Reputation: 4879
most likely you need to return the configuration:
<?php
function getConf() {
return include_once("typo3conf/LocalConfiguration.php");
}
$conf = getConf();
print_r($conf);
René Pflamm's solution should be easier
Upvotes: 0
Reputation: 3354
Just inlcude it directly to the variable:
$conf = include 'typo3conf/LocalConfiguration.php';
Upvotes: 3