PluginProbe
WPIDE – File Manager & Code Editor / trunk
WPIDE – File Manager & Code Editor vtrunk
3.5.8 3.5.7 2.0.14 2.0.15 2.0.16 2.0.2 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1 2.2 2.3 2.3.1 2.3.2 2.4.0 2.5 2.6 3.0 3.1 3.2 3.3 3.4 All 54 releases
wpide / App / Helpers / EmptyDir.php

EmptyDir.php in WPIDE – File Manager & Code Editor trunk, at App/Helpers/EmptyDir.php

29 lines 510 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace WPIDE\App\Helpers;
3
4 use WPIDE\App\Services\Storage\LocalFileSystem;
5
6 class EmptyDir
7 {
8
9 public static function create($path) {
10
11 if ( ! is_dir( $path ) ) {
12 wp_mkdir_p( $path );
13 }
14
15 $fs = LocalFileSystem::load($path);
16
17 if(!$fs->fileExists('/.htaccess')){
18
19 $fs->store('/', '.htaccess', 'Deny from all', true);
20 }
21
22 if(!$fs->fileExists('/index.html')){
23
24 $fs->store('/', 'index.html', '', true);
25 }
26 }
27
28 }
29