/home
/deploy
/EHungry-8-simon
/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-8-simon
/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
"hh_2025-04-30 00:00:00_c166942_ALL_1"
86400
"N;"
/home
/deploy
/EHungry-8-simon
/Web
/classes
/Cache.class.php
public static function getInstance() {
if (static::$redisObj === null) {
static::$redisObj = new Redis();
try {
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;
}
Arguments
"hh_2025-04-30 00:00:00_c166942_ALL_1"
"N;"
86400
/home
/deploy
/EHungry-8-simon
/Web
/classes
/HolidayHours.class.php
}
}
} else {
$sql = "SELECT id FROM ".HolidayHours::getTableName()." WHERE for_date = ? AND " .
($cid ? "category_id" : "restaurant_id") . " = ? AND order_type = ? $where ORDER BY id DESC";
$db_conn->bindParameter($sql, 1, $date, "string");
$db_conn->bindParameter($sql, 1, $rid, "integer");
$db_conn->bindParameter($sql, 1, $type, "string");
$result = $db_conn->query($sql);
if ($result && $result->rowCount() > 0) {
if ($row = $result->fetch()) {
$hh = new HolidayHours($row['id']);
Cache::SetObject($cacheKey, $hh);
return $hh;
}
}
}
if ($cacheKey) {
Cache::SetObject($cacheKey, null);
}
return null;
}
public static function getByDateAndRestaurant($date, $rid) {
$db_conn = DB::conn();
$rbs = [];
$sql = "SELECT id FROM ".HolidayHours::getTableName()." WHERE for_date = ? AND restaurant_id = ? ORDER BY id DESC";
$db_conn->bindParameter($sql, 1, $date, "string");
$db_conn->bindParameter($sql, 1, $rid, "integer");
$result = $db_conn->query($sql);
if ($result) {
while ($row = $result->fetch()) {
$rbs[] = new HolidayHours($row['id']);
}
}
return $rbs;
}
public static function storeHours($holidayClosed, $forDate, $restaurantID, $holidayNotifications, $holidayOpenHour, $holidayOpenMinute, $holidayOpenMeridien, $holidayClosedHour, $holidayClosedMinute, $holidayClosedMeridien, $timeErrorMessage, $orderType, $namedHolidayID, $holidayDateRangeID, $categoryID = null, $isYearly = false, $showCategoryWhenClosed = false) {
Arguments
"hh_2025-04-30 00:00:00_c166942_ALL_1"
null
/home
/deploy
/EHungry-8-simon
/Web
/classes
/HolidayHours.class.php
$holidayHours = HolidayHours::getByDateAndCategoryAndType(date('Y-m-d 00:00:00', $time), $category->getId(), $orderType, $isHiddenToCustomers);
if (is_object($holidayHours)) {
return $holidayHours;
}
//check parent category too
if ($category->parent_id) {
$holidayHours = HolidayHours::getByDateAndCategoryAndType(date('Y-m-d 00:00:00', $time), $category->parent_id, $orderType, $isHiddenToCustomers);
if (is_object($holidayHours)) {
return $holidayHours;
}
}
return false;
}
public static function getByDateAndRestaurantAndType($date, $rid, $type = 'PICKUP') {
return HolidayHours::getByDateAndTypeAndRestaurantOrCategory($date, $rid, null, $type);
}
public static function getByDateAndCategoryAndType($date, $cid, $type = null, $isHiddenToCustomers = false) {
return HolidayHours::getByDateAndTypeAndRestaurantOrCategory($date, null, $cid, $type, $isHiddenToCustomers);
}
public static function getByDateAndTypeAndRestaurantOrCategory($date, $rid = null, $cid = null, $type = 'PICKUP', $isHiddenToCustomers = false) {
$db_conn = DB::conn();
$cacheKey = 'hh_'.$date.'_'.($cid > 0 ? ('c'.$cid):('r'.$rid)).'_'.($type?:'ALL') . "_" . ($isHiddenToCustomers ? '1' : '0');
$aObj = Cache::GetObject($cacheKey, true);
if ($aObj || is_null($aObj)) {
return $aObj;
}
$where = '';
if ($cid) {
$rid = $cid;
if ($isHiddenToCustomers) {
$where .= ' AND show_category_when_closed = 0';
}
}
if (!$type) { //if we don't have a type to check for, check if *ALL* types are either open or closed
$sql = "SELECT id, is_closed, COUNT(id) as cnt FROM ".HolidayHours::getTableName()." WHERE for_date = ? AND " .
Arguments
"2025-04-30 00:00:00"
166942
166942
null
true
/home
/deploy
/EHungry-8-simon
/Web
/classes
/HolidayHours.class.php
return self::isCategoryDisabled($restaurant, $category, $time, true);
}
/**
* @param Restaurant $restaurant
* @param Category $category
* @param null $time
* @param bool $isHiddenToCustomers
* @param null $orderType
* @return bool|\HolidayHours|object
*/
public static function isCategoryDisabled($restaurant, $category, $time = null, $isHiddenToCustomers = false, $orderType = null) {
if (!$orderType) {
$cart = Cart::getCurrent();
$orderType = $cart->getBaseOrderType();
}
if (!$time) {
$time = $restaurant->getLocalTime();
}
$holidayHours = HolidayHours::getByDateAndCategoryAndType(date('Y-m-d 00:00:00', $time), $category->getId(), $orderType, $isHiddenToCustomers);
if (is_object($holidayHours)) {
return $holidayHours;
}
//check parent category too
if ($category->parent_id) {
$holidayHours = HolidayHours::getByDateAndCategoryAndType(date('Y-m-d 00:00:00', $time), $category->parent_id, $orderType, $isHiddenToCustomers);
if (is_object($holidayHours)) {
return $holidayHours;
}
}
return false;
}
public static function getByDateAndRestaurantAndType($date, $rid, $type = 'PICKUP') {
return HolidayHours::getByDateAndTypeAndRestaurantOrCategory($date, $rid, null, $type);
}
public static function getByDateAndCategoryAndType($date, $cid, $type = null, $isHiddenToCustomers = false) {
return HolidayHours::getByDateAndTypeAndRestaurantOrCategory($date, null, $cid, $type, $isHiddenToCustomers);
}
Arguments
"2025-04-30 00:00:00"
166942
null
true
/home
/deploy
/EHungry-8-simon
/Web
/classes
/HolidayHours.class.php
$db_conn->bindParameter($sql, 1, $rid, "integer");
}
$result = $db_conn->query($sql);
if ($result && $result->rowCount() > 0) {
while ($row = $result->fetch()) {
$rbs[$row['id']] = new HolidayHours($row["id"]);
}
return $rbs;
}
return null;
}
/**
* @param Restaurant $restaurant
* @param Category $category
* @param $time
* @return bool
*/
public static function isCategoryHidden($restaurant, $category, $time = null) {
return self::isCategoryDisabled($restaurant, $category, $time, true);
}
/**
* @param Restaurant $restaurant
* @param Category $category
* @param null $time
* @param bool $isHiddenToCustomers
* @param null $orderType
* @return bool|\HolidayHours|object
*/
public static function isCategoryDisabled($restaurant, $category, $time = null, $isHiddenToCustomers = false, $orderType = null) {
if (!$orderType) {
$cart = Cart::getCurrent();
$orderType = $cart->getBaseOrderType();
}
if (!$time) {
$time = $restaurant->getLocalTime();
}
$holidayHours = HolidayHours::getByDateAndCategoryAndType(date('Y-m-d 00:00:00', $time), $category->getId(), $orderType, $isHiddenToCustomers);
if (is_object($holidayHours)) {
Arguments
Restaurant {}
Category {}
1745997994
true
/home
/deploy
/EHungry-8-simon
/Web
/classes
/Category.class.php
if ($imageURL !== null) {
Cache::Set('category_image_'.$this->id, $imageURL);
}
return $imageURL;
}
/**
* Returns categories without those are hidden by holiday hours & closed hours
* @param int $rid restaurant id
* @param array $categories
* @return array
*/
public static function removeHiddenCategoriesFromArray($rid, $categories) {
if (is_array($categories)) {
$restaurant = new Restaurant($rid);
$filteredCategories = [];
foreach ($categories as $category) {
$isHidden = HolidayHours::isCategoryHidden($restaurant, $category) || ClosedHours::isCategoryHidden($restaurant, $category);
if (!$isHidden) {
$filteredCategories[] = $category;
}
}
return $filteredCategories;
}
return [];
}
public function getNewUrlTag() {
$originalTag = $urlTag = preg_replace('/[^a-zA-Z0-9_\-]/', '', preg_replace('/\s/', '-', mb_strtolower($this->display_name)));
$count = 1;
$tagObject = Category::getByAccountAndUrlTag($this->account_id, $urlTag);
while (is_object($tagObject) && $tagObject->id != $this->id) {
$urlTag = $originalTag.'-'.$count++;
$tagObject = Category::getByAccountAndUrlTag($this->account_id, $urlTag);
}
return $urlTag;
}
Arguments
Restaurant {}
Category {}
/home
/deploy
/EHungry-8-simon
/Web
/classes
/Menu.class.php
if ($m->getId() == $this->getId()) {
return true;
}
}
return false;
}
/**
* @param int $rid
* @param bool $shown
* @param bool $alphabetical
* @return Category[]|bool|null
*/
public function getCategoriesForRestaurant($rid = -1, $shown = true, $alphabetical = false) {
$cart = Cart::getCurrent();
$cacheKey = 'cfr_'.$rid.'_'.$this->getId().'_'.($shown?'1':'0').'_'.($alphabetical?'1':'0') . '_' . ($cart->getBaseOrderType() == 'DELIVERY'?'delivery':'pickup');
$aObj = Cache::GetArray($cacheKey, true);
if ($aObj || is_null($aObj)) {
if (is_array($aObj)) {
return Category::removeHiddenCategoriesFromArray($rid, $aObj);
}
return $aObj;
}
$db_conn = DB::conn();
$arr = array();
$sql = "SELECT DISTINCT b.* FROM ".RestaurantCategory::getTableName()." a INNER JOIN ".Category::getTableName()." b ON a.menu_category_id = b.id
LEFT JOIN ".Category::getTableName()." p ON p.id = b.parent_id
WHERE b.menu_id = ? AND a.restaurant_id = ? AND b.is_shown = 1 AND (p.is_shown = 1 OR b.is_parent = 1) ORDER BY ";
if ($alphabetical) {
$sql .= "b.display_name ASC";
} else {
$sql .= "priority";
}
$db_conn->bindParameter($sql, 1, $this->getId(), "integer");
$db_conn->bindParameter($sql, 1, $rid, "integer");
$result = $db_conn->query($sql);
if ($result && $result->rowCount() > 0) {
while ($row = $result->fetch()) {
$c = new Category();
Arguments
10417
array:27 [
0 => Category {}
1 => Category {}
2 => Category {}
3 => Category {}
4 => Category {}
5 => Category {}
6 => Category {}
7 => Category {}
8 => Category {}
9 => Category {}
10 => Category {}
11 => Category {}
12 => Category {}
13 => Category {}
14 => Category {}
15 => Category {}
16 => Category {}
17 => Category {}
18 => Category {}
19 => Category {}
20 => Category {}
21 => Category {}
22 => Category {}
23 => Category {}
24 => Category {}
25 => Category {}
26 => Category {}
]
/home
/deploy
/EHungry-8-simon
/Web
/controllers
/customer.php
if (is_array($bagTypes) && count($bagTypes)) {
$defaultBagType = RestaurantBagType::getDefaultBagType($bagTypes);
$selectedBagType = $defaultBagType?: $bagTypes[0];
$numberOfBags = $restaurant->bags_formula_enabled ? ceil($restaurant->bags_formula_count_per_price * $cart->getSubTotal() / $restaurant->bags_formula_price) : 1;
$cart->setBagsType($selectedBagType->id);
$cart->setBagsTypeName($selectedBagType->display_name);
$cart->bags_price = $selectedBagType->price;
$cart->bags_fee_total = $numberOfBags*$selectedBagType->price;
}
} elseif ($_SESSION['saved_state_bag~type']) {
$cart->setBagsType($_SESSION['saved_state_bag~type']);
}
}
} else {
unset($_SESSION['menu_id']);
}
// load the categories for the selected menu
if (isset($restaurant) && is_object($restaurant) && isset($menu) && is_object($menu)) {
$categories = $menu->getCategoriesForRestaurant($restaurant->getId(), true);
}
if (array_key_exists($_REQUEST['form'], $pageTitles)) {
$_REQUEST['_PAGETITLE'] = $pageTitles[$_REQUEST['form']];
} else if (!isset($_REQUEST['_PAGETITLE'])) {
$_REQUEST['_PAGETITLE'] = ucfirst(strtolower($_REQUEST['form']));
}
if (array_key_exists($_REQUEST['form'], $pageMetaDescription)) {
$_REQUEST['_PAGEDESCRIPTION'] = $pageMetaDescription[$_REQUEST['form']];
}
App::debugbarTime("model '{$_REQUEST['form']}'");
$modelPath = CORE_PATH . 'model3.0/customer/'.$_REQUEST['form'].'.php';
if ($_REQUEST['_VERSION'] == 4) {
//set default order type
$selectedRestaurant = $restaurant;
if (!isset($restaurant)) {
$restaurant = $account->getDefaultRestaurant();
}
if ($restaurant) {
Arguments
/home
/deploy
/EHungry-8-simon
/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-8-simon/Web/controllers/customer.php"