/**
  * Disconnects the cluster handler from the database
  */
 public function disconnect()
 {
     if (self::$dbbackend !== null) {
         self::$dbbackend->_disconnect();
         self::$dbbackend = null;
     }
 }
Beispiel #2
0
 /**
  * Constructor
  *
  * If provided with $filePath, will use this file for further operations.
  * If not given, the file* methods must be used instead
  *
  * @param string $filePath Path of the file to handle
  *
  * @throws eZDBNoConnectionException DB connection failed
  */
 function __construct($filePath = false)
 {
     if (self::$nonExistantStaleCacheHandling === null) {
         $fileINI = eZINI::instance('file.ini');
         self::$nonExistantStaleCacheHandling = $fileINI->variable("ClusteringSettings", "NonExistantStaleCacheHandling");
         unset($fileINI);
     }
     // DB Backend init
     if (self::$dbbackend === null) {
         self::$dbbackend = eZExtension::getHandlerClass(new ezpExtensionOptions(array('iniFile' => 'file.ini', 'iniSection' => 'eZDFSClusteringSettings', 'iniVariable' => 'DBBackend')));
         self::$dbbackend->_connect(false);
     }
     if ($filePath !== false) {
         $filePath = eZDBFileHandler::cleanPath($filePath);
         eZDebugSetting::writeDebug('kernel-clustering', "dfs::ctor( '{$filePath}' )");
     } else {
         eZDebugSetting::writeDebug('kernel-clustering', "dfs::ctor()");
     }
     $this->filePath = $filePath;
 }