Alexander Alexander - 1 month ago 20
PHP Question

Include typo3 LocalConfiguration.php

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.

Answer

Just inlcude it directly to the variable:

$conf = include 'typo3conf/LocalConfiguration.php';