Class Tools (namespace Nette)


Tools library.


Copyright: Copyright (c) 2004, 2010 David Grudl
Located: in /Tools.php (line 21)
Public Method Summary
Tools
Static class - cannot be instantiated.
static bool
catchError (string &$message)
Returns catched error/warning message.
static DateTime
createDateTime (string|int|DateTime $time)
DateTime object factory.
static void
defaultize (mixed &$var, mixed $default)
Initializes variable with $default value.
static array
glob (string $pattern, [int $flags = 0])
Recursive glob(). Finds pathnames matching a pattern.
static bool
iniFlag (string $var)
Gets the boolean value of a configuration option.
static void
tryError ([$level = E_ALL])
Starts catching potential errors/warnings.
Constant Summary
int DAY 86400

line 30

day in seconds
int HOUR 3600

line 27

hour in seconds
int MINUTE 60

line 24

minute in seconds
int MONTH 2629800

line 36

average month in seconds
int WEEK 604800

line 33

week in seconds
int YEAR 31557600

line 39

average year in seconds

Method Details

line 46

__construct

public Tools __construct ()

Static class - cannot be instantiated.

Output
Tools  

line 158

catchError

public static bool catchError (string &$message)

Returns catched error/warning message.

Input
string &$message catched message
Output
bool  

line 58

createDateTime

public static DateTime createDateTime (string|int|DateTime $time)

DateTime object factory.

Input
string|int|DateTime $time
Output
DateTime  

line 96

defaultize

public static void defaultize (mixed &$var, mixed $default)

Initializes variable with $default value.

Input
mixed &$var variable
mixed $default default value
Output
void  

line 109

glob

public static array glob (string $pattern, [int $flags = 0])

Recursive glob(). Finds pathnames matching a pattern.

Input
string $pattern
int $flags
Output
array  

line 81

iniFlag

public static bool iniFlag (string $var)

Gets the boolean value of a configuration option.

Input
string $var configuration option name
Output
bool  

line 144

tryError

public static void tryError ([$level = E_ALL])

Starts catching potential errors/warnings.

Input
$level
Output
void