Commit f97bc74a authored by Romain Therville's avatar Romain Therville 🐭
Browse files

Merge branch 'dev' into 'master'

Merge branch Dev with master

See merge request !110
parents 430ce29c 1184f821
...@@ -713,14 +713,6 @@ class Analysis (Component): ...@@ -713,14 +713,6 @@ class Analysis (Component):
result = t3mysql.get_analysis_creation_date(str(self.id)) result = t3mysql.get_analysis_creation_date(str(self.id))
return next(iter(result)) return next(iter(result))
def get_directory(self):
"""
Returns an analysis's directory
"""
if self.id != None :
t3mysql = t3MySQLdb()
return t3mysql.select_analysis_directory(str(self.id))
def change_space (self, space_id ): def change_space (self, space_id ):
import os import os
from ng6.project import Project from ng6.project import Project
...@@ -760,7 +752,14 @@ class Analysis (Component): ...@@ -760,7 +752,14 @@ class Analysis (Component):
return [retcode, str_cmd] return [retcode, str_cmd]
def get_web_filepath(self, file_name, base_filepath='fileadmin' ): def get_web_filepath(self, file_name, base_filepath='fileadmin' ):
return base_filepath + os.path.join(self.directory, file_name) """
returns the full web filepath from a given filename
@param file_name : the path to the file to link
@param base_filepath : the first directory in the path (depends on the server's directory structure)
@return : the full web filepath
"""
return base_filepath + os.path.join(self.get_directory(), file_name)
\ No newline at end of file
...@@ -160,7 +160,8 @@ class tx_nG6_utils { ...@@ -160,7 +160,8 @@ class tx_nG6_utils {
return 0; return 0;
} }
$stream = ssh2_exec($connection, 'find '.$directory.' -maxdepth 1 -not -name "*.html" -not -name "*.png" -type f -exec rm -f {} \;'); #Exclusion of the log files from the purge process
$stream = ssh2_exec($connection, 'find '.$directory.' -maxdepth 1 -not -name "*.html" -not -name "*.png" -not -name "*.log" -not -name "*.log.gz" -not -name "*.pdf" -not -name "md5sum.txt" -not -name "*GXB02039*" -not -name "*PCT0078*" -type f -exec rm -f {} \;');
$errorStream = ssh2_fetch_stream($stream, SSH2_STREAM_STDERR); $errorStream = ssh2_fetch_stream($stream, SSH2_STREAM_STDERR);
// Enable blocking for both streams // Enable blocking for both streams
stream_set_blocking($errorStream, true); stream_set_blocking($errorStream, true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment