mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-14 15:38:40 +00:00
Implemented more ftp draft functions
This commit is contained in:
parent
cda77b6a16
commit
ae1a364378
|
|
@ -19,6 +19,7 @@ use phpOMS\System\File\ContainerInterface;
|
||||||
use phpOMS\System\File\DirectoryInterface;
|
use phpOMS\System\File\DirectoryInterface;
|
||||||
use phpOMS\System\File\PathException;
|
use phpOMS\System\File\PathException;
|
||||||
use phpOMS\Utils\StringUtils;
|
use phpOMS\Utils\StringUtils;
|
||||||
|
use phpOMS\System\File\Local\Directory as DirectoryLocal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filesystem class.
|
* Filesystem class.
|
||||||
|
|
@ -35,4 +36,124 @@ use phpOMS\Utils\StringUtils;
|
||||||
*/
|
*/
|
||||||
class Directory extends FileAbstract implements DirectoryInterface
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -289,10 +289,6 @@ class Directory extends FileAbstract implements DirectoryInterface
|
||||||
public static function create(string $path, string $permission = '0644', bool $recursive = false) : bool
|
public static function create(string $path, string $permission = '0644', bool $recursive = false) : bool
|
||||||
{
|
{
|
||||||
if (!file_exists($path)) {
|
if (!file_exists($path)) {
|
||||||
if(!is_writable($path)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
mkdir($path, $permission, $recursive);
|
mkdir($path, $permission, $recursive);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -397,8 +393,7 @@ class Directory extends FileAbstract implements DirectoryInterface
|
||||||
*/
|
*/
|
||||||
public static function name(string $path) : string
|
public static function name(string $path) : string
|
||||||
{
|
{
|
||||||
// todo: name doesn' t make sense
|
return basename($path);
|
||||||
// TODO: Implement name() method.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -406,7 +401,7 @@ class Directory extends FileAbstract implements DirectoryInterface
|
||||||
*/
|
*/
|
||||||
public static function basename(string $path) : string
|
public static function basename(string $path) : string
|
||||||
{
|
{
|
||||||
// TODO: Implement basename() method.
|
return basename($path);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user