1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 05:32:39 +01:00
invoiceninja/app/Utils/TempFile.php
2021-01-12 10:21:17 +11:00

24 lines
515 B
PHP

<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
namespace App\Utils;
class TempFile
{
public static function path($url) :string
{
$temp_path = @tempnam(sys_get_temp_dir() . '/' . sha1(time()), basename($url));
copy($url, $temp_path);
return $temp_path;
}
}