فهرست منبع

#4833 Allow to select INNODB db engine during install

Alex Trofimov 1 سال پیش
والد
کامیت
6606624607

+ 6 - 0
install/classes/BxDolInstallSiteConfig.php

@@ -117,6 +117,12 @@ class BxDolInstallSiteConfig
                 'desc' => _t('_sys_inst_conf_desc_db_pwd'),
                 'db_conf' => 'pwd',
             ),
+            'db_engine' => array(
+                'name' => _t('_sys_inst_conf_field_db_engine'),
+                'ex' => 'INNODB',
+                'desc' => _t('_sys_inst_conf_desc_db_engine'),
+                'def' => 'MYISAM',
+            ),
 
             'section_db_config_close' => array(
                 'func' => 'rowSectionClose',

+ 1 - 0
install/cmd.php

@@ -41,6 +41,7 @@ class BxDolInstallCmd
             'db_name' => 'test',
             'db_user' => 'root',
             'db_password' => 'root',
+            'db_engine' => 'MYISAM',
             'site_title' => 'UNA Test',
             'site_email' => 'no-reply@example.com',
             'admin_email' => 'admin@example.com',

+ 1 - 1
install/patterns/header.inc.php

@@ -12,7 +12,7 @@ define('BX_DATABASE_PORT', '%DB_PORT%'); ///< db port
 define('BX_DATABASE_USER', '%DB_USER%'); ///< db user
 define('BX_DATABASE_PASS', '%DB_PASSWORD%'); ///< db password
 define('BX_DATABASE_NAME', '%DB_NAME%'); ///< db name
-define('BX_DATABASE_ENGINE', 'MYISAM'); ///< db engine
+define('BX_DATABASE_ENGINE', '%DB_ENGINE%'); ///< db engine
 
 define('BX_SYSTEM_JAVA', '%JAVA_PATH%'); ///< path to java binary
 define('BX_SYSTEM_FFMPEG', '%FFMPEG_PATH%'); ///< path to ffmpeg binary

+ 2 - 0
modules/boonex/english/data/langs/system/en.xml

@@ -3004,6 +3004,7 @@ If it is not enabled then please consider implement this optimization, since it
 	<string name="_sys_inst_conf_desc_db_pwd"><![CDATA[Your MySQL database password here.]]></string>
 	<string name="_sys_inst_conf_desc_db_sock"><![CDATA[Leave blank or specify MySQL database socket path.]]></string>
 	<string name="_sys_inst_conf_desc_db_user"><![CDATA[Your MySQL database user name with read/write access.]]></string>
+	<string name="_sys_inst_conf_desc_db_engine"><![CDATA[MySQL database engine, some DB engines may require custom MYSQL configuration.]]></string>
 	<string name="_sys_inst_conf_desc_language"><![CDATA[Language to install by default.]]></string>
 	<string name="_sys_inst_conf_desc_profiles"><![CDATA[Profiles module to install by default.]]></string>
 	<string name="_sys_inst_conf_desc_oauth_key_secret"><![CDATA[<a target="_blank" href="http://www.una.io/page/kands-manage">Get UNA Key & Secret</a>]]></string>
@@ -3023,6 +3024,7 @@ If it is not enabled then please consider implement this optimization, since it
 	<string name="_sys_inst_conf_field_db_pwd"><![CDATA[Database password]]></string>
 	<string name="_sys_inst_conf_field_db_sock"><![CDATA[Database socket path]]></string>
 	<string name="_sys_inst_conf_field_db_user"><![CDATA[Database user]]></string>
+	<string name="_sys_inst_conf_field_db_engine"><![CDATA[Database engine]]></string>
 	<string name="_sys_inst_conf_field_language"><![CDATA[Language]]></string>
 	<string name="_sys_inst_conf_field_profiles"><![CDATA[Profiles]]></string>
 	<string name="_sys_inst_conf_field_oauth_key"><![CDATA[UNA key]]></string>

+ 2 - 2
scripts/manage.php

@@ -19,7 +19,7 @@ class BxDolManageCmd
     protected $_isQuiet = false;
     protected $_aReturnCodes = array(
         'success' => array ('code' => 0, 'msg' => 'Success.'),
-        'una not found' => array ('code' => 1, 'msg' => 'UNA wasn\'t found in the specified path.'),
+        'una not found' => array ('code' => 1, 'msg' => 'UNA wasn\'t found in the specified path: '),
         'unknown cmd' => array ('code' => 2, 'msg' => 'Unknown command.'),
         'db connect failed' => array ('code' => 3, 'msg' => 'Database connection failed: '),
         'error' => array ('code' => 9, 'msg' => 'Error occured.'),
@@ -132,7 +132,7 @@ class BxDolManageCmd
         $sHeaderPath = $this->_sPathToUna . '/inc/header.inc.php';
 
         if (!file_exists($sHeaderPath))
-            $this->finish($this->_aReturnCodes['una not found']['code'], $this->_aReturnCodes['una not found']['msg']);
+            $this->finish($this->_aReturnCodes['una not found']['code'], $this->_aReturnCodes['una not found']['msg'] . $sHeaderPath);
 
         require_once($sHeaderPath);