Allow to specify apps that somethign is a dir
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
c743af30d6
commit
42a51146d1
9 changed files with 24 additions and 10 deletions
|
@ -44,8 +44,9 @@ abstract class AbstractStringCheck implements ICheck {
|
|||
/**
|
||||
* @param IStorage $storage
|
||||
* @param string $path
|
||||
* @param bool $isDir
|
||||
*/
|
||||
public function setFileInfo(IStorage $storage, $path) {
|
||||
public function setFileInfo(IStorage $storage, $path, $isDir = false) {
|
||||
// Nothing changes here with a different path
|
||||
}
|
||||
|
||||
|
|
|
@ -58,13 +58,19 @@ class FileMimeType extends AbstractStringCheck {
|
|||
/**
|
||||
* @param IStorage $storage
|
||||
* @param string $path
|
||||
* @param bool $isDir
|
||||
*/
|
||||
public function setFileInfo(IStorage $storage, $path) {
|
||||
public function setFileInfo(IStorage $storage, $path, $isDir = false) {
|
||||
$this->storage = $storage;
|
||||
$this->path = $path;
|
||||
if (!isset($this->mimeType[$this->storage->getId()][$this->path])
|
||||
|| $this->mimeType[$this->storage->getId()][$this->path] === '') {
|
||||
$this->mimeType[$this->storage->getId()][$this->path] = null;
|
||||
|
||||
if ($isDir) {
|
||||
$this->mimeType[$this->storage->getId()][$this->path] = 'httpd/unix-directory';
|
||||
} else {
|
||||
$this->mimeType[$this->storage->getId()][$this->path] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -49,8 +49,9 @@ class FileName extends AbstractStringCheck {
|
|||
/**
|
||||
* @param IStorage $storage
|
||||
* @param string $path
|
||||
* @param bool $isDir
|
||||
*/
|
||||
public function setFileInfo(IStorage $storage, $path) {
|
||||
public function setFileInfo(IStorage $storage, $path, $isDir = false) {
|
||||
$this->storage = $storage;
|
||||
$this->path = $path;
|
||||
}
|
||||
|
|
|
@ -51,8 +51,9 @@ class FileSize implements ICheck {
|
|||
/**
|
||||
* @param IStorage $storage
|
||||
* @param string $path
|
||||
* @param bool $isDir
|
||||
*/
|
||||
public function setFileInfo(IStorage $storage, $path) {
|
||||
public function setFileInfo(IStorage $storage, $path, $isDir = false) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -68,8 +68,9 @@ class FileSystemTags implements ICheck {
|
|||
/**
|
||||
* @param IStorage $storage
|
||||
* @param string $path
|
||||
* @param bool $isDir
|
||||
*/
|
||||
public function setFileInfo(IStorage $storage, $path) {
|
||||
public function setFileInfo(IStorage $storage, $path, $isDir = false) {
|
||||
$this->storage = $storage;
|
||||
$this->path = $path;
|
||||
}
|
||||
|
|
|
@ -47,8 +47,9 @@ class RequestRemoteAddress implements ICheck {
|
|||
/**
|
||||
* @param IStorage $storage
|
||||
* @param string $path
|
||||
* @param bool $isDir
|
||||
*/
|
||||
public function setFileInfo(IStorage $storage, $path) {
|
||||
public function setFileInfo(IStorage $storage, $path, $isDir = false) {
|
||||
// A different path doesn't change time, so nothing to do here.
|
||||
}
|
||||
|
||||
|
|
|
@ -52,8 +52,9 @@ class RequestTime implements ICheck {
|
|||
/**
|
||||
* @param IStorage $storage
|
||||
* @param string $path
|
||||
* @param bool $isDir
|
||||
*/
|
||||
public function setFileInfo(IStorage $storage, $path) {
|
||||
public function setFileInfo(IStorage $storage, $path, $isDir = false) {
|
||||
// A different path doesn't change time, so nothing to do here.
|
||||
}
|
||||
|
||||
|
|
|
@ -60,8 +60,9 @@ class UserGroupMembership implements ICheck {
|
|||
/**
|
||||
* @param IStorage $storage
|
||||
* @param string $path
|
||||
* @param bool $isDir
|
||||
*/
|
||||
public function setFileInfo(IStorage $storage, $path) {
|
||||
public function setFileInfo(IStorage $storage, $path, $isDir = false) {
|
||||
// A different path doesn't change group memberships, so nothing to do here.
|
||||
}
|
||||
|
||||
|
|
|
@ -36,9 +36,10 @@ interface ICheck {
|
|||
/**
|
||||
* @param IStorage $storage
|
||||
* @param string $path
|
||||
* @param bool $isDir
|
||||
* @since 9.1
|
||||
*/
|
||||
public function setFileInfo(IStorage $storage, $path);
|
||||
public function setFileInfo(IStorage $storage, $path, $isDir = false);
|
||||
|
||||
/**
|
||||
* @param string $operator
|
||||
|
|
Loading…
Reference in a new issue