|
@@ -47,7 +47,7 @@ echo "<h2>(W przypadku instalacji zdalnej) Pamiętaj o konieczności udostępnie
|
|
|
|
|
|
|
|
class INSTALL_SES_PROCESY_A {
|
|
class INSTALL_SES_PROCESY_A {
|
|
|
//make option for sgencoder (several domains) --domain '.$h->SERVER_ADDRESS_SHORT.' -r *.php
|
|
//make option for sgencoder (several domains) --domain '.$h->SERVER_ADDRESS_SHORT.' -r *.php
|
|
|
- function get_same_domains_for_install($SERVER_ADDRESS_SHORT, $SERVER_ADDRESS = null) {
|
|
|
|
|
|
|
+ static function get_same_domains_for_install($SERVER_ADDRESS_SHORT, $SERVER_ADDRESS = null) {
|
|
|
$domainList = self::fetch_same_domains_for_install($SERVER_ADDRESS_SHORT, $SERVER_ADDRESS);
|
|
$domainList = self::fetch_same_domains_for_install($SERVER_ADDRESS_SHORT, $SERVER_ADDRESS);
|
|
|
$argDomain = array();
|
|
$argDomain = array();
|
|
|
foreach ($domainList as $domain) {
|
|
foreach ($domainList as $domain) {
|
|
@@ -55,7 +55,7 @@ class INSTALL_SES_PROCESY_A {
|
|
|
}
|
|
}
|
|
|
return implode(' ', $argDomain);
|
|
return implode(' ', $argDomain);
|
|
|
}
|
|
}
|
|
|
- function fetch_same_domains_for_install($SERVER_ADDRESS_SHORT, $SERVER_ADDRESS = null) {
|
|
|
|
|
|
|
+ static function fetch_same_domains_for_install($SERVER_ADDRESS_SHORT, $SERVER_ADDRESS = null) {
|
|
|
$domainList = array();
|
|
$domainList = array();
|
|
|
if(strlen($SERVER_ADDRESS_SHORT)==0) die('Error with server address short');
|
|
if(strlen($SERVER_ADDRESS_SHORT)==0) die('Error with server address short');
|
|
|
$res=DB::query("select SERVER_ADDRESS_IP from SES_PROCESY5_A where SERVER_ADDRESS_SHORT='".$SERVER_ADDRESS_SHORT."'");
|
|
$res=DB::query("select SERVER_ADDRESS_IP from SES_PROCESY5_A where SERVER_ADDRESS_SHORT='".$SERVER_ADDRESS_SHORT."'");
|
|
@@ -2342,111 +2342,180 @@ function MakeCommand($command_id,$command,$installer_tmp,$installer_dir) {
|
|
|
return $ins_sh;
|
|
return $ins_sh;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+function encodePhpFiles($installer_dir, $domains = [], $domainEncodePhpFiles = []) {
|
|
|
|
|
+ if (empty($installer_dir)) throw new Exception("Install path not found");
|
|
|
|
|
+ if ($domainEncodePhpFiles and empty($domains)) throw new Exception("Domains not definied");
|
|
|
|
|
+
|
|
|
|
|
+ $phpVersionsForSgencoder = '--phpversion 5.5 --phpversion 5.6';// encode for PHP 5.x (currently supported PHP 5.0-5.6)
|
|
|
|
|
+
|
|
|
|
|
+ $cmd = "cd '{$installer_dir}' && find . -type f -name '*.php' ";
|
|
|
|
|
+ $out = ''; $ret = '';
|
|
|
|
|
+ exec($cmd, $out, $ret);
|
|
|
|
|
+ DEBUG_S(-3,'Files found to encode',array($cmd,$out,$ret),__FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
+ if (0 !== $ret) throw new Exception("Error at find php files");
|
|
|
|
|
+ if (empty($out)) return false;
|
|
|
|
|
+ $allPhpFiles = array_map(function ($phpFilePath) {
|
|
|
|
|
+ return ('./' == substr($phpFilePath, 0, 2))? substr($phpFilePath, 2) : $phpFilePath;
|
|
|
|
|
+ }, $out);
|
|
|
|
|
+
|
|
|
|
|
+ $domainEncodePhpFiles = array_filter($allPhpFiles, function ($phpFilePath) use ($domainEncodePhpFiles) {
|
|
|
|
|
+ foreach ($domainEncodePhpFiles as $file) {
|
|
|
|
|
+ if (preg_match("|^[[:digit:]]+/" . str_replace('.', '\.', $file) . "$|", $phpFilePath)) return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ return false;
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ $freeEncodePhpFiles = array_filter($allPhpFiles, function ($phpFilePath) use ($domainEncodePhpFiles) {
|
|
|
|
|
+ if ('se-lib/Vendor/' === substr($phpFilePath, 0, strlen('se-lib/Vendor/'))) return false; // SKIP se-lib/Vendor/*
|
|
|
|
|
+ if ('.ini.php' === substr($phpFilePath, -1 * strlen('.ini.php'))) return false; // SKIP *.ini.php
|
|
|
|
|
+ return (!in_array($phpFilePath, $domainEncodePhpFiles));
|
|
|
|
|
+ });
|
|
|
|
|
+ DEBUG_S(-3,'freeEncodePhpFiles',$freeEncodePhpFiles,__FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
+// if (empty($freeEncodePhpFiles)) throw new Exception("No php files to encode");
|
|
|
|
|
+
|
|
|
|
|
+ $cmdTempl = "cd {$installer_dir} && /Applications/SourceGuardian.app/Contents/MacOS/sgencoder {$phpVersionsForSgencoder} -b- ";
|
|
|
|
|
+ $cmdDomainEncodeDomainsTempl = " --domain " . implode(" --domain ", array_merge($domains, ['localhost']));
|
|
|
|
|
+ $cmdDomainEncodeFilesTempl = " " . implode(" ", $domainEncodePhpFiles);
|
|
|
|
|
+ $cmdFreeEncodeFilesTempl = " " . implode(" ", $freeEncodePhpFiles);
|
|
|
|
|
+
|
|
|
|
|
+ $cmds = [];
|
|
|
|
|
+ if ($domainEncodePhpFiles) $cmds['domainEncodePhpFiles'] = $cmdTempl . $cmdDomainEncodeDomainsTempl . $cmdDomainEncodeFilesTempl;
|
|
|
|
|
+ if ($freeEncodePhpFiles) $cmds['freeEncodePhpFiles'] = $cmdTempl . $cmdFreeEncodeFilesTempl;
|
|
|
|
|
+
|
|
|
|
|
+ $returnValues = [];
|
|
|
|
|
+ foreach ($cmds as $desc => $cmd) {
|
|
|
|
|
+ $out = ''; $ret = '';
|
|
|
|
|
+ exec($cmd, $out, $ret);
|
|
|
|
|
+ $encoderSummaryLine = end($out);
|
|
|
|
|
+ $returnValues[$desc] = $encoderSummaryLine;
|
|
|
|
|
+ DEBUG_S(-3,"Encoded files {$desc}" ,array($cmd, $out, $ret),__FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
+ if (empty($out)) throw new Exception("No output for encode files command");
|
|
|
|
|
+ }
|
|
|
|
|
+ $statusInfo = array_reduce($returnValues, function ($ret, $encoderSummaryLine) {
|
|
|
|
|
+ DEBUG_S(-3,'DBG reduce [$ret, $encoderSummaryLine]',array($ret, $encoderSummaryLine),__FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
+ $matches = [];
|
|
|
|
|
+ preg_match_all('/(\d+) files, (\d+) processed, (\d+) errors/', $encoderSummaryLine, $matches, PREG_SET_ORDER, 0);
|
|
|
|
|
+ return [
|
|
|
|
|
+ 'files' => $ret['files'] + (int)$matches[0][1],
|
|
|
|
|
+ 'processed' => $ret['processed'] + (int)$matches[0][2],
|
|
|
|
|
+ 'errors' => $ret['errors'] + (int)$matches[0][3],
|
|
|
|
|
+ ];
|
|
|
|
|
+ }, [
|
|
|
|
|
+ 'files' => 0,
|
|
|
|
|
+ 'processed' => 0,
|
|
|
|
|
+ 'errors' => 0,
|
|
|
|
|
+ ]);
|
|
|
|
|
+ if ($statusInfo['errors'] === 0 && $statusInfo['files'] > 0) {
|
|
|
|
|
+ DEBUG_S(-3, "{$statusInfo['files']} files, {$statusInfo['processed']} processed, {$statusInfo['errors']} errors", [], __FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ throw new Exception("{$statusInfo['files']} files, {$statusInfo['processed']} processed, {$statusInfo['errors']} errors");
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
function MAKE_PKG_COMPONENT($h,$installer_dir_tar,$installer_url,$installer_tmp,$cmd,$exit_file,$installer_dir_name,$pkg_id,$encrypt=false) {
|
|
function MAKE_PKG_COMPONENT($h,$installer_dir_tar,$installer_url,$installer_tmp,$cmd,$exit_file,$installer_dir_name,$pkg_id,$encrypt=false) {
|
|
|
|
|
|
|
|
- $UID=$h->ID;
|
|
|
|
|
- $installer_dir=$installer_dir_tar."/".$installer_dir_name; //pakowany katalog z instalatorem
|
|
|
|
|
- // $installer_dir_tar="/Library/Server/Web/Data/Sites/Default/PLIKI/SES_PROCESY5_A"; //katalog CWD z ktorego budowana jest instalacja
|
|
|
|
|
- // $installer_url="http://biuro.biall-net.pl/PLIKI/SES_PROCESY5_A/"; //miejsce do sciagania instalatora przez WWW
|
|
|
|
|
- // $installer_tmp="/tmp/pl.procesy5_".$UID.".".$h->SERVER_ADDRESS; //miejsce do ktorego installer odpakuje wszystko
|
|
|
|
|
- exec('rm -Rf '.$installer_dir);
|
|
|
|
|
- mkdir($installer_dir,0777);
|
|
|
|
|
- mkdir($installer_dir."/install.bash",0777);
|
|
|
|
|
- mkdir($installer_dir."/install.executed_ok",0777);
|
|
|
|
|
-
|
|
|
|
|
- echo "<br> I mkdir ".$installer_dir;
|
|
|
|
|
- $ins_sh="#!/bin/sh \nshopt -s dotglob\n echo 'instaluje i robie LS' >>/tmp/loginst \n ls >>/tmp/loginst \n declare PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/local/bin:/opt/local/lib/mysql55/bin/:/Applications/Server.app/Contents/ServerRoot/usr/sbin/\n \n";
|
|
|
|
|
- foreach($cmd as $command_id=>$command) {
|
|
|
|
|
- if(isset($command['rsh'])) {
|
|
|
|
|
- //$exec=SSH_COMMAND_REMOTE_CREATE($h->ADMIN_USERNAME,$h->SERVER_ADDRESS_IP,$h->ADMIN_USERNAME_PASSWD,$command['rsh']);
|
|
|
|
|
- //DEBUG_S(-3,$command_id.':in '.htmlspecialchars(str_replace(array($h->ADMIN_USERNAME_PASSWD,str_replace('!','\!',$h->ADMIN_USERNAME_PASSWD)),'xxxxxx',$exec)),str_replace($h->ADMIN_USERNAME_PASSWD,'xxxxxx',$exec));
|
|
|
|
|
- //flush();
|
|
|
|
|
- $out="";$exit="";
|
|
|
|
|
- //exec($exec,$out,$exit);
|
|
|
|
|
- $file_sh="install.bash/".$command_id.".bash";
|
|
|
|
|
- $ins_sh.="if [ -e ".$installer_tmp."/".$file_sh." ] ; then echo 'running:".$file_sh."'; ".$installer_tmp."/".$file_sh." && mv ".$installer_tmp."/".$file_sh." ".$installer_tmp."/install.executed_ok/ || { osascript -e \"tell app \\\"System Events\\\" to display dialog \\\"`( echo 'Problem z komenda ".$installer_tmp."/".$file_sh."' )`\\\"\" ; exit 1 ; } fi \n";
|
|
|
|
|
-// touch($file_sh);
|
|
|
|
|
- $file=fopen($installer_dir."/".$file_sh, "w") or die('Cannot open file: '.$installer_dir."/".$file_sh);
|
|
|
|
|
- fwrite($file,"#!/bin/sh\n".$command['rsh']."\n");
|
|
|
|
|
- fclose($file);
|
|
|
|
|
- chmod($installer_dir."/".$file_sh, 0755);
|
|
|
|
|
- //$ins_sh.=$command['rsh']."\n\r";
|
|
|
|
|
- DEBUG_S(-3,$command_id.':out of ',array($command['rsh'],$installer_dir."/".$file_sh,$out,$exit),__FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
- flush();
|
|
|
|
|
- } else if(isset($command['scp'])) {
|
|
|
|
|
- //$command_out='/opt/local/bin/sshpass -p '.$h->ADMIN_USERNAME_PASSWD.' /usr/bin/scp -v -3 -o StrictHostKeyChecking=no '.$command['scp'][0].' '.$h->ADMIN_USERNAME.'@' . $h->SERVER_ADDRESS_IP . ':'.$command['scp'][1];
|
|
|
|
|
- //DEBUG_S(-3,$command_id.':in '.str_replace(array($h->ADMIN_USERNAME_PASSWD,str_replace('!','\!',$h->ADMIN_USERNAME_PASSWD)),'xxxxxx',$command_out),htmlspecialchars(str_replace($h->ADMIN_USERNAME_PASSWD,'xxxxxx',$command_out)));
|
|
|
|
|
- //flush();
|
|
|
|
|
- mkdir($installer_dir."/".$command_id,0777);
|
|
|
|
|
- exec("cp ".$command['scp'][0]." ".$installer_dir."/".$command_id);
|
|
|
|
|
- $ins_sh.="mv ".$installer_tmp."/".$command_id."/* ".$command['scp'][1]." \n";
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- } else if(isset($command['scp_hidden_files'])) {
|
|
|
|
|
- mkdir("{$installer_dir}/{$command_id}", 0777);
|
|
|
|
|
- exec("cp {$command['scp_hidden_files'][0]} {$installer_dir}/{$command_id}");
|
|
|
|
|
- $hidden_files = explode('/', $command['scp_hidden_files'][0]);
|
|
|
|
|
- $hidden_files = end($hidden_files);
|
|
|
|
|
- $ins_sh .= "mv {$installer_tmp}/{$command_id}/{$hidden_files} {$command['scp_hidden_files'][1]} \n";
|
|
|
|
|
- } else if(isset($command['scp_root'])) {
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- mkdir($installer_dir."/".$command_id,0777);
|
|
|
|
|
- $cmd="cp -r ".$command['scp_root'][0]." ".$installer_dir."/".$command_id;
|
|
|
|
|
-
|
|
|
|
|
- exec($cmd,$out,$exit);
|
|
|
|
|
- //@2014-09 tak bylo, ale sie zle instalowalo wiec dajemy cp -a
|
|
|
|
|
- $ins_sh.="mv ".$installer_tmp."/".$command_id."/* ".$command['scp_root'][1]." \n";
|
|
|
|
|
- DEBUG_S(-3,$cmd.':out of ',array($command['scp_root'],$installer_dir."/".$file_sh,$command_id,$out,$exit),__FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
-
|
|
|
|
|
- //$ins_sh.="cp -a ".$installer_tmp."/".$command_id."/* ".$command['scp_root'][1]." \n";
|
|
|
|
|
-
|
|
|
|
|
- flush();
|
|
|
|
|
- //set_time_limit(36000);
|
|
|
|
|
- }
|
|
|
|
|
- $last_command_id=$command_id;
|
|
|
|
|
|
|
+ $UID=$h->ID;
|
|
|
|
|
+ $installer_dir=$installer_dir_tar."/".$installer_dir_name; //pakowany katalog z instalatorem
|
|
|
|
|
+ //$installer_dir_tar="/Library/Server/Web/Data/Sites/Default/PLIKI/SES_PROCESY5_A"; //katalog CWD z ktorego budowana jest instalacja
|
|
|
|
|
+ //$installer_url="http://biuro.biall-net.pl/PLIKI/SES_PROCESY5_A/"; //miejsce do sciagania instalatora przez WWW
|
|
|
|
|
+ //$installer_tmp="/tmp/pl.procesy5_".$UID.".".$h->SERVER_ADDRESS; //miejsce do ktorego installer odpakuje wszystko
|
|
|
|
|
+ exec('rm -Rf '.$installer_dir);
|
|
|
|
|
+ mkdir($installer_dir,0777);
|
|
|
|
|
+ mkdir($installer_dir."/install.bash",0777);
|
|
|
|
|
+ mkdir($installer_dir."/install.executed_ok",0777);
|
|
|
|
|
+
|
|
|
|
|
+ echo "<br> I mkdir ".$installer_dir;
|
|
|
|
|
+ $ins_sh="#!/bin/sh \nshopt -s dotglob\n echo 'instaluje i robie LS' >>/tmp/loginst \n ls >>/tmp/loginst \n declare PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/local/bin:/opt/local/lib/mysql55/bin/:/Applications/Server.app/Contents/ServerRoot/usr/sbin/\n \n";
|
|
|
|
|
+ foreach($cmd as $command_id=>$command) {
|
|
|
|
|
+ if(isset($command['rsh'])) {
|
|
|
|
|
+ //$exec=SSH_COMMAND_REMOTE_CREATE($h->ADMIN_USERNAME,$h->SERVER_ADDRESS_IP,$h->ADMIN_USERNAME_PASSWD,$command['rsh']);
|
|
|
|
|
+ //DEBUG_S(-3,$command_id.':in '.htmlspecialchars(str_replace(array($h->ADMIN_USERNAME_PASSWD,str_replace('!','\!',$h->ADMIN_USERNAME_PASSWD)),'xxxxxx',$exec)),str_replace($h->ADMIN_USERNAME_PASSWD,'xxxxxx',$exec));
|
|
|
|
|
+ //flush();
|
|
|
|
|
+ $out="";$exit="";
|
|
|
|
|
+ //exec($exec,$out,$exit);
|
|
|
|
|
+ $file_sh="install.bash/".$command_id.".bash";
|
|
|
|
|
+ $ins_sh.="if [ -e ".$installer_tmp."/".$file_sh." ] ; then echo 'running:".$file_sh."'; ".$installer_tmp."/".$file_sh." && mv ".$installer_tmp."/".$file_sh." ".$installer_tmp."/install.executed_ok/ || { osascript -e \"tell app \\\"System Events\\\" to display dialog \\\"`( echo 'Problem z komenda ".$installer_tmp."/".$file_sh."' )`\\\"\" ; exit 1 ; } fi \n";
|
|
|
|
|
+ //touch($file_sh);
|
|
|
|
|
+ $file=fopen($installer_dir."/".$file_sh, "w") or die('Cannot open file: '.$installer_dir."/".$file_sh);
|
|
|
|
|
+ fwrite($file,"#!/bin/sh\n".$command['rsh']."\n");
|
|
|
|
|
+ fclose($file);
|
|
|
|
|
+ chmod($installer_dir."/".$file_sh, 0755);
|
|
|
|
|
+ //$ins_sh.=$command['rsh']."\n\r";
|
|
|
|
|
+ DEBUG_S(-3,$command_id.':out of ',array($command['rsh'],$installer_dir."/".$file_sh,$out,$exit),__FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
+ flush();
|
|
|
|
|
+ } else if(isset($command['scp'])) {
|
|
|
|
|
+ //$command_out='/opt/local/bin/sshpass -p '.$h->ADMIN_USERNAME_PASSWD.' /usr/bin/scp -v -3 -o StrictHostKeyChecking=no '.$command['scp'][0].' '.$h->ADMIN_USERNAME.'@' . $h->SERVER_ADDRESS_IP . ':'.$command['scp'][1];
|
|
|
|
|
+ //DEBUG_S(-3,$command_id.':in '.str_replace(array($h->ADMIN_USERNAME_PASSWD,str_replace('!','\!',$h->ADMIN_USERNAME_PASSWD)),'xxxxxx',$command_out),htmlspecialchars(str_replace($h->ADMIN_USERNAME_PASSWD,'xxxxxx',$command_out)));
|
|
|
|
|
+ //flush();
|
|
|
|
|
+ mkdir($installer_dir."/".$command_id,0777);
|
|
|
|
|
+ exec("cp ".$command['scp'][0]." ".$installer_dir."/".$command_id);
|
|
|
|
|
+ $ins_sh.="mv ".$installer_tmp."/".$command_id."/* ".$command['scp'][1]." \n";
|
|
|
|
|
+
|
|
|
|
|
+ } else if(isset($command['scp_hidden_files'])) {
|
|
|
|
|
+ mkdir("{$installer_dir}/{$command_id}", 0777);
|
|
|
|
|
+ exec("cp {$command['scp_hidden_files'][0]} {$installer_dir}/{$command_id}");
|
|
|
|
|
+ $hidden_files = explode('/', $command['scp_hidden_files'][0]);
|
|
|
|
|
+ $hidden_files = end($hidden_files);
|
|
|
|
|
+ $ins_sh .= "mv {$installer_tmp}/{$command_id}/{$hidden_files} {$command['scp_hidden_files'][1]} \n";
|
|
|
|
|
+ } else if(isset($command['scp_root'])) {
|
|
|
|
|
+
|
|
|
|
|
+ mkdir($installer_dir."/".$command_id,0777);
|
|
|
|
|
+ $cmd="cp -r ".$command['scp_root'][0]." ".$installer_dir."/".$command_id;
|
|
|
|
|
+
|
|
|
|
|
+ exec($cmd,$out,$exit);
|
|
|
|
|
+ //@2014-09 tak bylo, ale sie zle instalowalo wiec dajemy cp -a
|
|
|
|
|
+ $ins_sh.="mv ".$installer_tmp."/".$command_id."/* ".$command['scp_root'][1]." \n";
|
|
|
|
|
+ DEBUG_S(-3,$cmd.':out of ',array($command['scp_root'],$installer_dir."/".$file_sh,$command_id,$out,$exit),__FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
+
|
|
|
|
|
+ //$ins_sh.="cp -a ".$installer_tmp."/".$command_id."/* ".$command['scp_root'][1]." \n";
|
|
|
|
|
+
|
|
|
|
|
+ flush();
|
|
|
|
|
+ //set_time_limit(36000);
|
|
|
|
|
+ }
|
|
|
|
|
+ $last_command_id=$command_id;
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if(($encrypt)) {
|
|
|
|
|
- // TODO: Router::getRoute('Install')->encodeSourceFiles($installPath = '/path_to_git_repo', $domains = [ 'domain.com', 'localhost' ], $dbg = false);
|
|
|
|
|
- //TODO detect several hosts at the same IP address/domain to make it allow to work.
|
|
|
|
|
- // select SERVER_ADDRESS_IP
|
|
|
|
|
- //$exec='cd '.$installer_dir.' && /Applications/SourceGuardian.app/Contents/MacOS/sgencoder -b- --domain '.$h->SERVER_ADDRESS_SHORT.' -r *.php -x superedit-DB_PROCEDURES_CREATE.php';
|
|
|
|
|
|
|
+ if(($encrypt)) {
|
|
|
|
|
+ //TODO: Router::getRoute('Install')->encodeSourceFiles($installPath = '/path_to_git_repo', $domains = [ 'domain.com', 'localhost' ], $dbg = false);
|
|
|
|
|
+ // TODO detect several hosts at the same IP address/domain to make it allow to work.
|
|
|
|
|
+ // select SERVER_ADDRESS_IP
|
|
|
|
|
+ //$exec='cd '.$installer_dir.' && /Applications/SourceGuardian.app/Contents/MacOS/sgencoder -b- --domain '.$h->SERVER_ADDRESS_SHORT.' -r *.php -x superedit-DB_PROCEDURES_CREATE.php';
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
- $skipPhpFiles = array();
|
|
|
|
|
- $skipPhpFiles[] = 'bash_sync_perms.php';
|
|
|
|
|
- $skipPhpFiles[] = 'bash_install_check.php';
|
|
|
|
|
- $skipPhpFiles[] = '.config.php';
|
|
|
|
|
- $skipPhpFiles[] = '.config_base_structure.php';
|
|
|
|
|
- $skipPhpFiles[] = 'se-lib/V.php';
|
|
|
|
|
- $skipPhpFiles[] = 'se-lib/Lib.php';
|
|
|
|
|
- $skipPhpFiles[] = 'se-lib/DB.php';
|
|
|
|
|
- $skipPhpFiles[] = 'se-lib/DBG.php';
|
|
|
|
|
- $skipPhpFiles[] = 'se-lib/User.php';
|
|
|
|
|
- $skipPhpFiles[] = 'se-lib/UserProfile.php';
|
|
|
|
|
- $skipPhpFiles[] = 'se-lib/Config.php';
|
|
|
|
|
- $skipPhpFiles[] = 'se-lib/Config/INI.php';
|
|
|
|
|
- $skipPhpFiles[] = 'se-lib/FoldersConfig.php';
|
|
|
|
|
- $skipPhpFiles[] = 'se-lib/FileUploader.php';
|
|
|
|
|
- $skipPhpFiles[] = 'se-lib/Route/Budget.php';
|
|
|
|
|
- $skipPhpFiles[] = 'se-lib/Route/FixCrmProcesInitIdx.php';
|
|
|
|
|
- $skipPhpFiles[] = 'se-lib/Route/FixProjectPath.php';
|
|
|
|
|
- $skipPhpFiles[] = 'se-lib/Route/FixZasobPath.php';
|
|
|
|
|
- //$skipPhpFiles[] = 'se-lib/Route/Install.php';
|
|
|
|
|
- $skipPhpFiles[] = 'se-lib/Route/Msgs.php';
|
|
|
|
|
- $skipPhpFiles[] = 'se-lib/Route/UrlAction/WmsGenerate.php';
|
|
|
|
|
- $skipPhpFiles[] = 'superedit-DB_PROCEDURES_CREATE.php';
|
|
|
|
|
- $skipPhpFiles[] = 'se-lib/DataSourceException.php';
|
|
|
|
|
- $skipPhpFiles[] = 'se-lib/Core/Pdo.php';
|
|
|
|
|
- $skipPhpFiles[] = 'se-lib/Cron.php';
|
|
|
|
|
- $skipPhpFiles[] = 'se-lib/Router.php';
|
|
|
|
|
- $skipPhpFiles[] = 'se-lib/RouteBase.php';
|
|
|
|
|
- $skipPhpFiles[] = 'se-lib/HttpException.php';
|
|
|
|
|
- $skipPhpFiles[] = 'se-lib/DebugExecutionTime.php';
|
|
|
|
|
- $skipPhpFiles[] = 'WindykacjaZestawienia.php';
|
|
|
|
|
- $skipPhpFiles[] = 'superedit-DB_PROCEDURES_CREATE.php';
|
|
|
|
|
|
|
+ $skipPhpFiles = array();
|
|
|
|
|
+ $skipPhpFiles[] = 'bash_sync_perms.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'bash_install_check.php';
|
|
|
|
|
+ $skipPhpFiles[] = '.config.php';
|
|
|
|
|
+ $skipPhpFiles[] = '.config_base_structure.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/V.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/Lib.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/DB.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/DBG.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/User.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/UserProfile.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/Config.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/Config/INI.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/FoldersConfig.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/FileUploader.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/Route/Budget.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/Route/FixCrmProcesInitIdx.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/Route/FixProjectPath.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/Route/FixZasobPath.php';
|
|
|
|
|
+ //$skipPhpFiles[] = 'se-lib/Route/Install.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/Route/Msgs.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/Route/UrlAction/WmsGenerate.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'superedit-DB_PROCEDURES_CREATE.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/DataSourceException.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/Core/Pdo.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/Cron.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/Router.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/RouteBase.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/HttpException.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/DebugExecutionTime.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'WindykacjaZestawienia.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'superedit-DB_PROCEDURES_CREATE.php';
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
@@ -2456,191 +2525,119 @@ function MAKE_PKG_COMPONENT($h,$installer_dir_tar,$installer_url,$installer_tmp,
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
- $skipPhpFiles = array();
|
|
|
|
|
- $skipPhpFiles[] = 'bash_sync_perms.php';
|
|
|
|
|
- $skipPhpFiles[] = 'bash_install_check.php';
|
|
|
|
|
- $skipPhpFiles[] = '.config.php';
|
|
|
|
|
- $skipPhpFiles[] = '.config_base_structure.php';
|
|
|
|
|
- $skipPhpFiles[] = 'V.php';
|
|
|
|
|
- $skipPhpFiles[] = 'Lib.php';
|
|
|
|
|
- $skipPhpFiles[] = 'DB.php';
|
|
|
|
|
- $skipPhpFiles[] = 'DBG.php';
|
|
|
|
|
- $skipPhpFiles[] = 'User.php';
|
|
|
|
|
- $skipPhpFiles[] = 'UserProfile.php';
|
|
|
|
|
- $skipPhpFiles[] = 'Config.php';
|
|
|
|
|
- $skipPhpFiles[] = 'INI.php';
|
|
|
|
|
- $skipPhpFiles[] = 'FoldersConfig.php';
|
|
|
|
|
- $skipPhpFiles[] = 'FileUploader.php';
|
|
|
|
|
- $skipPhpFiles[] = 'Budget.php';
|
|
|
|
|
- $skipPhpFiles[] = 'FixCrmProcesInitIdx.php';
|
|
|
|
|
- $skipPhpFiles[] = 'FixProjectPath.php';
|
|
|
|
|
- $skipPhpFiles[] = 'FixZasobPath.php';
|
|
|
|
|
- //$skipPhpFiles[] = 'se-lib/Route/Install.php';
|
|
|
|
|
- $skipPhpFiles[] = 'Msgs.php';
|
|
|
|
|
- $skipPhpFiles[] = 'WmsGenerate.php';
|
|
|
|
|
- $skipPhpFiles[] = 'superedit-DB_PROCEDURES_CREATE.php';
|
|
|
|
|
- $skipPhpFiles[] = 'DataSourceException.php';
|
|
|
|
|
- $skipPhpFiles[] = 'Pdo.php';
|
|
|
|
|
- $skipPhpFiles[] = 'Cron.php';
|
|
|
|
|
- $skipPhpFiles[] = 'Router.php';
|
|
|
|
|
- $skipPhpFiles[] = 'RouteBase.php';
|
|
|
|
|
- $skipPhpFiles[] = 'HttpException.php';
|
|
|
|
|
- $skipPhpFiles[] = 'DebugExecutionTime.php';
|
|
|
|
|
- $skipPhpFiles[] = 'WindykacjaZestawienia.php';
|
|
|
|
|
- $skipPhpFiles[] = 'superedit-DB_PROCEDURES_CREATE.php';
|
|
|
|
|
- $skipPhpFiles[] = 'UI.php';
|
|
|
|
|
- $skipPhpFiles[] = 'Request.php';
|
|
|
|
|
- $skipPhpFiles[] = 'BiAuditGenerate.php';
|
|
|
|
|
- $skipPhpFiles[] = 'Theme.php';
|
|
|
|
|
- $skipPhpFiles[] = 'bash_Route_Users_Task_syncUser.php';
|
|
|
|
|
- $skipPhpFiles[] = 'bash_Route_Users_Task_syncGroup.php';
|
|
|
|
|
- $skipPhpFiles[] = 'bash_force_classified_table_by_GroupID.php';
|
|
|
|
|
- $skipPhpFiles[] = 'bash_Route_Users_Task_AddUser.php';
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- $skipFilesSgencoder = (!empty($skipPhpFiles)) ? ' -x ' . implode(' -x ', $skipPhpFiles) : '';
|
|
|
|
|
-
|
|
|
|
|
- $phpVersionsForSgencoder = '--phpversion 5.5 --phpversion 5.6';// encode for PHP 5.x (currently supported PHP 5.0-5.6)
|
|
|
|
|
-
|
|
|
|
|
- $exec='cd '.$installer_dir.' && /Applications/SourceGuardian.app/Contents/MacOS/sgencoder '.$phpVersionsForSgencoder.' -b- '.INSTALL_SES_PROCESY_A::get_same_domains_for_install($h->SERVER_ADDRESS_SHORT, $h->SERVER_ADDRESS).' -r *.php ' . $skipFilesSgencoder;
|
|
|
|
|
-
|
|
|
|
|
- exec($exec,$out,$exit);$out="";$exit="";
|
|
|
|
|
- DEBUG_S(-3,'Zakodowanie kodu php/kompilacja z licencja i kluczem',array($exec,$out,$exit),__FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
|
|
+ $skipPhpFiles = array();
|
|
|
|
|
+ $skipPhpFiles[] = 'bash_sync_perms.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'bash_install_check.php';
|
|
|
|
|
+ $skipPhpFiles[] = '.config.php';
|
|
|
|
|
+ $skipPhpFiles[] = '.config_base_structure.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'V.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'Lib.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'DB.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'DBG.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'User.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'UserProfile.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'Config.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'INI.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'FoldersConfig.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'FileUploader.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'Budget.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'FixCrmProcesInitIdx.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'FixProjectPath.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'FixZasobPath.php';
|
|
|
|
|
+ //$skipPhpFiles[] = 'se-lib/Route/Install.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'Msgs.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'WmsGenerate.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'superedit-DB_PROCEDURES_CREATE.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'DataSourceException.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'Pdo.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'Cron.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'Router.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'RouteBase.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'HttpException.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'DebugExecutionTime.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'WindykacjaZestawienia.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'superedit-DB_PROCEDURES_CREATE.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'UI.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'Request.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'BiAuditGenerate.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'Theme.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'bash_Route_Users_Task_syncUser.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'bash_Route_Users_Task_syncGroup.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'bash_force_classified_table_by_GroupID.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'bash_Route_Users_Task_AddUser.php';
|
|
|
|
|
+
|
|
|
|
|
+ $skipFilesSgencoder = (!empty($skipPhpFiles)) ? ' -x ' . implode(' -x ', $skipPhpFiles) : '';
|
|
|
|
|
+
|
|
|
|
|
+ $phpVersionsForSgencoder = '--phpversion 5.5 --phpversion 5.6';// encode for PHP 5.x (currently supported PHP 5.0-5.6)
|
|
|
|
|
+
|
|
|
|
|
+ $exec='cd '.$installer_dir.' && /Applications/SourceGuardian.app/Contents/MacOS/sgencoder '.$phpVersionsForSgencoder.' -b- '.INSTALL_SES_PROCESY_A::get_same_domains_for_install($h->SERVER_ADDRESS_SHORT, $h->SERVER_ADDRESS).' -r *.php ' . $skipFilesSgencoder;
|
|
|
|
|
+
|
|
|
|
|
+ exec($exec,$out,$exit);$out="";$exit="";
|
|
|
|
|
+ DEBUG_S(-3,'Zakodowanie kodu php/kompilacja z licencja i kluczem',array($exec,$out,$exit),__FILE__,__FUNCTION__,__LINE__);
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ if (empty($domains = INSTALL_SES_PROCESY_A::get_same_domains_for_install($h->SERVER_ADDRESS_SHORT, $h->SERVER_ADDRESS))) throw new Exception("Domains not found");
|
|
|
|
|
+ $domainEncodePhpFiles = [
|
|
|
|
|
+ 'ant.php',
|
|
|
|
|
+ 'api.php',
|
|
|
|
|
+ 'budynki.php',
|
|
|
|
|
+ 'index-ajax.php',
|
|
|
|
|
+ 'index.php',
|
|
|
|
|
+ 'procesy5.php',
|
|
|
|
|
+ 'session-expire.php',
|
|
|
|
|
+ 'test-sync.php',
|
|
|
|
|
+ 'wfs-data.php',
|
|
|
|
|
+ 'wfs-qgis.php',
|
|
|
|
|
+ 'wfs.php',
|
|
|
|
|
+ ];
|
|
|
|
|
+ if (!encodePhpFiles($installer_dir, $domains, $domainEncodePhpFiles)) {
|
|
|
|
|
+ DEBUG_S(-3, "No php files found to encode", [], __FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception $e) {
|
|
|
|
|
+ DEBUG_S(-3, "Problem with encoding php files", [$e->getMessage()], __FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
+ die();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ //usuniecie musi byc przed instalacja TODO
|
|
|
|
|
+ //$last_command_id++;
|
|
|
|
|
+ //
|
|
|
|
|
+ //$ins_sh.=MakeCommand($command_id,"rm -Rf ".$installer_tmp,$installer_tmp,$installer_dir) ;
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- try {
|
|
|
|
|
- if (empty($installer_dir)) throw new Exception("Install path not found");
|
|
|
|
|
- if (empty($domains = INSTALL_SES_PROCESY_A::get_same_domains_for_install($h->SERVER_ADDRESS_SHORT, $h->SERVER_ADDRESS))) throw new Exception("Domains not found");
|
|
|
|
|
-
|
|
|
|
|
- $phpVersionsForSgencoder = '--phpversion 5.5 --phpversion 5.6';// encode for PHP 5.x (currently supported PHP 5.0-5.6)
|
|
|
|
|
-
|
|
|
|
|
- $domainEncodePhpFiles = [
|
|
|
|
|
- 'ant.php',
|
|
|
|
|
- 'api.php',
|
|
|
|
|
- 'budynki.php',
|
|
|
|
|
- 'index-ajax.php',
|
|
|
|
|
- 'index.php',
|
|
|
|
|
- 'procesy5.php',
|
|
|
|
|
- 'session-expire.php',
|
|
|
|
|
- 'test-sync.php',
|
|
|
|
|
- 'wfs-data.php',
|
|
|
|
|
- 'wfs-qgis.php',
|
|
|
|
|
- 'wfs.php',
|
|
|
|
|
- ];
|
|
|
|
|
-
|
|
|
|
|
- $cmd = "cd '{$installer_dir}' && find . -type f -name '*.php' ";
|
|
|
|
|
- $out = ''; $ret = '';
|
|
|
|
|
- exec($cmd, $out, $ret);
|
|
|
|
|
- DEBUG_S(-3,'Files found to encode',array($cmd,$out,$ret),__FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
- if (0 !== $ret) throw new Exception("Error at find php files");
|
|
|
|
|
- if (empty($out)) throw new Exception("No php files found");
|
|
|
|
|
- $allPhpFiles = array_map(function ($phpFilePath) {
|
|
|
|
|
- return ('./' == substr($phpFilePath, 0, 2))? substr($phpFilePath, 2) : $phpFilePath;
|
|
|
|
|
- }, $out);
|
|
|
|
|
-
|
|
|
|
|
- $domainEncodePhpFiles = array_filter($allPhpFiles, function ($phpFilePath) use ($domainEncodePhpFiles) {
|
|
|
|
|
- foreach ($domainEncodePhpFiles as $file) {
|
|
|
|
|
- if (preg_match("|^[[:digit:]]+/" . str_replace('.', '\.', $file) . "$|", $phpFilePath)) return true;
|
|
|
|
|
- }
|
|
|
|
|
- return false;
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- $freeEncodePhpFiles = array_filter($allPhpFiles, function ($phpFilePath) use ($domainEncodePhpFiles) {
|
|
|
|
|
- if ('se-lib/Vendor/' === substr($phpFilePath, 0, strlen('se-lib/Vendor/'))) return false; // SKIP se-lib/Vendor/*
|
|
|
|
|
- if ('.ini.php' === substr($phpFilePath, -1 * strlen('.ini.php'))) return false; // SKIP *.ini.php
|
|
|
|
|
- return (!in_array($phpFilePath, $domainEncodePhpFiles));
|
|
|
|
|
- });
|
|
|
|
|
- DEBUG_S(-3,'freeEncodePhpFiles',$freeEncodePhpFiles,__FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
- if (empty($freeEncodePhpFiles)) throw new Exception("No php files to encode");
|
|
|
|
|
-
|
|
|
|
|
- $cmdTempl = "cd {$installer_dir} && /Applications/SourceGuardian.app/Contents/MacOS/sgencoder {$phpVersionsForSgencoder} -b- ";
|
|
|
|
|
- $cmdDomainEncodeDomainsTempl = " --domain " . implode(" --domain ", array_merge($domains, ['localhost']));
|
|
|
|
|
- $cmdDomainEncodeFilesTempl = " " . implode(" ", $domainEncodePhpFiles);
|
|
|
|
|
- $cmdFreeEncodeFilesTempl = " " . implode(" ", $freeEncodePhpFiles);
|
|
|
|
|
-
|
|
|
|
|
- $cmds = [
|
|
|
|
|
- $cmdTempl . $cmdDomainEncodeDomainsTempl . $cmdDomainEncodeFilesTempl,
|
|
|
|
|
- $cmdTempl . $cmdFreeEncodeFilesTempl,
|
|
|
|
|
- ];
|
|
|
|
|
-
|
|
|
|
|
- $returnValues = [];
|
|
|
|
|
- foreach ($cmds as $cmd) {
|
|
|
|
|
- $out = ''; $ret = '';
|
|
|
|
|
- exec($cmd, $out, $ret);
|
|
|
|
|
- $encoderSummaryLine = end($out);
|
|
|
|
|
- $returnValues[] = $encoderSummaryLine;
|
|
|
|
|
- DEBUG_S(-3,'Encoded files',array($cmd, $out, $ret),__FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
- if (empty($out)) throw new Exception("No output for encode files command");
|
|
|
|
|
- }
|
|
|
|
|
- $statusInfo = array_reduce($returnValues, function ($ret, $encoderSummaryLine) {
|
|
|
|
|
- DEBUG_S(-3,'DBG reduce [$ret, $encoderSummaryLine]',array($ret, $encoderSummaryLine),__FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
- $matches = [];
|
|
|
|
|
- preg_match_all('/(\d+) files, (\d+) processed, (\d+) errors/', $encoderSummaryLine, $matches, PREG_SET_ORDER, 0);
|
|
|
|
|
- return [
|
|
|
|
|
- 'files' => $ret['files'] + (int)$matches[0][1],
|
|
|
|
|
- 'processed' => $ret['processed'] + (int)$matches[0][2],
|
|
|
|
|
- 'errors' => $ret['errors'] + (int)$matches[0][3],
|
|
|
|
|
- ];
|
|
|
|
|
- }, [
|
|
|
|
|
- 'files' => 0,
|
|
|
|
|
- 'processed' => 0,
|
|
|
|
|
- 'errors' => 0,
|
|
|
|
|
- ]);
|
|
|
|
|
- if ($statusInfo['errors'] === 0 && $statusInfo['files'] > 0) {
|
|
|
|
|
- DEBUG_S(-3, "{$statusInfo['files']} files, {$statusInfo['processed']} processed, {$statusInfo['errors']} errors", [], __FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
- } else {
|
|
|
|
|
- throw new Exception("{$statusInfo['files']} files, {$statusInfo['processed']} processed, {$statusInfo['errors']} errors");
|
|
|
|
|
- }
|
|
|
|
|
- } catch (Exception $e) {
|
|
|
|
|
- DEBUG_S(-3, "Problem with encoding php files", [$e->getMessage()], __FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
- die();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- //usuniecie musi byc przed instalacja TODO
|
|
|
|
|
- //$last_command_id++;
|
|
|
|
|
- //
|
|
|
|
|
- //$ins_sh.=MakeCommand($command_id,"rm -Rf ".$installer_tmp,$installer_tmp,$installer_dir) ;
|
|
|
|
|
-
|
|
|
|
|
- /* klucz nie potrzebny do kodowania dla domeny
|
|
|
|
|
- $last_command_id++;
|
|
|
|
|
- mkdir($installer_dir."/".$last_command_id,0777);
|
|
|
|
|
- $exec='cd '.$installer_dir."/".$last_command_id.' && /Applications/SourceGuardian.app/Contents/MacOS/licgen --projid '.$h->ID.' --projkey '.$h->ID.' procesylicence_se';
|
|
|
|
|
- exec($exec,$out,$exit);$out="";$exit="";
|
|
|
|
|
-
|
|
|
|
|
- DEBUG_S(-3,'Wygenerowanie klucza dla klienta',array($exec,$out,$exit),__FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
- $ins_sh.="mv ".$last_command_id."/* /Library/Server/Web/Data/Sites/Default/SE/ \n";
|
|
|
|
|
- */
|
|
|
|
|
-
|
|
|
|
|
- mkdir($installer_dir."/scripts",0777);
|
|
|
|
|
- $file=fopen($installer_dir."/scripts/postinstall", "w") or die('Cannot open file: '.$installer_dir."/scripts/postinstall");
|
|
|
|
|
- fwrite($file,$ins_sh."\n");
|
|
|
|
|
- fclose($file);
|
|
|
|
|
|
|
+ /* klucz nie potrzebny do kodowania dla domeny
|
|
|
|
|
+ $last_command_id++;
|
|
|
|
|
+ mkdir($installer_dir."/".$last_command_id,0777);
|
|
|
|
|
+ $exec='cd '.$installer_dir."/".$last_command_id.' && /Applications/SourceGuardian.app/Contents/MacOS/licgen --projid '.$h->ID.' --projkey '.$h->ID.' procesylicence_se';
|
|
|
|
|
+ exec($exec,$out,$exit);$out="";$exit="";
|
|
|
|
|
|
|
|
- // die();
|
|
|
|
|
- chmod($installer_dir."/scripts/"."postinstall", 0755); $out="";$exit="";
|
|
|
|
|
- // $exit_file=str_replace('.', '_', $UID.".".$h->SERVER_ADDRESS);
|
|
|
|
|
|
|
+ DEBUG_S(-3,'Wygenerowanie klucza dla klienta',array($exec,$out,$exit),__FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
+ $ins_sh.="mv ".$last_command_id."/* /Library/Server/Web/Data/Sites/Default/SE/ \n";
|
|
|
|
|
+ */
|
|
|
|
|
|
|
|
- //$exec="tar -C".$installer_dir_tar." -cz ".$UID.".".$h->SERVER_ADDRESS." > ".$installer_dir_tar."/".$exit_file.".tar.gz";
|
|
|
|
|
- //exec($exec ,$out,$exit);
|
|
|
|
|
- //DEBUG_S(-3,'Tarowanie ',array($exec,$out,$exit),__FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
|
|
+ mkdir($installer_dir."/scripts",0777);
|
|
|
|
|
+ $file=fopen($installer_dir."/scripts/postinstall", "w") or die('Cannot open file: '.$installer_dir."/scripts/postinstall");
|
|
|
|
|
+ fwrite($file,$ins_sh."\n");
|
|
|
|
|
+ fclose($file);
|
|
|
|
|
|
|
|
- $exec="cd ".$installer_dir_tar." && pkgbuild --scripts ".$installer_dir_name."/scripts/ --root ".$installer_dir_name." --identifier ".$pkg_id." --install-location ".$installer_tmp." ".$exit_file.".pkg" ;
|
|
|
|
|
- exec($exec ,$out,$exit);
|
|
|
|
|
- DEBUG_S(-3,'Robiebie pkg ',array($exec,$out,$exit),__FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
|
|
+ //die();
|
|
|
|
|
+ chmod($installer_dir."/scripts/"."postinstall", 0755); $out="";$exit="";
|
|
|
|
|
+ //$exit_file=str_replace('.', '_', $UID.".".$h->SERVER_ADDRESS);
|
|
|
|
|
|
|
|
|
|
+ //$exec="tar -C".$installer_dir_tar." -cz ".$UID.".".$h->SERVER_ADDRESS." > ".$installer_dir_tar."/".$exit_file.".tar.gz";
|
|
|
|
|
+ //exec($exec ,$out,$exit);
|
|
|
|
|
+ //DEBUG_S(-3,'Tarowanie ',array($exec,$out,$exit),__FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
|
|
|
- echo "<hr><A href='{$installer_url}{$exit_file}.pkg'> instalacja pojedynczego komponentu {$exit_file}.pkg - NIE ŚCIĄGAJ JEJ!!!</a>\n";
|
|
|
|
|
- //echo "<pre>Instalator skrypt TODO : \n".htmlspecialchars($ins_sh)."</pre>";
|
|
|
|
|
|
|
+ $exec="cd ".$installer_dir_tar." && pkgbuild --scripts ".$installer_dir_name."/scripts/ --root ".$installer_dir_name." --identifier ".$pkg_id." --install-location ".$installer_tmp." ".$exit_file.".pkg" ;
|
|
|
|
|
+ exec($exec ,$out,$exit);
|
|
|
|
|
+ DEBUG_S(-3,'Robiebie pkg ',array($exec,$out,$exit),__FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
|
|
|
- // return 0;
|
|
|
|
|
|
|
|
|
|
|
|
+ echo "<hr><A href='{$installer_url}{$exit_file}.pkg'> instalacja pojedynczego komponentu {$exit_file}.pkg - NIE ŚCIĄGAJ JEJ!!!</a>\n";
|
|
|
|
|
+ //echo "<pre>Instalator skrypt TODO : \n".htmlspecialchars($ins_sh)."</pre>";
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //return 0;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
|
|
|
function INSTALL_SES_PROCESY_A() {
|
|
function INSTALL_SES_PROCESY_A() {
|
|
@@ -3024,7 +3021,7 @@ function INSTALL_SES_PROCESY_A() {
|
|
|
$packages['pl.procesy5.INSTALL_GETCOMMANDS_SE_LAST_UPDATE']['xml_choice']['title']='(U+I)Procesy5 last check scirpts - must run always ';
|
|
$packages['pl.procesy5.INSTALL_GETCOMMANDS_SE_LAST_UPDATE']['xml_choice']['title']='(U+I)Procesy5 last check scirpts - must run always ';
|
|
|
$packages['pl.procesy5.INSTALL_GETCOMMANDS_SE_LAST_UPDATE']['xml_choice']['description']='run update scripts and bash_install_check';
|
|
$packages['pl.procesy5.INSTALL_GETCOMMANDS_SE_LAST_UPDATE']['xml_choice']['description']='run update scripts and bash_install_check';
|
|
|
$packages['pl.procesy5.INSTALL_GETCOMMANDS_SE_LAST_UPDATE']['xml_choice']['start_selected']='true';
|
|
$packages['pl.procesy5.INSTALL_GETCOMMANDS_SE_LAST_UPDATE']['xml_choice']['start_selected']='true';
|
|
|
- $packages['pl.procesy5.INSTALL_GETCOMMANDS_SE_LAST_UPDATE']['encrypt']=true;
|
|
|
|
|
|
|
+// $packages['pl.procesy5.INSTALL_GETCOMMANDS_SE_LAST_UPDATE']['encrypt']=true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|