DOC SYSTEM Arreglo para el instalador de docSystem

Arreglo para el instalador de docSystem
This commit is contained in:
Brayan Osmar Pereyra Suxo
2013-04-17 10:06:51 -04:00
parent d359d6df2e
commit d6d27b28b3
2 changed files with 65 additions and 50 deletions

View File

@@ -363,7 +363,8 @@ class Installer extends Controller
*/ */
public function createWorkspace () public function createWorkspace ()
{ {
if (file_exists($this->path_shared . 'partner.info')) { $pathSharedPartner = trim( $_REQUEST['pathShared'] );
if (file_exists($pathSharedPartner.'partner.info')) {
$_REQUEST['PARTNER_FLAG'] = true; $_REQUEST['PARTNER_FLAG'] = true;
} }
$this->setResponseType( 'json' ); $this->setResponseType( 'json' );
@@ -838,12 +839,10 @@ class Installer extends Controller
// getting configuration from env.ini // getting configuration from env.ini
$sysConf = System::getSystemConfiguration( $envFile ); $sysConf = System::getSystemConfiguration( $envFile );
if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) {
$this->buildParternExtras($db_username, $db_password, $_REQUEST['workspace'], SYS_LANG);
} else {
try { try {
// update the main index file // update the main index file
$indexFileUpdated = System::updateIndexFile(array('lang' => 'en','skin' => $updatedConf['default_skin'])); $indexFileUpdated = System::updateIndexFile( array ('lang' => 'en','skin' => $updatedConf['default_skin']
) );
} catch (Exception $e) { } catch (Exception $e) {
$info->result = false; $info->result = false;
$info->message = G::LoadTranslation('ID_PROCESSMAKER_WRITE_CONFIG_INDEX', SYS_LANG, Array(PATH_HTML . "index.html.")); $info->message = G::LoadTranslation('ID_PROCESSMAKER_WRITE_CONFIG_INDEX', SYS_LANG, Array(PATH_HTML . "index.html."));
@@ -851,6 +850,9 @@ class Installer extends Controller
$this->installLog( G::LoadTranslation('ID_INSTALL_BUT_ERROR', SYS_LANG, Array('index.html'))); $this->installLog( G::LoadTranslation('ID_INSTALL_BUT_ERROR', SYS_LANG, Array('index.html')));
return $info; return $info;
} }
if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) {
$this->buildParternExtras($adminUsername, $adminPassword, $_REQUEST['workspace'], SYS_LANG);
} }
$this->installLog( G::LoadTranslation('ID_INDEX_FILE_UPDATED', SYS_LANG, Array($indexFileUpdated, $sysConf['default_lang'],$sysConf['default_skin']))); $this->installLog( G::LoadTranslation('ID_INDEX_FILE_UPDATED', SYS_LANG, Array($indexFileUpdated, $sysConf['default_lang'],$sysConf['default_skin'])));
@@ -1358,6 +1360,7 @@ class Installer extends Controller
*/ */
$ch = curl_init(); $ch = curl_init();
$postData = array();
// File to upload/post // File to upload/post
$postData['form[LANGUAGE_FILENAME]'] = "@".PATH_CORE."content/translations/processmaker.$lang.po"; $postData['form[LANGUAGE_FILENAME]'] = "@".PATH_CORE."content/translations/processmaker.$lang.po";
@@ -1373,40 +1376,15 @@ class Installer extends Controller
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_TIMEOUT, 90); curl_setopt($ch, CURLOPT_TIMEOUT, 90);
$output = curl_exec($ch); $output = curl_exec($ch);
curl_close($ch); curl_close($ch);
/** /**
* Upload plugin file * Upload skin file
*/ */
$ch = curl_init(); $ch = curl_init();
$postData = array();
// resolv the plugin name
$plugins = glob(PATH_CORE."plugins/*.tar");
if (count($plugins) > 0) {
$pluginName = $plugins[0];
// File to upload/post
$postData['form[PLUGIN_FILENAME]'] = "@{$pluginName}";
//http://pmos/sysworkflow/en/classic/setup/skin_Ajax
curl_setopt($ch, CURLOPT_URL, "$serv/sys{$workspace}/{$lang}/classic/setup/pluginsImportFile");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiefile);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiefile);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_TIMEOUT, 90);
$output = curl_exec($ch);
curl_close($ch);
}
$ch = curl_init();
$skins = glob(PATH_CORE."data/partner/*.tar"); $skins = glob(PATH_CORE."data/partner/*.tar");
if (count($skins) > 0) { if (count($skins) > 0) {
@@ -1430,11 +1408,39 @@ class Installer extends Controller
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_TIMEOUT, 90); curl_setopt($ch, CURLOPT_TIMEOUT, 90);
echo $output = curl_exec($ch); $output = curl_exec($ch);
curl_close($ch);
}
/**
* Upload plugin file
*/
$ch = curl_init();
$postData = array();
// resolv the plugin name
$plugins = glob(PATH_CORE."plugins/*.tar");
if (count($plugins) > 0) {
$pluginName = $plugins[0];
// File to upload/post
$postData['form[PLUGIN_FILENAME]'] = "@{$pluginName}";
curl_setopt($ch, CURLOPT_URL, "$serv/sys{$workspace}/{$lang}/classic/setup/pluginsImportFile");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiefile);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiefile);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_TIMEOUT, 90);
$output = curl_exec($ch);
curl_close($ch); curl_close($ch);
} }
} }
} }

View File

@@ -1,4 +1,13 @@
<?php <?php
include_once PATH_CONTROLLERS."installer.php";
$ins = new Installer();
$ins->buildParternExtras('admin', 'sample', 'workflow', 'pt-BR');
die;
ini_set( "soap.wsdl_cache_enabled", "0" ); // disabling WSDL cache ini_set( "soap.wsdl_cache_enabled", "0" ); // disabling WSDL cache