Maintenance - Mise à jour mensuelle Lundi 1 Juin 2020 entre 7h00 et 9h00

Commit e2661161 authored by Romain Therville's avatar Romain Therville 🐭

2nd fix for nG6_utils.php

2 functions were missing from my version of this file, get_save_dir()
and get_project_data_save_dir().
parent 26b00dfc
......@@ -373,6 +373,44 @@ please have a look at our storage fees (<a href="###URL_PRICE###">###URL_PRICE##
}
return($ret);
}
static function get_project_data_save_dir($project_id){
$space_id = tx_nG6_db::get_project_space_id($project_id);
$space_config = tx_nG6_utils::get_retention_policy_from_space_id($space_id);
$path_to_space_save_dir = '';
foreach($space_config as $line_id => $line_content){
if(strpos($line_content, 'dir_name') === 0){
//We get the value in the "dir_name = " line
$space_save_dir = trim( substr( $line_content, strpos( $line_content, '=')+1 ) );
}
}
$save_dir = tx_nG6_utils::get_save_dir();
$path_to_space_save_dir = $save_dir.'/'.$space_save_dir;
return($path_to_space_save_dir);
}
static function get_save_dir(){
$config_file_content = tx_nG6_utils::get_config_content($space_id);
$pattern_to_find = 'save_directory';
$array_config_content = explode(PHP_EOL, $config_file_content);
$path_to_save_dir='';
foreach($array_config_content as $line_id => $line_content){
//if we found the right section
if( strpos($line_content,$pattern_to_find)===0 && ! $is_pattern_found){
//We copy the line from the first '/'
$path_to_save_dir = substr($line_content, strpos( $line_content, '/')) ;
}
}
return($path_to_save_dir);
}
static function convert_epoch_timestamp_to_nice_date( $epoch_date ){
......
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