/home
/deploy
/EHungry-2-joel
/Web
/classes
/Cache.class.php
}
public static function SetObject($key, $var, $expire = 86400) {
return static::Set($key, serialize($var), $expire);
}
public static function SetArray($key, $var, $expire = 86400) {
return static::Set($key, serialize($var), $expire);
}
public static function SetBoolean($key, $var, $expire = 86400) {
return static::Set($key, serialize($var), $expire);
}
public static function Set($key, $var, $expire = 86400) {
App::debugbarLog('debug', "Cache set: $key");
if ($i = static::getInstance()) {
$var = static::beforeSet($var);
return $expire > 0?
$i->setEx($key, $expire, $var) :
$i->set($key, $var);
}
return null;
}
public static function Exists(...$key):?bool {
if ($i = static::getInstance()) {
return $i->exists($key);
}
return null;
}
public static function Expire($key, $ttl) {
if ($i = static::getInstance()) {
return $i->expire($key, $ttl);
}
return false;
}
/**
Arguments
"MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error."
/home
/deploy
/EHungry-2-joel
/Web
/classes
/Cache.class.php
}
public static function SetObject($key, $var, $expire = 86400) {
return static::Set($key, serialize($var), $expire);
}
public static function SetArray($key, $var, $expire = 86400) {
return static::Set($key, serialize($var), $expire);
}
public static function SetBoolean($key, $var, $expire = 86400) {
return static::Set($key, serialize($var), $expire);
}
public static function Set($key, $var, $expire = 86400) {
App::debugbarLog('debug', "Cache set: $key");
if ($i = static::getInstance()) {
$var = static::beforeSet($var);
return $expire > 0?
$i->setEx($key, $expire, $var) :
$i->set($key, $var);
}
return null;
}
public static function Exists(...$key):?bool {
if ($i = static::getInstance()) {
return $i->exists($key);
}
return null;
}
public static function Expire($key, $ttl) {
if ($i = static::getInstance()) {
return $i->expire($key, $ttl);
}
return false;
}
/**
Arguments
"rmenus_16706_0"
86400
"a:0:{}"
/home
/deploy
/EHungry-2-joel
/Web
/classes
/Cache.class.php
if (!@static::$redisObj->connect(static::$host, (int)static::$port)) {
static::$redisObj = false;
Splunk::log(Splunk::LOG_REDIS_CONN, ['error' => 'Error connecting']);
} else {
static::$redisObj->select(static::$db);
}
} catch (RedisException $e) {
static::$redisObj = false;
Splunk::log(Splunk::LOG_REDIS_CONN, ['error' => 'Error connecting: '.$e->getMessage()]);
}
}
return static::$redisObj;
}
public static function SetObject($key, $var, $expire = 86400) {
return static::Set($key, serialize($var), $expire);
}
public static function SetArray($key, $var, $expire = 86400) {
return static::Set($key, serialize($var), $expire);
}
public static function SetBoolean($key, $var, $expire = 86400) {
return static::Set($key, serialize($var), $expire);
}
public static function Set($key, $var, $expire = 86400) {
App::debugbarLog('debug', "Cache set: $key");
if ($i = static::getInstance()) {
$var = static::beforeSet($var);
return $expire > 0?
$i->setEx($key, $expire, $var) :
$i->set($key, $var);
}
return null;
}
public static function Exists(...$key):?bool {
if ($i = static::getInstance()) {
return $i->exists($key);
Arguments
"rmenus_16706_0"
"a:0:{}"
86400
/home
/deploy
/EHungry-2-joel
/Web
/classes
/Restaurant.class.php
*/
public function getAllMenus($withHidden = false) {
$cacheKey = 'rmenus_'.$this->getId().'_'.($withHidden? '1' : '0');
$co = Cache::GetArray($cacheKey);
if (!$co) {
$db_conn = DB::conn();
$co = [];
$sql = "SELECT menu_id FROM ".MenuRestaurant::getTableName()." WHERE restaurant_id = ?";
$db_conn->bindParameter($sql, 1, $this->getId(), "integer");
$result = $db_conn->query($sql);
if ($result && $result->rowCount() > 0) {
while ($row = $result->fetch()) {
$m = new Menu($row["menu_id"]);
if ($withHidden || !$m->getIsHidden()) {
$co[] = $m;
}
}
}
usort($co, ["Restaurant", "sortMenus"]);
Cache::SetArray($cacheKey, $co);
}
if (!empty($_REQUEST['hidden_menu']) && is_object($_REQUEST['hidden_menu'])) {
$found = false;
foreach ($co as $m) {
if ($m->id == $_REQUEST['hidden_menu']->id) {
$found = true;
break;
}
}
if (!$found) {
$co[] = $_REQUEST['hidden_menu'];
usort($co, ["Restaurant", "sortMenus"]);
}
}
return $co;
}
/**
* Gets menus that are currently active (does not check day-of-the-week or time of day availability)
* @return Menu[]
Arguments
/home
/deploy
/EHungry-2-joel
/Web
/classes
/Restaurant.class.php
foreach ($co as $m) {
if ($m->id == $_REQUEST['hidden_menu']->id) {
$found = true;
break;
}
}
if (!$found) {
$co[] = $_REQUEST['hidden_menu'];
usort($co, ["Restaurant", "sortMenus"]);
}
}
return $co;
}
/**
* Gets menus that are currently active (does not check day-of-the-week or time of day availability)
* @return Menu[]
*/
public function getActiveMenus($withHidden = false): array {
return array_filter($this->getAllMenus($withHidden), function ($menu) {
return $this->isMenuActive($menu);
});
}
public function isMenuActive(Menu $menu): bool {
return $menu->isCurrentlyActive($this);
}
public function getDefaultMenu(): ?Menu {
$menus = $this->getAllMenus();
$menu = null;
if ($this->getSelectMenuFromCurrentTime()) {
$menu = $this->getMenuByCurrentTime($menus);
}
// try to return a menu that is active and not hidden
for ($i = 0, $count = count($menus); $i < $count && is_null($menu); $i++) {
$menu = $this->isMenuActive($menus[$i]) ? $menus[$i] : $menu;
}
Arguments
/home
/deploy
/EHungry-2-joel
/Web
/controllers
/sitemap.php
'contact',
'reportbug',
'privacy',
'tos',
'accessibility'
];
foreach ($basePages as $bp) {
$sm->addUrl(formatCustomerLink($bp));
}
foreach ($locs as $restaurant) {
$sm->addUrl(formatCustomerLink('map', ['lid' => $restaurant->getId()]));
if ($restaurant->getHasNoOrdering()) {
if ($restaurant->getPdfMenuFile()) {
$sm->addUrl($restaurant->getUrl('pdfMenuFile'));
}
} else {
$sm->addUrl(formatCustomerOrderLink([$restaurant]));
$menus = $restaurant->getActiveMenus();
if (is_array($menus)) {
foreach ($menus as $menu) {
$sm->addUrl(formatCustomerOrderLink([$restaurant, $menu]));
$categories = $menu->getCategoriesForRestaurant($restaurant->getId(), true);
if (is_array($categories)) {
foreach ($categories as $category) {
$sm->addUrl(formatCustomerOrderLink([$restaurant, $menu, $category]));
$items = $category->getItems($menu->getId(), false, false, false, false, false, false);
if (is_array($items)) {
foreach ($items as $item) {
$sm->addUrl(formatCustomerOrderLink([$restaurant, $menu, $category, $item]));
}
}
}
$sm->addUrl(formatCustomerOrderLink([$restaurant, $menu, -1]));
}
}
}
/home
/deploy
/EHungry-2-joel
/Web
/index.php
App::startTime();
ErrorHandlers::register();
// Global.php is the core setup file for the application
App::debugbarTime('Global.php');
require(dirname(__DIR__) . '/PHP/Global.php');
App::debugbarTime('Global.php');
/** @var string $controller The main controller - defined at /PHP/Global.php */
App::debugbarTime('Sentry - controller');
ErrorHandlers::sentryInit($controller); //doesn't always do much - not every controller has a Sentry project
App::debugbarTime('Sentry - controller');
App::debugbarTime("controller: $controller");
apache_note('AppController', $controller);
if (file_exists(CORE_PATH."lib/helpers/$controller.php")) {
require CORE_PATH."lib/helpers/$controller.php";
}
require CORE_PATH."controllers/$controller.php";
App::debugbarTime("controller: $controller");
Arguments
"/home/deploy/EHungry-2-joel/Web/controllers/sitemap.php"