Просмотр исходного кода

Merge branch 'master' of https://github.com/unaio/una

AntonLV 8 лет назад
Родитель
Сommit
cf0042fbdb

+ 1 - 1
modules/base/general/classes/BxBaseModGeneralSearchResult.php

@@ -66,7 +66,7 @@ class BxBaseModGeneralSearchResult extends BxTemplSearchResult
         if(!$oPrivacy)
             return;
 
-        if (isset($this->aCurrent['restriction']['context'])) {
+        if (!empty($this->aCurrent['restriction']['context']['value']) || !empty($this->aCurrent['restriction']['author']['value'])) {
             $this->setProcessPrivateContent(true);
             return;
         }

+ 2 - 2
modules/boonex/dolphin_migration/classes/BxDolMModule.php

@@ -133,11 +133,11 @@ class BxDolMModule extends BxBaseModGeneralModule
             	'pwd'     => $this -> _oDb -> getExtraParam('passwd'),
                 'name' 	  => $this -> _oDb -> getExtraParam('db'),
 				'port'    => $this -> _oDb -> getExtraParam('port'),
-				'sock'	  => ''	
+				'sock'	  => $this -> _oDb -> getExtraParam('sock'),
 			);
 					
 		$this -> _oMDb = new BxMDb($aConfig);		
-		return $this -> _oMDb	-> connect(); 
+		return $this -> _oMDb -> connect(); 
 	}	
 }
 

+ 13 - 1
modules/boonex/dolphin_migration/classes/BxMDb.php

@@ -56,6 +56,15 @@ class BxMDb
        @set_exception_handler(array($this, 'pdoExceptionHandler'));
     }
 	
+	/**
+	 * get mysql version
+	 */
+    public function getVersion()
+    {
+        $s = $this->getOne("SELECT VERSION()");
+        return preg_match("/([0-9\.]+)/", $s, $m) ? $m[1] : false;
+    }
+	
 	public function connect()
     {
     	if(self::$_rLink)
@@ -75,7 +84,10 @@ class BxMDb
 
 	    	$this->pdoExec("SET NAMES 'utf8'");
 	        $this->pdoExec("SET sql_mode = ''");
-			$this->pdoExec("SET storage_engine=" . $this->_sStorageEngine);
+			
+			$sVer = $this->getVersion();
+            $sStorageEngine = !$sVer || version_compare($sVer, '5.7.5', '>=') ? 'default_storage_engine' : 'storage_engine';
+            $this->pdoExec("SET $sStorageEngine=" . $this->_sStorageEngine);
 
 			self::$_aDbCacheData = array();
     	}