Files
oberstufe-alt/typo3conf/ext/vhs/Classes/Utility/ResourceUtility.php
2018-04-02 08:07:38 +02:00

46 lines
1001 B
PHP

<?php
namespace FluidTYPO3\Vhs\Utility;
/*
* This file is part of the FluidTYPO3/Vhs project under GPLv2 or later.
*
* For the full copyright and license information, please read the
* LICENSE.md file that was distributed with this source code.
*/
use TYPO3\CMS\Core\Resource\File;
/**
* ViewHelper Utility
*
* Contains helper methods used in resources ViewHelpers
*
* @author Danilo Bürger <danilo.buerger@hmspl.de>, Heimspiel GmbH
* @package Vhs
* @subpackage Utility
*/
class ResourceUtility {
/**
* Fixes a bug in TYPO3 6.2.0 that the properties metadata is not overlayed on localization.
*
* @param File $file
* @return array
*/
public static function getFileArray(File $file) {
$properties = $file->getProperties();
$stat = $file->getStorage()->getFileInfo($file);
$array = $file->toArray();
foreach ($properties as $key => $value) {
$array[$key] = $value;
}
foreach ($stat as $key => $value) {
$array[$key] = $value;
}
return $array;
}
}