# wpide/3.5.9/App/Helpers/EmptyDir.php

WPIDE – File Manager &amp; Code Editor, version 3.5.9. 29 lines.

- Page: https://pluginprobe.com/plugins/wpide/3.5.9/code/App/Helpers/EmptyDir.php
- Raw: https://pluginprobe.com/plugins/wpide/3.5.9/raw/App/Helpers/EmptyDir.php
- Modified: 2022-07-30T20:33:10+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.9/code/App/Helpers/EmptyDir.php#L10-L20`.

```php
<?php
namespace WPIDE\App\Helpers;

use WPIDE\App\Services\Storage\LocalFileSystem;

class EmptyDir
{

    public static function create($path) {

        if ( ! is_dir( $path ) ) {
            wp_mkdir_p( $path );
        }

        $fs = LocalFileSystem::load($path);

        if(!$fs->fileExists('/.htaccess')){

            $fs->store('/', '.htaccess', 'Deny from all', true);
        }

        if(!$fs->fileExists('/index.html')){

            $fs->store('/', 'index.html', '', true);
        }
    }

}

```
