__construct()
_init()
add_path()
clear_flash()
flash()
forge()
instance()
list_files()
locate()
paths()
prep_path()
prep_paths()
read_cache()
remove_path()
search()
write_cache()
add_to_cache()
cache()
from_cache()
$cache_dir
$cache_lifetime
$cache_valid
$cached_paths
$flash_paths
$instance
$paths
The Finder class allows for searching through a search path for a given file, as well as loading a given file.
package | Fuel |
---|---|
subpackage | Core |
__construct(array $paths)
array
The paths to initialize with
_init()
add_path(string | array $paths, int $pos) : \Fuel\Core\Finder
Possible positions: (null): Append to the end of the search path (-1): Prepend to the start of the search path (index): The path will get inserted AFTER the given index
fluent | This method is part of a fluent interface and will return the same instance |
---|
string
array
The path to add
int
The position to add the path
\OutOfBoundsException |
---|
clear_flash() : \Fuel\Core\Finder
fluent | This method is part of a fluent interface and will return the same instance |
---|
flash(array $paths) : \Fuel\Core\Finder
fluent | This method is part of a fluent interface and will return the same instance |
---|
array
The paths to add
list_files(string $directory, string $filter) : array
the cascading file system). This is useful for things like finding all the config files in all the search paths.
string
The directory to look in
string
The file filter
array
the array of fileslocate(string $dir, string $file, string $ext, bool $multiple, bool $cache) : mixed
string
Directory to look in
string
File to find
string
File extension
bool
Whether to find multiple files
bool
Whether to cache this path or not
mixed
Path, or paths, or falsepaths() : array
..including flash paths.
array
Search pathsprep_path(string $path) : string
It ensures that the path has a trailing Directory Separator.
string
The path to prepare
string
prep_paths(array $paths) : array
array
The paths to prepare
array
read_cache(string $cache_id) : void
string
Cache id to read
remove_path(string $path) : \Fuel\Core\Finder
fluent | This method is part of a fluent interface and will return the same instance |
---|
string
Path to remove
search(string $dir, string $file, string $ext, bool $multiple, bool $cache) : mixed
string
Directory to look in
string
File to find
string
File extension
bool
Whether to find multiple files
bool
Whether to cache this path or not
mixed
Path, or paths, or falsewrite_cache(string $cache_id) : void
string
Cache id to read
add_to_cache(string $cache_id, $path) : string | bool
string
Cache id to load
string
bool
Path or false if not foundcache(string $name, array $data, int $lifetime) : bool | null
It is used for things like path caching.
This method is from KohanaPHP's Kohana class.
string
the cache name
array
the data to cache (if non given it returns)
int
the number of seconds for the cache too live
bool
null
from_cache(string $cache_id) : string | bool
string
Cache id to load
string
bool
Path or false if not found$cache_dir : string
$cache_lifetime : int
$cache_valid : bool
$cached_paths : array
$flash_paths : array
$paths : array