Index: branches/5.2.x/tools/synchronize.sh =================================================================== diff -u -N --- branches/5.2.x/tools/synchronize.sh (revision 0) +++ branches/5.2.x/tools/synchronize.sh (revision 15660) @@ -0,0 +1,4 @@ +#!/bin/sh +MAPPED_PATH=`dirname $0` + +open $MAPPED_PATH/../system/export/Custom.textcomparison Index: branches/5.2.x/core/units/helpers/deployment_helper.php =================================================================== diff -u -N -r15601 -r15660 --- branches/5.2.x/core/units/helpers/deployment_helper.php (.../deployment_helper.php) (revision 15601) +++ branches/5.2.x/core/units/helpers/deployment_helper.php (.../deployment_helper.php) (revision 15660) @@ -1,6 +1,6 @@ isCommandLine ) { + echo htmlspecialchars($this->_runShellScript()); echo '' . PHP_EOL; } return $ret; } /** + * Runs user-specific shell script when deployment happens from Web + * + * @return string + * @access protected + */ + protected function _runShellScript() + { + if ( !$this->Application->isDebugMode(false) ) { + return ''; + } + + $wrapper_script = '/usr/local/bin/guest2host_server.sh'; + $script_name = FULL_PATH .'/tools/' . ($this->dryRun ? 'synchronize.sh' : 'deploy.sh'); + + if ( file_exists($wrapper_script) && file_exists($script_name) ) { + $script_name = preg_replace('/^.*\/web/', constant('DBG_LOCAL_BASE_PATH'), $script_name); + + return shell_exec($wrapper_script . ' ' . $script_name . ' 2>&1'); + } + + return ''; + } + + /** * Deploys pending changes to a site * * @param string $module_name @@ -206,7 +231,10 @@ return false; } - if ( !$this->dryRun ) { + if ( $this->dryRun ) { + $this->exportLanguagePack(); + } + else { $this->importLanguagePack(); } @@ -233,6 +261,29 @@ } /** + * Exports latest language pack + * + * @return void + * @access private + */ + private function exportLanguagePack() + { + static $languages = null; + + if ( !isset($languages) ) { + $sql = 'SELECT LanguageId + FROM ' . $this->Application->getUnitOption('lang', 'TableName') . ' + WHERE Enabled = 1'; + $languages = $this->Conn->GetCol($sql); + } + + $language_import_helper =& $this->Application->recallObject('LanguageImportHelper'); + /* @var $language_import_helper LanguageImportHelper */ + + $language_import_helper->performExport(EXPORT_PATH . '/' . $this->moduleName . '.lang', '|0|1|2|', $languages, '|' . $this->moduleName . '|'); + } + + /** * Resets unit and section cache * * @return void