Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genotoul-bioinfo
ng6
Commits
daaf9194
Commit
daaf9194
authored
Feb 12, 2021
by
Romain Therville
🐭
Browse files
Update to the purge to log additionnal informations in the log file
defined in application.properties. Issue
#192
parent
a2966774
Changes
4
Hide whitespace changes
Inline
Side-by-side
ui/nG6/class.tx_nG6_eid.php
View file @
daaf9194
...
...
@@ -929,6 +929,8 @@ class tx_nG6_eid {
$purge_delay
=
trim
(
\
TYPO3\CMS\Core\Utility\GeneralUtility
::
_GP
(
'purge_delay'
));
$purge_demand_filter_space
=
trim
(
\
TYPO3\CMS\Core\Utility\GeneralUtility
::
_GP
(
'purge_demand_filter_space'
));
$purge_demand_filter_delay_exceeded
=
trim
(
\
TYPO3\CMS\Core\Utility\GeneralUtility
::
_GP
(
'purge_demand_filter_delay_exceeded'
));
print
json_encode
(
tx_nG6_db
::
get_purge_demand_list
(
$purge_delay
,
$purge_demand_filter_space
,
$purge_demand_filter_delay_exceeded
));
}
elseif
(
$type
==
'refresh_purge_list'
)
{
$max_retention_date
=
trim
(
\
TYPO3\CMS\Core\Utility\GeneralUtility
::
_GP
(
'max_retention_date'
));
...
...
@@ -937,8 +939,6 @@ class tx_nG6_eid {
$without_laboratories_id
=
trim
(
\
TYPO3\CMS\Core\Utility\GeneralUtility
::
_GP
(
'without_lab'
));
$with_laboratories_id
=
trim
(
\
TYPO3\CMS\Core\Utility\GeneralUtility
::
_GP
(
'with_lab'
));
$create_users
=
trim
(
\
TYPO3\CMS\Core\Utility\GeneralUtility
::
_GP
(
'create_users'
));
//Change date format
//print ('test');
print
json_encode
(
tx_nG6_db
::
filter_list_retention_data_info
(
$filter_space
,
$max_retention_date
,
$create_users
,
$without_laboratories_id
,
$with_laboratories_id
));
}
elseif
(
$type
==
'delete_purge_data'
)
{
//Delete data link to the list of purge demand
...
...
ui/nG6/lib/class.tx_nG6_db.php
View file @
daaf9194
...
...
@@ -194,6 +194,9 @@ class tx_nG6_db {
$conditions
[]
=
"project_id in ("
.
$project_list_ids
.
")"
;
}
$where
=
join
(
' AND '
,
$conditions
);
$log_file_path
=
tx_nG6_utils
::
get_log_path
();
error_log
(
"IN filter_list_retention_data_info(), where="
.
$where
.
"
\n
"
,
3
,
$log_file_path
);
return
(
tx_nG6_db
::
select_list_retention_data_info
(
$where
));
}
...
...
@@ -214,6 +217,7 @@ class tx_nG6_db {
}
static
function
select_list_retention_data_info
(
$where
)
{
$by_project
=
array
();
$empty_res_structure
=
array
(
'project_name'
=>
""
,
...
...
@@ -333,6 +337,9 @@ class tx_nG6_db {
}
}
$log_file_path
=
tx_nG6_utils
::
get_log_path
();
error_log
(
"IN filter_list_retention_data_info(), return="
.
print_r
(
$by_project
,
TRUE
)
.
"
\n
"
,
3
,
$log_file_path
);
return
(
$by_project
);
}
...
...
ui/nG6/lib/class.tx_nG6_utils.php
View file @
daaf9194
...
...
@@ -440,6 +440,29 @@ $template_mail.='<p>Yours sincerely</p>
return
(
$path_to_save_dir
);
}
static
function
get_log_path
(){
$config_file_content
=
tx_nG6_utils
::
get_config_content
();
$array_config_content
=
explode
(
PHP_EOL
,
$config_file_content
);
$pattern_to_find
=
"log_file = "
;
$log_file_path_found
=
FALSE
;
//We want to return the log file path
foreach
(
$array_config_content
as
$line_id
=>
$line_content
){
//if we found the right line
if
(
strpos
(
$line_content
,
$pattern_to_find
)
===
0
){
$log_file_path_found
=
TRUE
;
}
if
(
$log_file_path_found
){
$log_file_path
=
str_replace
(
$pattern_to_find
,
''
,
$line_content
);
return
(
$log_file_path
);
}
}
return
(
'0'
);
}
static
function
convert_epoch_timestamp_to_nice_date
(
$epoch_date
){
//return(gmdate('D, d M Y', $epoch_date));
return
(
gmdate
(
'l jS \of F Y'
,
$epoch_date
));
...
...
ui/nG6/pi6/class.tx_nG6_pi6.php
View file @
daaf9194
...
...
@@ -169,6 +169,10 @@ class tx_nG6_pi6 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
//Retrieve purgeable information for email
$run_info
=
Array
();
$analyses_info
=
Array
();
$log_file_path
=
tx_nG6_utils
::
get_log_path
();
error_log
(
"IN tx_nG6_pi6.php, 'add_purge_demand'
\n
p = "
.
print_r
(
$p
,
TRUE
),
3
,
$log_file_path
);
$all_purgeable_runs
=
array_merge
(
$p
[
$project_id
][
"state"
][
"stored"
][
"run_ids"
],
$p
[
$project_id
][
"state"
][
"extended"
][
"run_ids"
]);
$all_purgeable_analysis
=
array_merge
(
$p
[
$project_id
][
"state"
][
"stored"
][
"analysis_ids"
],
$p
[
$project_id
][
"state"
][
"extended"
][
"analysis_ids"
]);
$nb_run_purgeable
=
$p
[
$project_id
][
"state"
][
"stored"
][
"nb_run"
]
+
$p
[
$project_id
][
"state"
][
"extended"
][
"nb_run"
];
...
...
@@ -192,8 +196,14 @@ class tx_nG6_pi6 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
http_response_code
(
401
);
return
"Nobody seems to be authenticated."
;
}
$log_file_path
=
tx_nG6_utils
::
get_log_path
();
error_log
(
"IN tx_nG6_pi6.php, 'add_purge_demand'
\n
all_purgeable_runs = "
.
print_r
(
$all_purgeable_runs
,
TRUE
),
3
,
$log_file_path
);
#Add purge demand to get id
$purge_demand_id
=
tx_nG6_db
::
add_purge_demand
(
$GLOBALS
[
'TSFE'
]
->
fe_user
->
user
[
'uid'
],
$project_id
,
$p
[
$project_id
][
"total_purgeable_size"
],
$all_purgeable_runs
,
$all_purgeable_analysis
,
$purge_user_id_to
);
#Build corresponding string array
//TODO RETURN TOTAL SIZE tx_nG6_utils::get_octet_string_representation($p[$project_id]["total_size"]
$total_project_size
=
tx_nG6_db
::
get_project_size
(
$project_id
,
true
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment