Files
Chamilo/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/SafeLocal.php
2025-04-10 12:24:57 +02:00

29 lines
520 B
PHP

<?php
namespace Gaufrette\Adapter;
/**
* Safe local adapter that encodes key to avoid the use of the directories
* structure.
*
* @author Antoine Hérault <antoine.herault@gmail.com>
*/
class SafeLocal extends Local
{
/**
* {@inheritdoc}
*/
public function computeKey($path)
{
return base64_decode(parent::computeKey($path));
}
/**
* {@inheritdoc}
*/
protected function computePath($key)
{
return parent::computePath(base64_encode($key));
}
}