mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 09:48:40 +00:00
More static test fixes
This commit is contained in:
parent
0069bdac9a
commit
2fdc68e7e6
|
|
@ -185,9 +185,15 @@ abstract class FileAbstract implements ContainerInterface
|
|||
*/
|
||||
public function index() : void
|
||||
{
|
||||
$this->createdAt->setTimestamp(filemtime($this->path));
|
||||
$this->changedAt->setTimestamp(filectime($this->path));
|
||||
$this->owner = fileowner($this->path);
|
||||
$this->permission = (int) substr(sprintf('%o', fileperms($this->path)), -4);
|
||||
$mtime = \filemtime($this->path);
|
||||
$ctime = \filectime($this->path);
|
||||
|
||||
$this->createdAt->setTimestamp($mtime === false ? 0 : $mtime);
|
||||
$this->changedAt->setTimestamp($ctime === false ? 0 : $ctime);
|
||||
|
||||
$owner = \fileowner($this->path);
|
||||
|
||||
$this->owner = $owner === false ? 0 : $owner;
|
||||
$this->permission = (int) \substr(\sprintf('%o', \fileperms($this->path)), -4);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,13 +54,7 @@ class LocalStorage extends StorageAbstract
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the internal class type (directory or file) based on path.
|
||||
*
|
||||
* @param string $path Path to the directory or file
|
||||
*
|
||||
* @return string Class namespace
|
||||
*
|
||||
* @since 1.0.0
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected static function getClassType(string $path) : string
|
||||
{
|
||||
|
|
|
|||
|
|
@ -43,6 +43,17 @@ abstract class StorageAbstract
|
|||
*/
|
||||
abstract public static function getInstance() : StorageAbstract;
|
||||
|
||||
/**
|
||||
* Get the internal class type (directory or file) based on path.
|
||||
*
|
||||
* @param string $path Path to the directory or file
|
||||
*
|
||||
* @return string Class namespace
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
abstract protected static function getClassType(string $path) : string;
|
||||
|
||||
/**
|
||||
* Get storage type.
|
||||
*
|
||||
|
|
@ -265,7 +276,7 @@ abstract class StorageAbstract
|
|||
* @param bool $recursive Consider subdirectories
|
||||
* @param array $ignore Files/paths to ignore (no regex)
|
||||
*
|
||||
* @return string
|
||||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user