Documentation

GlobResource
in package
implements IteratorAggregate, SelfCheckingResourceInterface

GlobResource represents a set of resources stored on the filesystem.

Only existence/removal is tracked (not mtimes.)

Tags
author

Nicolas Grekas p@tchwork.com

final
implements

\IteratorAggregate<string, \SplFileInfo>

Interfaces, Classes and Traits

IteratorAggregate
SelfCheckingResourceInterface
Interface for Resources that can check for freshness autonomously, without special support from external services.

Table of Contents

$excludedPrefixes  : mixed
$forExclusion  : mixed
$globBrace  : mixed
$hash  : mixed
$pattern  : mixed
$prefix  : mixed
$recursive  : mixed
__construct()  : mixed
__toString()  : string
getIterator()  : Traversable
getPrefix()  : string
isFresh()  : bool
Returns true if the resource has not been updated since the given timestamp.
computeHash()  : string
expandGlob()  : array<string|int, mixed>

Properties

Methods

__construct()

public __construct(string $prefix, string $pattern, bool $recursive[, bool $forExclusion = false ][, array<string|int, mixed> $excludedPrefixes = [] ]) : mixed
Parameters
$prefix : string

A directory prefix

$pattern : string

A glob pattern

$recursive : bool

Whether directories should be scanned recursively or not

$forExclusion : bool = false
$excludedPrefixes : array<string|int, mixed> = []
Tags
throws
InvalidArgumentException
Return values
mixed

__toString()

public __toString() : string
Return values
string

getIterator()

public getIterator() : Traversable
Return values
Traversable

getPrefix()

public getPrefix() : string
Return values
string

isFresh()

Returns true if the resource has not been updated since the given timestamp.

public isFresh(int $timestamp) : bool
Parameters
$timestamp : int

The last time the resource was loaded

Return values
bool

computeHash()

private computeHash() : string
Return values
string

expandGlob()

private expandGlob(string $pattern) : array<string|int, mixed>
Parameters
$pattern : string
Return values
array<string|int, mixed>

Search results