Commit d5160b97 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

do not depend on get_run_size and so on to upgrade ... these functions will change

parent 72a75a21
......@@ -145,7 +145,7 @@ class tx_nG6_upgrade {
function set_storage_size($data_storage) {
// update run storage size
$queryParts = array(
'SELECT' => 'tx_nG6_run.uid as uid',
'SELECT' => 'tx_nG6_run.uid as uid, tx_nG6_run.directory as directory',
'FROM' => 'tx_nG6_run ',
'WHERE' => "",
'GROUPBY' => '',
......@@ -155,13 +155,13 @@ class tx_nG6_upgrade {
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$current_size = 0;
while($res_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$current_size = tx_nG6_db::get_run_size($res_row['uid'], $data_storage, false);
$current_size = tx_nG6_upgrade::get_directory_size($data_storage.$res_row['directory']);
$GLOBALS['TYPO3_DB']-> exec_UPDATEquery('tx_nG6_run', 'uid='.$res_row['uid'], array('storage_size' => strval($current_size)));
}
// update analysis storage size
$queryParts = array(
'SELECT' => 'tx_nG6_analyze.uid as uid',
'SELECT' => 'tx_nG6_analyze.uid as uid, tx_nG6_analyze.directory as directory',
'FROM' => 'tx_nG6_analyze ',
'WHERE' => "",
'GROUPBY' => '',
......@@ -171,12 +171,22 @@ class tx_nG6_upgrade {
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$current_size = 0;
while($res_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$current_size = tx_nG6_db::get_analysis_size($res_row['uid'], $data_storage);
$current_size = tx_nG6_upgrade::get_directory_size($data_storage.$res_row['directory']);
$GLOBALS['TYPO3_DB']-> exec_UPDATEquery('tx_nG6_analyze', 'uid='.$res_row['uid'], array('storage_size' => strval($current_size)));
}
}
function get_directory_size($data_folder) {
$full_size = 0;
foreach(scandir($data_folder) as $file) {
if (is_file($data_folder."/".$file)) {
$full_size += filesize($data_folder."/".$file);
}
}
return $full_size;
}
/*
* version 1.2
*------------------------------------------------------------*/
......
Supports Markdown
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