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

#35 - optional install of additional modules

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

+ 2 - 2
build.xml

@@ -3,7 +3,7 @@
 
     <property file="${project.basedir}/build.properties" override="true" />
     <property name="build" value="0" override="yes" />
-
+    <property name="modules" value="" override="yes" />
 
     <if>
         <not><isset property="composer" /></not>
@@ -82,7 +82,7 @@
             <not><isset property="install_base_dir" /></not>
             <then><property name="install_base_dir" value="${project.basedir}" /></then>
         </if>
-        <exec command="${php} cmd.php --db_name=${db_name} --db_user=${db_user} --db_password=${db_password} --server_http_host=${http_host} --server_php_self=${php_self} --server_doc_root=${doc_root}" dir="${install_base_dir}/install" checkreturn="true" />
+        <exec command="${php} cmd.php -m ${modules} --db_name=${db_name} --db_user=${db_user} --db_password=${db_password} --server_http_host=${http_host} --server_php_self=${php_self} --server_doc_root=${doc_root}" dir="${install_base_dir}/install" checkreturn="true" />
     </target>
 
     <!-- ============================================  -->

+ 2 - 1
install/classes/BxDolInstallSiteConfig.php

@@ -391,6 +391,7 @@ EOF;
     {
         if (!file_exists(BX_INSTALL_PATH_HEADER))
             return _t('_sys_inst_msg_script_isnt_installed');
+
         require_once(BX_INSTALL_PATH_HEADER);
         bx_import('BxDolStudioInstallerUtils');
         bx_import('BxDolLanguages');
@@ -405,7 +406,7 @@ EOF;
             foreach ($aActions as $sAction) {
                 $aResult = BxDolStudioInstallerUtils::getInstance()->perform($aConfig['home_dir'], $sAction);
                 if ((!isset($aResult['result']) || !$aResult['result']) && !empty($aResult['message']))
-                    return $aResult['message'];
+                    return _t('_sys_inst_msg_module_error', $aConfig['title'], $aResult['message']);
             }
         }
 

+ 2 - 2
install/cmd.php

@@ -22,7 +22,7 @@ class BxDolInstallCmd
         'requirements failed' => array ('code' => 2, 'msg' => 'Requirements aren\'t met.'),
         'permissions failed' => array ('code' => 3, 'msg' => 'Folders and/or files permissions aren\'t correct.'),
         'create config failed' => array ('code' => 4, 'msg' => 'Form data was not submitted.'),
-        'module failed' => array ('code' => 5, 'msg' => 'Additional module install failed.'),
+        'module failed' => array ('code' => 5, 'msg' => 'Additional module install failed. '),
     );
 
     public function __construct() 
@@ -167,7 +167,7 @@ class BxDolInstallCmd
             foreach ($this->_aAdditionalModules as $sModuleName) {
                 $sErrorMessage = $oSiteConfig->processModuleByName($sModuleName);
                 if ($sErrorMessage)
-                    $this->finish($this->_aReturnCodes['module failed']['code'], $this->_aReturnCodes['module failed']['msg']);
+                    $this->finish($this->_aReturnCodes['module failed']['code'], $this->_aReturnCodes['module failed']['msg'] . strip_tags($sErrorMessage));
             }
         }
     }

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

@@ -3841,6 +3841,7 @@ If you don't know how to do it by yourself you can submit <a target="_blank" hre
     <string name="_sys_inst_msg_remove_install"><![CDATA[Please, remove INSTALL directory from your server and reload this page to activate your site.<br />After deletion you can safely go <a href="../studio/">to the site Studio</a> to add additional modules and customize the site.]]></string>
     <string name="_sys_inst_msg_admin_account_not_found"><![CDATA[Admin account wasn't found by email - {0}]]></string>
     <string name="_sys_inst_msg_script_isnt_installed"><![CDATA[Script isn't installed]]></string>
+    <string name="_sys_inst_msg_module_error"><![CDATA[{0} - {1}]]></string>
 
 	<string name="_sys_inst_finish"><![CDATA[Installation has been successfully completed]]></string>
 	<string name="_sys_inst_site_config"><![CDATA[Site configuration]]></string>