function elysia_cron_get in Elysia Cron 6
Same name and namespace in other branches
- 5.2 elysia_cron.module \elysia_cron_get()
- 5 elysia_cron.module \elysia_cron_get()
- 6.2 elysia_cron.module \elysia_cron_get()
- 7.2 elysia_cron.module \elysia_cron_get()
- 7 elysia_cron.module \elysia_cron_get()
15 calls to elysia_cron_get()
File
- ./
elysia_cron.module, line 404
Code
function elysia_cron_get($name, $channel = false, $key, $default, $refresh = false) {
global $elysia_cron_db_cache;
static $elysia_cron_defaults;
if (!isset($elysia_cron_defaults)) {
$elysia_cron_defaults = function_exists('elysia_cron_get_ctools_defaults') ? elysia_cron_get_ctools_defaults() : array();
}
if ($channel) {
$name = ':' . $name;
}
if ($refresh || !isset($elysia_cron_db_cache[$name])) {
if (EC_DRUPAL_VERSION >= 7) {
$elysia_cron_db_cache[$name] = db_query("select * from {elysia_cron} where name = :name", array(
':name' => $name,
))
->fetchAssoc();
}
else {
$elysia_cron_db_cache[$name] = db_fetch_array(db_query("select * from {elysia_cron} where name = '%s'", $name));
}
if (!$elysia_cron_db_cache[$name] && isset($elysia_cron_defaults[$name])) {
$elysia_cron_db_cache[$name] = (array) $elysia_cron_defaults[$name];
}
elseif ($elysia_cron_db_cache[$name] && isset($elysia_cron_defaults[$name])) {
foreach ($elysia_cron_defaults[$name] as $k => $v) {
if (!isset($elysia_cron_db_cache[$name][$k]) || is_null($elysia_cron_db_cache[$name][$k])) {
$elysia_cron_db_cache[$name][$k] = $v;
}
}
}
}
return !$elysia_cron_db_cache[$name] || !isset($elysia_cron_db_cache[$name][$key]) || is_null($elysia_cron_db_cache[$name][$key]) ? $default : $elysia_cron_db_cache[$name][$key];
}