/home
/deploy
/EHungry-6-boyan
/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-6-boyan
/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
"custom_order_types_50258_7878"
86400
"a:0:{}"
/home
/deploy
/EHungry-6-boyan
/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
"custom_order_types_50258_7878"
"a:0:{}"
86400
/home
/deploy
/EHungry-6-boyan
/Web
/classes
/CustomOrderType.class.php
if ($aObj !== false) {
return $aObj;
}
$db_conn = DB::conn();
$rbs = [];
$sql = "SELECT * FROM ".CustomOrderType::getTableName()." WHERE account_id = ? ORDER BY display_name ASC";
$db_conn->bindParameter($sql, 1, $aid, "integer");
$result = $db_conn->query($sql);
if ($result && $result->rowCount() > 0) {
while ($row = $result->fetch()) {
$customorderType = new CustomOrderType();
$customorderType->loadFromArray($row);
$activeAtRestaurants = json_decode($customorderType->active_at_restaurants, true);
if ($activeAtRestaurants[$rid]) {
$rbs[$row["id"]] = $customorderType;
}
}
}
Cache::SetArray($cacheKey, $rbs);
return $rbs;
}
public static function clearCacheForRestaurant($aid, $rid) {
$cacheKey = 'custom_order_types_'.$aid.'_'.$rid;
Cache::Delete($cacheKey);
}
public function getBaseTypeDisplayName() {
$orderType = strtolower($this->getBaseType());
return ($orderType=='delivery')?'Delivery':(($orderType=='pickup')?PICKUP_LABEL:(($orderType=='dinein')?DINEIN_LABEL:(($orderType=='pickup&dinein')?PICKUP_LABEL.' & '.DINEIN_LABEL:$this->getBaseType())));
}
}
Arguments
"custom_order_types_50258_7878"
[]
/home
/deploy
/EHungry-6-boyan
/Web
/classes
/Restaurant.class.php
if ($this->getHasDineIn()) {
$types[] = 'DINEIN';
}
return implode('|', $types);
}
public function getHasPickupBase() {
return $this->getHasPickup() || $this->getHasBaseOrderType('PICKUP');
}
public function getHasDeliveryBase() {
return $this->getHasDelivery() || $this->getHasBaseOrderType('DELIVERY');
}
public function getHasDineInBase() {
return $this->getHasDineIn() || $this->getHasBaseOrderType('DINEIN');
}
private function getHasBaseOrderType($baseType) {
$customOrderTypes = CustomOrderType::getAllActiveForRestaurant($this->getAccountId(), $this->getId());
foreach ((array)$customOrderTypes as $customOrderType) {
if ($customOrderType->base_type === $baseType) {
return true;
}
}
return false;
}
public function getHoursName($baseType, $uppercase = false) {
$customOrderTypes = CustomOrderType::getAllActiveForRestaurant($this->getAccountId(), $this->getId());
$hoursNames = [];
switch ($baseType) {
case 'PICKUP':
if ($this->getHasPickup()) {
$hoursNames[] = PICKUP_LABEL;
}
break;
case 'DINEIN':
if ($this->getHasDineIn()) {
$hoursNames[] = DINEIN_LABEL;
Arguments
/home
/deploy
/EHungry-6-boyan
/Web
/classes
/Restaurant.class.php
}
if ($this->getHasPickup()) {
$types[] = 'PICKUP';
}
if ($this->getHasDineIn()) {
$types[] = 'DINEIN';
}
return implode('|', $types);
}
public function getHasPickupBase() {
return $this->getHasPickup() || $this->getHasBaseOrderType('PICKUP');
}
public function getHasDeliveryBase() {
return $this->getHasDelivery() || $this->getHasBaseOrderType('DELIVERY');
}
public function getHasDineInBase() {
return $this->getHasDineIn() || $this->getHasBaseOrderType('DINEIN');
}
private function getHasBaseOrderType($baseType) {
$customOrderTypes = CustomOrderType::getAllActiveForRestaurant($this->getAccountId(), $this->getId());
foreach ((array)$customOrderTypes as $customOrderType) {
if ($customOrderType->base_type === $baseType) {
return true;
}
}
return false;
}
public function getHoursName($baseType, $uppercase = false) {
$customOrderTypes = CustomOrderType::getAllActiveForRestaurant($this->getAccountId(), $this->getId());
$hoursNames = [];
switch ($baseType) {
case 'PICKUP':
if ($this->getHasPickup()) {
$hoursNames[] = PICKUP_LABEL;
}
Arguments
/home
/deploy
/EHungry-6-boyan
/Web
/templates3.0
/customer
/openstatus.php
<?
if (!is_object($_REQUEST['_TEMPLATE_SETTINGS']['hide_open_sign']) || !$_REQUEST['_TEMPLATE_SETTINGS']['hide_open_sign'] || !$_REQUEST['_TEMPLATE_SETTINGS']['hide_open_sign']->getValue()) {
if (isset($restaurant) && is_object($restaurant)) {
$today = date("l");
$holidayDate = date('Y-m-d 00:00:00', $restaurant->getLocalTime()); ?>
<?
$earliestOpen = null;
$latestClose = null;
$earliestOpen2 = null;
$latestClose2 = null;
if ($restaurant->getHasDineInBase() || $restaurant->getHasPickupBase()) {
$start = strtotime($restaurant->{"get".$today."Open"}());
$close = strtotime($restaurant->{"get".$today."Closed"}());
$closed = $restaurant->{"getClosedOn".$today}();
$earliestOpen = !$closed ? $start : null;
$latestClose = !$closed ? $close : null;
$restaurantType = $restaurant->getHasDineInBase() ? "DINEIN" : "PICKUP";
$holidayHours = HolidayHours::getByDateAndRestaurantAndType($holidayDate, $restaurant->getId(), $restaurantType);
if (is_object($holidayHours)) {
$start = strtotime($holidayHours->getStartHour());
$close = strtotime($holidayHours->getEndHour());
$closed = $holidayHours->getIsClosed();
$earliestOpen = $start;
$latestClose = $close;
}
$hasMoreHours = false;
if (!$closed && $restaurant->getTwoHourSets() && ($restaurant->{"get".$today."Open2"}() != $restaurant->{"get".$today."Open"}() ||
$restaurant->{"get".$today."Closed2"}() != $restaurant->{"get".$today."Closed"}())) {
$hasMoreHours = true;
$start2 = strtotime($restaurant->{"get".$today."Open2"}());
$earliestOpen2 = $start2;
$close2 = strtotime($restaurant->{"get".$today."Closed2"}());
$latestClose2 = $close2;
}
}
if ($restaurant->getSeparateDeliveryHours()) {
if ($restaurant->getHasDeliveryBase()) {
$hasMoreHours = true;
/home
/deploy
/EHungry-6-boyan
/Web
/templates3.0
/customer
/widgets
/openwidget.php
<?
if (!isset($_REQUEST['_TEMPLATE_SETTINGS']['hide_open_sign']) || !$_REQUEST['_TEMPLATE_SETTINGS']['hide_open_sign']->getValue()) {
if (isset($restaurant)) {
$today = date("l");
$holidayDate = date('Y-m-d 00:00:00', $restaurant->getLocalTime()); ?>
<div class="widget sign">
<div class="opensign <?=($restaurant->pickupAvailableNow() || $restaurant->deliveryAvailableNow())?'open':'closed'?>">
<div class="mobile-only">
<? include(CORE_PATH."templates3.0/customer/openstatus.php"); ?>
</div>
<div class="mobile-hidden">
<strong class="h4">
<span><?=($restaurant->pickupAvailableNow() || $restaurant->deliveryAvailableNow())?'Open':'Closed'?></span>
</strong>
</div>
<div class="hours <?=$restaurant->getSeparateDeliveryHours()?'separateHours':''?> mobile-hidden clearfix" id="hoursDiv">
<?
$hasPickupHolidayHours = false;
$hasDeliveryHolidayHours = false;
if ($restaurant->getSeparateDeliveryHours()) {
if ($restaurant->getHasDeliveryBase()) {
$closedDelivery = $restaurant->{"getDeliveryClosedOn".$today}();
$startDelivery = strtotime($restaurant->{"getDelivery".$today."Open"}());
$closeDelivery = strtotime($restaurant->{"getDelivery".$today."Closed"}());
$holidayHours = HolidayHours::getByDateAndRestaurantAndType($holidayDate, $restaurant->getId(), 'DELIVERY');
if (is_object($holidayHours)) {
$startDelivery = strtotime(date('1990-01-01 H:i:00', strtotime($holidayHours->getStartHour())));
$closeDelivery = strtotime(date('1990-01-01 H:i:00', strtotime($holidayHours->getEndHour())));
$closedDelivery = $holidayHours->getIsClosed();
$hasDeliveryHolidayHours = true;
}
}
}
if ($restaurant->getHasDineInBase() || $restaurant->getHasPickupBase()) {
$start = strtotime($restaurant->{"get".$today."Open"}());
$close = strtotime($restaurant->{"get".$today."Closed"}());
$closed = $restaurant->{"getClosedOn".$today}();
$restaurantType = $restaurant->getHasDineInBase() ? "DINEIN" : "PICKUP";
$holidayHours = HolidayHours::getByDateAndRestaurantAndType($holidayDate, $restaurant->getId(), $restaurantType);
Arguments
"/home/deploy/EHungry-6-boyan/Web/templates3.0/customer/openstatus.php"
/home
/deploy
/EHungry-6-boyan
/Web
/templates3.0
/customer
/footer.php
<!-- End Content -->
<? if ($_REQUEST['_PAGEH2']) { ?>
<h2 class="end"><?=$_REQUEST['_PAGEH2']?></h2>
<? } ?>
</div>
<? if (!isset($hideRightColumn) || $hideRightColumn == false) { ?>
<aside class="rightaside">
<? if (!$_REQUEST['mobiledetect']->isMobile() || $_REQUEST['mobiledetect']->isTablet()) {
include(CORE_PATH."templates3.0/customer/widgets/openwidget.php");
include(CORE_PATH."templates3.0/customer/widgets/announcementwidget.php");
}
//if coupon box not hidden
if (is_object($_REQUEST['_TEMPLATE_SETTINGS']['hide_coupons_box']) && !$_REQUEST['_TEMPLATE_SETTINGS']['hide_coupons_box']->getValue()
&& (
(isset($showCart) && $showCart) //show on pages where cart is shown
|| (is_object($_REQUEST['_TEMPLATE_SETTINGS']['show_coupons_display_box_homepage']) && $_REQUEST['_TEMPLATE_SETTINGS']['show_coupons_display_box_homepage']->getValue() && $_REQUEST['form'] == 'home') //show on homepage when enabled
)
) {
$totalCouponsToDisplay = 5;
// We grab 6 coupons with no offset. Even though we are displaying only 5, we grab 6
// to determine whether we should show a "Load More" button
$coupons_in_box = Coupon::getAllCouponsInBoxForAccount($account->getId(), true, false, $totalCouponsToDisplay + 1, 0);
if ($coupons_in_box) {
$couponsDisplayed = 0; // keeps track of how many coupons have been displayed ?>
<div class="widget couponbox">
<header><span class="h3 sep">Coupons</span></header>
<div class="inner clearfix">
<ul id="coupon-list">
<? foreach ($coupons_in_box as $coupon) {
// If we have shown all the coupons we were going to show, we are done
if ($couponsDisplayed == $totalCouponsToDisplay) {
break;
} ?>
<li>
<a href="<?=formatCustomerLink('mycoupons', ['redeem' => $coupon->getId()])?>">
<span class="desc"><?=$coupon->getBriefCouponDescription()?></span>
Arguments
"/home/deploy/EHungry-6-boyan/Web/templates3.0/customer/widgets/openwidget.php"
/home
/deploy
/EHungry-6-boyan
/Web
/controllers
/customer.php
$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";
}
if ($_REQUEST['_VERSION'] == 4) {
return CORE_PATH."templates4.0/$template.php";
} else {
return CORE_PATH."templates3.0/$template.php";
}
Arguments
"/home/deploy/EHungry-6-boyan/Web/templates3.0/customer/footer.php"
/home
/deploy
/EHungry-6-boyan
/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-6-boyan/Web/controllers/customer.php"