/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-05-05 00:00:00_r8701_PICKUP_0"
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-05-05 00:00:00_r8701_PICKUP_0"
"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-05-05 00:00:00_r8701_PICKUP_0"
null
/home
/deploy
/EHungry-8-simon
/Web
/classes
/HolidayHours.class.php
}
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);
}
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';
Arguments
"2025-05-05 00:00:00"
8701
null
"PICKUP"
/home
/deploy
/EHungry-8-simon
/Web
/lib
/global.php
return str_replace($origWords, $replaceWords, $keywords);
}
return null;
}
}
function ellipsis($text, $max) {
return strlen($text)<=$max ? $text : substr($text, 0, $max-3).'...';
}
function printDayHours(Restaurant $rest, bool $isDelivery, $dow, $bold = true) {
$prefix = $isDelivery? 'delivery_' : '';
$prefixDow = "{$prefix}{$dow}_";
$closedOnDow = $rest->{"{$prefix}closed_on_$dow"};
//show holiday hours -- except for past days
$hhTime = strtotime($dow, $rest->getLocalTime());
$holidayDate = date('Y-m-d 00:00:00', $hhTime);
$holiday = HolidayHours::getByDateAndRestaurantAndType($holidayDate, $rest->id, $isDelivery? 'DELIVERY' : 'PICKUP');
$tag_name = $bold ? 'strong' : 'span';
if (is_object($holiday)) { ?>
<div class="well well-small">
<<?=$tag_name?>>
<?=date('F j', $hhTime)?> - <?=$holiday->is_closed ? 'Closed' : reformatTime($holiday->start_hour) . ' - ' . reformatTime($holiday->end_hour)?>
</<?=$tag_name?>>
<br />
(Usually <?=$closedOnDow ? 'closed' : getOpeningAndClosingHours($rest, $prefixDow, false)?>)
</div>
<? } elseif ($closedOnDow) { ?>
<<?=$tag_name?>>Closed</<?=$tag_name?>>
<? } else { ?>
<<?=$tag_name?>><?=getOpeningAndClosingHours($rest, $prefixDow, true)?></<?=$tag_name?>>
<? }
}
function renderAdminEnabledBadge($enabled) {
echo '<span class="badge badge-' . ($enabled?'success':'important') . '">' . ($enabled?'Enabled':'Disabled') . '</span>';
}
Arguments
"2025-05-05 00:00:00"
8701
"PICKUP"
/home
/deploy
/EHungry-8-simon
/Web
/view3.0
/customer
/locationinfo.php
<?
/** @var Restaurant[] $active_rests */
/**
* @param Restaurant $rest
* @param bool $isDelivery
*/
function printHours(Restaurant $rest, bool $isDelivery) {
$today = mb_strtolower(date('l', $rest->getLocalTime()));
foreach (DAYS_OF_WEEK as $dow) {
$dow = mb_strtolower($dow); ?>
<div class="day <?=$today == $dow ? 'today' : ''?>">
<div class="weekday"><?=mb_ucfirst($dow)?></div>
<div class="hours">
<? printDayHours($rest, $isDelivery, $dow); ?>
</div>
</div>
<? }
}
$locationsTitle = MainNavigationTab::getTabName($account->id, 'location', $account->location_wording_plural);
?>
<h1><?=ucfirst($locationsTitle)?> and Hours</h1>
<? if (!$active_rests) {
echo showFailNotice2("It appears that $account->display_name currently has no active $locationsTitle. This probably means that this account is not completely set up yet. You may wish to check again shortly if you wish to place an order.");
return;
} ?>
<form action="" method="post" class="location-infos">
<? foreach ($active_rests as $rest) { ?>
<div class="row-fluid mt10 clearfix">
<div class="span5">
<h2><?=$rest->getDisplayName()?></h2>
</div>
</div>
<div class="row-fluid clearfix">
<div class="span5 location-info">
<?=$rest->getFullAddress(true)?><br />
Arguments
Restaurant {}
false
"monday"
/home
/deploy
/EHungry-8-simon
/Web
/view3.0
/customer
/locationinfo.php
</a>
<? } else { ?>
<em class="alert">Ordering not available</em>
<? } ?>
</div>
<br />
<div class="span7">
Current time is: <strong><?=date('g:i A', $rest->getLocalTime())?> <?=$rest->getTimeZoneDisplayName()?></strong>
</div>
</div>
<div class="location-hours mt10">
<? $hoursName = '';
if ($rest->getSeparateDeliveryHours()) {
$hoursName = $rest->getHoursName('PICKUP/DINEIN', true);
}
if ($rest->getHasDineInBase() || $rest->getHasPickupBase()) { ?>
<div class="bold"><?=$hoursName?> HOURS:</div>
<? printHours($rest, false) ?>
<? } ?>
<br />
<? if ($rest->getHasDeliveryBase() && $rest->getSeparateDeliveryHours()) {
$hoursName = $rest->getHoursName('DELIVERY', true); ?>
<div class="bold"><?=$hoursName?> HOURS:</div>
<? printHours($rest, true) ?>
<? } ?>
</div>
<hr />
<? } ?>
</form>
Arguments
/home
/deploy
/EHungry-8-simon
/Web
/controllers
/customer.php
if (!in_array($_REQUEST['form'], ['checkout', 'nosuchpage', 'validatecallback', 'viewdeliveryzone'])) {
//TODO: probably need to add one more form here that is called ajax, callback seems to reset when it shouldnt
unset($_SESSION['validation_data']);
}
$locs = $account->getActiveRestaurants('position');
$tab = MainNavigationTab::getAllForAccount($account->getId());
include_once(CORE_PATH.'lib/helpers/customer3.0.php');
if (!in_array($_REQUEST['form'], $viewContentOnly)) {
App::debugbarTime('header');
include_once(getLayoutPartPath('header'));
App::debugbarTime('header');
}
App::debugbarTime("view '{$_REQUEST['form']}'");
$path = CORE_PATH.'view' . ($_REQUEST['_VERSION'] == 4 ? 4 : 3) . '.0/customer/'.$_REQUEST['form'].'.php';
if (is_readable($path)) {
include_once($path);
}
App::debugbarTime("view '{$_REQUEST['form']}'");
if (!in_array($_REQUEST['form'], $viewContentOnly)) {
App::debugbarTime('footer');
include_once(getLayoutPartPath('footer'));
App::debugbarTime('footer');
}
function getLayoutPartPath($part) {
if (isset($_REQUEST['_CORDOVA_APP'])) {
$cart = Cart::getCurrent();
//FIXME: it's technically possible to end up with $template = null
if (!$_REQUEST['contentonly']) {
$template = !isset($_REQUEST["altdoc"])? "app/$part" : "app/alt$part";
}
} else {
$template = !isset($_REQUEST["altdoc"])? "customer/$part" : "customer/alt$part";
}
Arguments
"/home/deploy/EHungry-8-simon/Web/view3.0/customer/locationinfo.php"
/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"