Commit af223984 authored by Guy Thouret's avatar Guy Thouret

(chore) Move File from Core to Helpers namespace - #1120

1 merge request!397WIP: Memory efficient method of getting Mime Types
Pipeline #95622422 passed with stages
in 6 minutes and 56 seconds
......@@ -10,7 +10,7 @@ namespace Minds\Controllers\fs\v1;
use Minds\Core;
use Minds\Entities;
use Minds\Interfaces;
use Minds\Api\Factory;
use Minds\Helpers\File;
class avatars implements Interfaces\FS
{
......@@ -60,7 +60,7 @@ class avatars implements Interfaces\FS
}
if (!empty($contents)) {
$mimetype = Core\File::getMime($contents);
$mimetype = File::getMime($contents);
} else {
$mimetype = 'image/jpeg';
}
......
......@@ -10,7 +10,7 @@ namespace Minds\Controllers\fs\v1;
use Minds\Core;
use Minds\Entities;
use Minds\Interfaces;
use Minds\Api\Factory;
use Minds\Helpers\File;
class banners implements Interfaces\FS
{
......@@ -102,7 +102,7 @@ class banners implements Interfaces\FS
}
}
$mimetype = Core\File::getMime($content);
$mimetype = File::getMime($content);
header('Content-Type: '.$mimetype);
header('Expires: ' . date('r', time() + 864000));
......
......@@ -10,7 +10,7 @@ namespace Minds\Controllers\fs\v1;
use Minds\Core;
use Minds\Entities;
use Minds\Interfaces;
use Minds\Api\Factory;
use Minds\Helpers\File;
class paywall implements Interfaces\FS
{
......@@ -31,7 +31,7 @@ class paywall implements Interfaces\FS
$contents = file_get_contents(Core\Di\Di::_()->get('Config')->get('path') . 'engine/Assets/photos/andromeda-galaxy.jpg');
}
$mimetype = Core\File::getMime($contents);
$mimetype = File::getMime($contents);
header('Content-Type: '.$mimetype);
header('Expires: ' . date('r', time() + 864000));
header("Pragma: public");
......
......@@ -6,9 +6,9 @@ namespace Minds\Controllers\fs\v1;
use Minds\Core;
use Minds\Core\Di\Di;
use Minds\Entities;
use Minds\Interfaces;
use Minds\Core\Features\Manager as FeaturesManager;
use Minds\Helpers\File;
class thumbnail extends Core\page implements Interfaces\page
{
......@@ -47,7 +47,7 @@ class thumbnail extends Core\page implements Interfaces\page
}
try {
$contentType = Core\File::getMime($contents);
$contentType = File::getMime($contents);
} catch (\Exception $e) {
error_log($e);
$contentType = 'image/jpeg';
......
......@@ -9,7 +9,7 @@
namespace Minds\Core\Media\Proxy;
use Minds\Core\Di\Di;
use Minds\Core\File;
use Minds\Helpers\File;
use Minds\Core\Http\Curl\Client;
use Minds\Traits\MagicAttributes;
......
......@@ -5,7 +5,7 @@ namespace Minds\Core\Storage\Services;
use Aws\S3\S3Client;
use Minds\Core\Config;
use Minds\Core\Di\Di;
use Minds\Core\File;
use Minds\Helpers\File;
class S3 implements ServiceInterface
{
......
<?php
namespace Minds\Core;
namespace Minds\Helpers;
class File
{
......
Please register or to comment