Remove old code that was here for old PHP version compatibility

SVN:trunk[5995]
This commit is contained in:
Pierre Goiffon
2018-08-03 07:39:50 +00:00
parent 775a5122c9
commit 0adadeb280
2 changed files with 7 additions and 24 deletions

View File

@@ -6383,12 +6383,14 @@ abstract class MetaModel
}
catch(Exception $e)
{
// We need to pop the pushed archived mode before the exception is thrown, otherwise the application stays in ArchiveMode true which has caused hazardious behavior!
// Note: When switching to PHP 5.6, we can use a finally block instead of duplicating this line.
utils::PopArchiveMode();
// In the finally block we will pop the pushed archived mode
// otherwise the application stays in ArchiveMode true which has caused hazardious behavior!
throw $e;
}
utils::PopArchiveMode();
finally
{
utils::PopArchiveMode();
}
if (empty($aRow))
{

View File

@@ -549,26 +549,7 @@ class SetupUtils
*/
static function GetTmpDir()
{
// try to figure out what is the temporary directory
// prior to PHP 5.2.1 the function sys_get_temp_dir
// did not exist
if ( !function_exists('sys_get_temp_dir'))
{
if( $temp=getenv('TMP') ) return realpath($temp);
if( $temp=getenv('TEMP') ) return realpath($temp);
if( $temp=getenv('TMPDIR') ) return realpath($temp);
$temp=tempnam(__FILE__,'');
if (file_exists($temp))
{
unlink($temp);
return realpath(dirname($temp));
}
return null;
}
else
{
return realpath(sys_get_temp_dir());
}
return realpath(sys_get_temp_dir());
}
/**