# wpide/3.5.8/App/Services/Storage/Adapters/DefaultFileSystem.php

WPIDE – File Manager &amp; Code Editor, version 3.5.8. 26 lines.

- Page: https://pluginprobe.com/plugins/wpide/3.5.8/code/App/Services/Storage/Adapters/DefaultFileSystem.php
- Raw: https://pluginprobe.com/plugins/wpide/3.5.8/raw/App/Services/Storage/Adapters/DefaultFileSystem.php
- Modified: 2022-12-10T06:02:06+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wpide/3.5.8/code/App/Services/Storage/Adapters/DefaultFileSystem.php#L10-L20`.

```php
<?php
namespace WPIDE\App\Services\Storage\Adapters;

use League\Flysystem\Adapter\Local;
use League\MimeTypeDetection\ExtensionMimeTypeDetector;
use League\MimeTypeDetection\FinfoMimeTypeDetector;

class DefaultFileSystem extends Local
{
    /**
     * @inheritdoc
     */
    public function getMimetype($path)
    {
        $location = $this->applyPathPrefix($path);
        if(extension_loaded('fileinfo')) {
            $mimeDetector = new FinfoMimeTypeDetector();
        }else{
            $mimeDetector = new ExtensionMimeTypeDetector();
        }
        $mimetype = $mimeDetector->detectMimeTypeFromPath($location);

        return ['path' => $path, 'type' => 'file', 'mimetype' => $mimetype];
    }

}
```
