Skip to content

File::isAccessable #60

@tristanlins

Description

@tristanlins

@see #60 (comment)

The accessability differ between files and directories (in a unix permission environment).

A file is accessable if it is readable.
A directory is accessable if it is executeable and readable (for content listing).

How about add a convenience method File::isAccessable:

class File::isAccessable {
    public function isAccessable() {
        if ($this->isFile()) {
            return $this->isReadable();
        }
        else if ($this->isDirectory()) {
            return $this->isExecuteable() && $this->isReadable();
        }
    }
}

According to #49 this may be extracted to the permission interface, to allow the permission manager check the accessablility.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions