added installation command (#838)
This commit is contained in:
29
src/Utils/File.php
Normal file
29
src/Utils/File.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Utils;
|
||||
|
||||
use Symfony\Component\Filesystem\Exception\FileNotFoundException;
|
||||
|
||||
class File
|
||||
{
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return int
|
||||
* @throws FileNotFoundException
|
||||
*/
|
||||
public function getPermissions(string $filename): int
|
||||
{
|
||||
if (!file_exists($filename)) {
|
||||
throw new FileNotFoundException(sprintf('Unknown file "%s"', $filename));
|
||||
}
|
||||
|
||||
return fileperms($filename);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user