Skip to content

Commit

Permalink
Support DFS Settings (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
SalvatorePollaci authored and emodric committed Mar 14, 2019
1 parent 3e3fc7c commit be9efb2
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions bundle/LegacyMapper/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ public function onBuildKernel(PreBuildKernelEvent $event)
// Enforce ViewCaching to be enabled in order to persistence/http cache to be purged correctly.
$settings['site.ini/ContentSettings/ViewCaching'] = 'enabled';

// Cluster Settings
$settings += $this->getClusterSettings();

$event->getParameters()->set(
'injected-settings',
$settings + (array)$event->getParameters()->get('injected-settings')
Expand Down Expand Up @@ -319,4 +322,22 @@ function ($value) {
'site.ini/SiteSettings/DefaultPage' => $defaultPage !== null ? $defaultPage : "/content/view/full/$rootLocationId/",
);
}

private function getClusterSettings()
{
$clusterSettings = array();
if ($this->container->hasParameter('dfs_nfs_path')) {
$clusterSettings += array(
'file.ini/ClusteringSettings/FileHandler' => 'eZDFSFileHandler',
'file.ini/eZDFSClusteringSettings/MountPointPath' => $this->container->getParameter('dfs_nfs_path'),
'file.ini/eZDFSClusteringSettings/DBHost' => $this->container->getParameter('dfs_database_host'),
'file.ini/eZDFSClusteringSettings/DBPort' => $this->container->getParameter('dfs_database_port'),
'file.ini/eZDFSClusteringSettings/DBName' => $this->container->getParameter('dfs_database_name'),
'file.ini/eZDFSClusteringSettings/DBUser' => $this->container->getParameter('dfs_database_user'),
'file.ini/eZDFSClusteringSettings/DBPassword' => $this->container->getParameter('dfs_database_password'),
);
}

return $clusterSettings;
}
}

0 comments on commit be9efb2

Please sign in to comment.