/home
/deploy
/EHungry-3-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-3-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
"category_4.0_items_5677_8178_194316_cat_6312"
86400
"N;"
/home
/deploy
/EHungry-3-simon
/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
"category_4.0_items_5677_8178_194316_cat_6312"
"N;"
86400
/home
/deploy
/EHungry-3-simon
/Web
/classes
/Account.class.php
$items = [];
if ($category->getId() > 0) {
$items = $category->getItems($menu->id, false, false, false, false, false, $is_admin, $this->display_zero_dollar_items);
} elseif (is_object($restaurant)) {
$categories = $menu->getCategoriesForRestaurant($restaurant->getId(), true, false);
$carr = [];
foreach ($categories as $c) {
if ($sortByCategory) {
$items[$c->id] =
$c->getItems($menu->id, false, false, false, false, false, $is_admin, $this->display_zero_dollar_items);
} else {
$carr[] = $c->id;
}
}
if (!$sortByCategory) {
$items = Category::getItemsForCategories(implode(',', $carr), true, $this->display_zero_dollar_items);
}
}
Cache::SetArray($cache_key, $items);
}
return $items;
}
public function getAllConfiguredDesktopClients() {
$db = DB::conn();
$sql =
'SELECT DISTINCT a.id AS id FROM desktop_client a, desktop_client_restaurant b, restaurant c WHERE a.id = b.desktopclient_id AND b.restaurant_id = c.id AND c.account_id = ?';
$db->bindParameter($sql, 1, $this->getId(), 'integer');
$result = $db->query($sql);
if ($result && $result->rowCount() > 0) {
$arr = [];
while ($row = $result->fetch()) {
$arr[] = new DesktopClient($row['id']);
}
return $arr;
}
return null;
}
Arguments
"category_4.0_items_5677_8178_194316_cat_6312"
null
/home
/deploy
/EHungry-3-simon
/Web
/classes
/Account.class.php
"_{$this->getId()}_{$menu->getId()}_{$cid}_".
($sortByCategory? 'cat_' : 'alp_').
$restaurant->getId().
($_SESSION['embed']? '_embed' : '').
AWS_S3_REGION;
// try to retrieve from the cache server
$page_fragment = Cache::Get($cache_key);
if (!$page_fragment) {
//echo 'Building Category Page Fragment<br />';
if ($cid === -1) {
$category = new Category(-1);
$category->setDisplayName('View All Menu Items');
$category->setMenuId($menu->getId());
} else {
$category = new Category($cid);
}
$items = $this->getCategoryItems($category, $menu, $is_admin, $restaurant, $sortByCategory);
// now build the page fragment
$page_fragment = Category::buildPageFragment($menu, $category, $items, $hidePrices, $sortByCategory, $is_admin);
Cache::Set($cache_key, $page_fragment);
} else {
//echo 'Using cached Category Page Fragement<br />';
}
return $page_fragment;
}
public function getCategoryItems($category, $menu = null, $is_admin = false, $restaurant = null, $sortByCategory = false) {
$cache_key =
($is_admin? 'admin_category_items' : 'category_4.0_items').
"_{$this->getId()}_{$menu->getId()}_{$category->getId()}_".
($sortByCategory? 'cat_' : 'alp_').
$restaurant->getId().
($_SESSION['embed']? '_embed' : '');
$items = Cache::GetArray($cache_key);
if (!$items) {
$items = [];
Arguments
Category {}
Menu {}
false
Restaurant {}
true
/home
/deploy
/EHungry-3-simon
/Web
/model3.0
/customer
/ordering3.php
if (count($menus) == 1) {
$qs = '';
if ($_GET['embed']) {
$qs = '?embed='.$_GET['embed'];
}
redirectToOrdering([$restaurant, reset($menus)], $qs);
}
$_REQUEST['_PAGETITLE'] = 'Choose A Menu';
break;
case 2: //Menu
break;
case 3: //Category
if (isOrderingClosed(CLOSED_MSG_RESTAURANT)) {
$contentAndCartClass = 'contentandcart-category-closed';
}
if (ClosedHours::isCategoryHidden($restaurant, $category) || HolidayHours::isCategoryHidden($restaurant, $category)) {
redirectToOrderingWithError('Sorry, this category is currently unavailable.', [$restaurant, $menu, -1]);
}
$page_fragment = $account->getCategoryPageFragment($menu, $category->getId(), $restaurant->getHideAllPrices(), $restaurant, true);
if (isset($_REQUEST['sort'])) {
if ($_REQUEST['sort'] == "name") {
usort($items, array("MenuItem", "nameAlphaSort"));
} elseif ($_REQUEST['sort'] == "price") {
usort($items, array("MenuItem", "priceSort"));
}
}
break;
case 4: //Item
case 5: //Price
//check if we're closed right now. If so, display warning
if (!isset($_SESSION['time_ok']) && is_object($restaurant)) {
$eot = checkTimeWarning($cart, $restaurant);
}
break;
}
if ($_REQUEST['ordering_level'] < 3 && is_object($menu)) {
if ($account->getDefaultOrderingPage() == 1) {
Arguments
Menu {}
194316
0
Restaurant {}
true
/home
/deploy
/EHungry-3-simon
/Web
/controllers
/customer.php
$cart->setDefaultOrderType($account, $restaurant);
$cart->setDefaultFees($account, $restaurant);
}
$restaurantRequiredPages = [
'login',
'customerorders'
];
if (is_null($restaurant) && in_array($_REQUEST['form'], $restaurantRequiredPages)) {
redirectTo('home');
}
$modelPath = CORE_PATH . 'model4.0/customer/'.$_REQUEST['form'].'.php';
} else {
$_REQUEST['mobiledetect'] = new Mobile_Detect;
}
if (is_readable($modelPath)) {
include_once($modelPath);
}
App::debugbarTime("model '{$_REQUEST['form']}'");
$custom_nav = CustomNavigationTab::getAllForAccount($account->getId());
$view2HideRightColumns = ['checkout', 'dashboard', 'customerdetails', 'customerorders',
'mydeliveryaddresses', 'emailpreferences', 'mycoupons', 'mycreditcards', 'mypassword',
'customerorderdetails', 'editcustomer', 'adddeliveryaddress',
'editlocation', 'orderconfirmation','viewcart', 'map', 'validatecallback'];
if (in_array($_REQUEST['form'], $view2HideRightColumns)) {
$hideRightColumn = true;
}
$myAccountPages = ['dashboard', 'customerdetails', 'customerorders', 'editaddress', 'editcustomer', 'mydeliveryaddresses', 'editlocation', 'emailpreferences', 'mycoupons', 'mycreditcards', 'mypassword', 'adddeliveryaddress', 'map', 'myloyalty'];
if (in_array($_REQUEST['form'], $myAccountPages)) {
$isMyAccountPage = true;
}
if (!isset($cart) || !is_object($cart)) {
$GLOBALS['cart'] = \Cart::getCurrent();
Arguments
"/home/deploy/EHungry-3-simon/Web/model3.0/customer/ordering3.php"
/home
/deploy
/EHungry-3-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-3-simon/Web/controllers/customer.php"