diff --git a/System/File/Ftp/Directory.php b/System/File/Ftp/Directory.php index 7594f2b96..aed8caf73 100644 --- a/System/File/Ftp/Directory.php +++ b/System/File/Ftp/Directory.php @@ -19,6 +19,7 @@ use phpOMS\System\File\ContainerInterface; use phpOMS\System\File\DirectoryInterface; use phpOMS\System\File\PathException; use phpOMS\Utils\StringUtils; +use phpOMS\System\File\Local\Directory as DirectoryLocal; /** * Filesystem class. @@ -35,4 +36,124 @@ use phpOMS\Utils\StringUtils; */ class Directory extends FileAbstract implements DirectoryInterface { + /** + * {@inheritdoc} + */ + public static function size(string $dir, bool $recursive = true) : int + { + + } + + /** + * {@inheritdoc} + */ + public static function count(string $path, bool $recursive = true, array $ignore = ['.', '..', 'cgi-bin', + '.DS_Store']) : int + { + + } + + /** + * {@inheritdoc} + */ + public static function delete(string $path) : bool + { + + } + + /** + * {@inheritdoc} + */ + public static function parent(string $path) : string + { + + } + + /** + * {@inheritdoc} + * todo: move to fileAbastract since it should be the same for file and directory? + */ + public static function created(string $path) : \DateTime + { + + } + + /** + * {@inheritdoc} + */ + public static function changed(string $path) : \DateTime + { + // TODO: Implement changed() method. + } + + /** + * {@inheritdoc} + */ + public static function owner(string $path) : int + { + // TODO: Implement owner() method. + } + + /** + * {@inheritdoc} + */ + public static function permission(string $path) : string + { + // TODO: Implement permission() method. + } + + /** + * {@inheritdoc} + */ + public static function copy(string $from, string $to, bool $overwrite = false) : bool + { + // TODO: Implement copy() method. + } + + /** + * {@inheritdoc} + */ + public static function move(string $from, string $to, bool $overwrite = false) : bool + { + // TODO: Implement move() method. + } + + /** + * {@inheritdoc} + */ + public static function exists(string $path) : bool + { + } + + /** + * {@inheritdoc} + */ + public static function sanitize(string $path, string $replace = '') : string + { + return DirectoryLocal::sanitize($path, $replace); + } + + /** + * {@inheritdoc} + */ + public static function create(string $path, string $permission = '0644', bool $recursive = false) : bool + { + + } + + /** + * {@inheritdoc} + */ + public static function name(string $path) : string + { + return DirectoryLocal::name($path); + } + + /** + * {@inheritdoc} + */ + public static function basename(string $path) : string + { + return DirectoryLocal::basename($path); + } } \ No newline at end of file diff --git a/System/File/Local/Directory.php b/System/File/Local/Directory.php index e371d25e0..77e18e301 100644 --- a/System/File/Local/Directory.php +++ b/System/File/Local/Directory.php @@ -289,10 +289,6 @@ class Directory extends FileAbstract implements DirectoryInterface public static function create(string $path, string $permission = '0644', bool $recursive = false) : bool { if (!file_exists($path)) { - if(!is_writable($path)) { - return false; - } - mkdir($path, $permission, $recursive); return true; @@ -397,8 +393,7 @@ class Directory extends FileAbstract implements DirectoryInterface */ public static function name(string $path) : string { - // todo: name doesn' t make sense - // TODO: Implement name() method. + return basename($path); } /** @@ -406,7 +401,7 @@ class Directory extends FileAbstract implements DirectoryInterface */ public static function basename(string $path) : string { - // TODO: Implement basename() method. + return basename($path); } /**