| @@ -116,18 +116,23 @@ | ||
| 116 | 116 | |
| 117 | 117 | /** |
| 118 | 118 | * Creates a folder path recursively. |
| 119 | 119 | * |
| 120 | - * @param string $path Path | |
| 120 | + * @param string $path Path Full path to directory to create | |
| 121 | + * @param bool $recursive Whether to create directory recursively or not | |
| 121 | 122 | * |
| 122 | 123 | * @return bool |
| 123 | 124 | */ |
| 124 | - public function mkdir( $path ) | |
| 125 | + public function mkdir( $path, $recursive = false ) | |
| 125 | 126 | { |
| 126 | 127 | if ( ! $this->validate() ){ |
| 127 | 128 | return false; |
| 128 | 129 | } |
| 129 | 130 | |
| 131 | + if( $recursive ){ | |
| 132 | + return wp_mkdir_p( $path ); | |
| 133 | + } | |
| 134 | + | |
| 130 | 135 | return $this->wpFilesystem->mkdir( $path ); |
| 131 | 136 | } |
| 132 | 137 | |
| 133 | 138 | /** |
| @@ -211,6 +216,26 @@ | ||
| 211 | 216 | return false; |
| 212 | 217 | } |
| 213 | 218 | |
| 214 | 219 | return $this->wpFilesystem->move( $source, $destination, $overwrite ); |
| 220 | + } | |
| 221 | + | |
| 222 | + /** | |
| 223 | + * Gets the file modification time. | |
| 224 | + * | |
| 225 | + * @param string $file Path to file. | |
| 226 | + * | |
| 227 | + * @return mixed | |
| 228 | + */ | |
| 229 | + public function mtime( $file ) { | |
| 230 | + return $this->wpFilesystem->mtime( $file ); | |
| 231 | + } | |
| 232 | + | |
| 233 | + /** | |
| 234 | + * Retrieves FileSystem instance. | |
| 235 | + * | |
| 236 | + * @return mixed | |
| 237 | + */ | |
| 238 | + public function proxy(){ | |
| 239 | + return $this->wpFilesystem; | |
| 215 | 240 | } |
| 216 | 241 | } |