[ Index ]

PHP Cross Reference of YOURLS




/includes/Database/ -> Options.php (summary)

YOURLS Options

File Size: 254 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Options:: (6 methods):

Class: Options  - X-Ref

__construct(YDB $ydb)   X-Ref
Hold a copy of the all mighty $ydb global

get_all_options()   X-Ref
Read all options from DB at once, return bool

since: 1.7.3
return: bool    True on success, false on failure (eg table missing or empty)

get($name, $default)   X-Ref
Get option value from DB (or from cache if available). Return value or $default if not found

since: 1.7.3
return: mixed            Value set for the option
param: string $name     Option name
param: string $default  Value to return if option doesn't exist

update($name, $newvalue)   X-Ref
Update (add if doesn't exist) an option to DB

since: 1.7.3
return: bool              False if value was not updated, true otherwise.
param: string $name      Option name. Expected to not be SQL-escaped.
param: mixed  $newvalue  Option value.

add($name, $value)   X-Ref
Add an option to the DB

since: 1.7.3
return: bool           False if option was not added (eg already exists), true otherwise.
param: string $name   Name of option to add. Expected to not be SQL-escaped.
param: mixed  $value  Option value. Must be serializable if non-scalar. Expected to not be SQL-escaped.

delete($name)   X-Ref
Delete option from DB

since: 1.7.3
return: bool          False if option was not deleted (eg not found), true otherwise.
param: string $name  Option name to delete. Expected to not be SQL-escaped.

Generated: Wed Sep 28 05:10:02 2022 Cross-referenced by PHPXref 0.7.1