add shipping rules
This commit is contained in:
@@ -3,13 +3,9 @@
|
||||
namespace App\Repositories\Core;
|
||||
|
||||
use Illuminate\Support\Facades\Storage as Storage2;
|
||||
|
||||
use Symfony\Component\Process\Exception\ProcessFailedException;
|
||||
use Symfony\Component\Process\Process;
|
||||
|
||||
use SoftCreatR\MimeDetector\MimeDetector;
|
||||
use SoftCreatR\MimeDetector\MimeDetectorException;
|
||||
|
||||
class Storage
|
||||
{
|
||||
public static function checkDirOrCreate($dir)
|
||||
@@ -30,18 +26,21 @@ class Storage
|
||||
public static function createDir($dir)
|
||||
{
|
||||
Storage2::makeDirectory($dir);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function deleteDir($dir)
|
||||
{
|
||||
Storage2::deleteDirectory($dir);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function deleteFile($file)
|
||||
{
|
||||
Storage2::delete($file);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -49,8 +48,8 @@ class Storage
|
||||
{
|
||||
$process = new Process(['srm', $file]);
|
||||
$process->run();
|
||||
|
||||
if (!$process->isSuccessful()) {
|
||||
|
||||
if (! $process->isSuccessful()) {
|
||||
throw new ProcessFailedException($process);
|
||||
}
|
||||
}
|
||||
@@ -87,7 +86,8 @@ class Storage
|
||||
|
||||
public static function getFileType($file)
|
||||
{
|
||||
$file = self::getStoragePath() . $file;
|
||||
$file = self::getStoragePath().$file;
|
||||
|
||||
return File::getFileType($file);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user