Единственный вариант который нашел как сделать в 9.
PHP код:
$config = new \Doctrine\DBAL\Configuration();
$connectionParams = array(
'dbname' => $GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['dbname'],
'user' => $GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['user'],
'password' => $GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['password'],
'host' => $GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['host'],
'driver' => $GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['driver'],
);
$conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config);
$sql = "SELECT * FROM pages";
$stmt = $conn->query($sql); // Simple, but has several drawbacks
while ($row = $stmt->fetch()) {
echo $row['title'];
}
Ура!