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

#53 - some fixes after code cleanup

Alex Trofimov 12 лет назад
Родитель
Сommit
ea1246108d

+ 2 - 0
inc/classes/BxDolDb.php

@@ -89,6 +89,8 @@ class BxDolDb extends BxDol implements iBxDolSingleton
     public static function getInstance($aDbConf = false, &$sError = null) 
     {
         if (!isset($GLOBALS['bxDolClasses'][__CLASS__])) {
+            if (false === $aDbConf && !defined('BX_DATABASE_HOST'))
+                return null;
             $o = new BxDolDb($aDbConf);
             $sErrorMessage = $o->connect();
             if ($sErrorMessage) {

+ 3 - 3
studio/classes/BxDolStudioInstallerQuery.php

@@ -11,8 +11,8 @@ defined('BX_DOL') or die('hack attempt');
 bx_import('BxDolModuleQuery');
 
 class BxDolStudioInstallerQuery extends BxDolModuleQuery {
-    function BxDolStudioInstallerQuery() {
-        parent::BxDolModuleQuery();
+    function __construct() {
+        parent::__construct();
     }
 
     function insertModule(&$aConfig) {
@@ -47,4 +47,4 @@ class BxDolStudioInstallerQuery extends BxDolModuleQuery {
 		return $iId; 
     }
 }
-/** @} */
+/** @} */

+ 2 - 1
template/scripts/BxBaseConfig.php

@@ -65,7 +65,8 @@ class BxBaseConfig extends BxDol implements iBxDolSingleton {
     function __construct() 
     {
         parent::__construct();
-        if (function_exists('getParam'))
+
+        if (class_exists('BxDolDb') && BxDolDb::getInstance())
             $this->_aConfig['aLessConfig']['bx-page-width'] = getParam('main_div_width');
     }