50+ restaurants in the area
| ( ! ) Fatal error: Class 'eHungry\classes\Util\BitmaskSet' not found in /home/deploy/EHungry-2-joel/Web/classes/Bitmasks/OrderTemplatePlatforms.php on line 4 | ||||
|---|---|---|---|---|
| Call Stack | ||||
| # | Time | Memory | Function | Location |
| 1 | 0.0001 | 399592 | {main}( ) | .../index.php:0 |
| 2 | 0.0175 | 7140856 | require( '/home/deploy/EHungry-2-joel/Web/controllers/marketplace.php' ) | .../index.php:30 |
| 3 | 0.0175 | 7141416 | include( '/home/deploy/EHungry-2-joel/Web/marketplace/router.php' ) | .../marketplace.php:2 |
| 4 | 0.0180 | 7237400 | eHungry\Services\Router::handle( ) | .../router.php:27 |
| 5 | 0.0181 | 7238872 | Marketplace\RestaurantListRoute::restaurantsByStateAndCity( ) | .../Router.php:44 |
| 6 | 0.0394 | 7721976 | Marketplace\RestaurantListRoute::restaurantList( ) | .../restaurant_list.php:96 |
| 7 | 0.1027 | 10490128 | Marketplace\RestaurantListRoute::restaurantCollection( ) | .../restaurant_list.php:507 |
| 8 | 0.1042 | 10683120 | Account->formatCustomerOrderLinkForCurrentPlatform( ) | .../restaurant_list.php:754 |
| 9 | 0.1042 | 10683120 | spl_autoload_call ( ) | .../Account.class.php:2423 |
| 10 | 0.1042 | 10683200 | Composer\Autoload\ClassLoader->loadClass( ) | .../Account.class.php:2423 |
| 11 | 0.1042 | 10683200 | Composer\Autoload\includeFile( ) | .../ClassLoader.php:428 |
| 12 | 0.1043 | 10684184 | include( '/home/deploy/EHungry-2-joel/Web/classes/Bitmasks/OrderTemplatePlatforms.php' ) | .../ClassLoader.php:571 |
Whoops \ Exception \ ErrorException
(E_ERROR)
Stack frames (13)
12
Whoops
\Exception
\ErrorException
/
home
/deploy
/EHungry-2-joel
/Web
/classes
/Bitmasks
/OrderTemplatePlatforms.php
4
11
…
/vendor
/composer
/ClassLoader.php
571
10
Composer
\Autoload
\includeFile
…
/vendor
/composer
/ClassLoader.php
428
9
Composer
\Autoload
\ClassLoader
loadClass
/
home
/deploy
/EHungry-2-joel
/Web
/classes
/Account.class.php
2423
8
spl_autoload_call
/
home
/deploy
/EHungry-2-joel
/Web
/classes
/Account.class.php
2423
7
Account
formatCustomerOrderLinkForCurrentPlatform
/
home
/deploy
/EHungry-2-joel
/Web
/marketplace
/routes
/restaurant_list.php
754
6
Marketplace
\RestaurantListRoute
restaurantCollection
/
home
/deploy
/EHungry-2-joel
/Web
/marketplace
/routes
/restaurant_list.php
507
5
Marketplace
\RestaurantListRoute
restaurantList
/
home
/deploy
/EHungry-2-joel
/Web
/marketplace
/routes
/restaurant_list.php
96
4
Marketplace
\RestaurantListRoute
restaurantsByStateAndCity
/
home
/deploy
/EHungry-2-joel
/Web
/Services
/Router.php
44
3
eHungry
\Services
\Router
handle
/
home
/deploy
/EHungry-2-joel
/Web
/marketplace
/router.php
27
2
/
home
/deploy
/EHungry-2-joel
/Web
/controllers
/marketplace.php
2
1
/
home
/deploy
/EHungry-2-joel
/Web
/index.php
30
0
{main}
/
home
/deploy
/EHungry-2-joel
/Web
/index.php
0
/
home
/deploy
/EHungry-2-joel
/Web
/classes
/Bitmasks
/OrderTemplatePlatforms.php
<?php
namespace eHungry\classes\Bitmasks;
class OrderTemplatePlatforms extends \eHungry\classes\Util\BitmaskSet {
const DOT = 1; // Direct Order Template; everything except springroll
const MOT = 2; // Marketplace Order Template; springroll
public static function normalizeBitName(int $value, string $name): string {
switch ($value) {
case self::DOT:
$out = 'DOT - Direct Order Template';
break;
case self::MOT:
$out = 'MOT - Springroll';
break;
default:
$out = parent::normalizeBitName($value, $name);
}
return $out;
}
public static function currentOrderingPlatform(bool $isSpringRoll): int {
return ($isSpringRoll? self::MOT : self::DOT);
}
}
Arguments
"Class 'eHungry\classes\Util\BitmaskSet' not found"
/
home
/deploy
/EHungry-2-joel
/PHP
/vendor
/composer
/ClassLoader.php
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
return false;
}
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*
* @param string $file
* @return void
* @private
*/
function includeFile($file)
{
include $file;
}
/
home
/deploy
/EHungry-2-joel
/PHP
/vendor
/composer
/ClassLoader.php
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
if (null !== $this->vendorDir) {
unset(self::$registeredLoaders[$this->vendorDir]);
}
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return true|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
includeFile($file);
return true;
}
return null;
}
/**
* Finds the path to the file where the class is defined.
*
* @param string $class The name of the class
*
* @return string|false The path if found, false otherwise
*/
public function findFile($class)
{
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
/
home
/deploy
/EHungry-2-joel
/Web
/classes
/Account.class.php
} else { /* DOT */
$url = $this->getDomainUrl();
}
return $url.'/';
}
/**
* Format an ordering link for the currently browsed ordering platform.
* Ordering links are formatted like: /order/{restaurant}/{menu}/{category}/{item}/{price} where each layer is optional.
*
* @param Restaurant|string|null $restaurant
* @param Menu|string|null $menu
* @param Category|string|null $category
* @param MenuItem|string|null $item
* @param MenuItemPrice|string|null $price
* @param string $qs Anything else to append as query-string params
* @return string
*/
public function formatCustomerOrderLinkForCurrentPlatform($restaurant = null, $menu = null, $category = null, $item = null, $price = null, $qs = ''): string {
return $this->formatCustomerOrderLink(OrderTemplatePlatforms::currentOrderingPlatform(isSpringroll()), $restaurant, $menu, $category, $item, $price, $qs);
}
/**
* Format an ordering link for a specific ordering platform.
* Ordering links are formatted like: /order/{restaurant}/{menu}/{category}/{item}/{price} where each layer is optional.
*
* @param int $orderTemplatePlatform {@see OrderTemplatePlatforms}
* @param Restaurant|string|null $restaurant
* @param Menu|string|null $menu
* @param Category|string|null $category
* @param MenuItem|string|null $item
* @param MenuItemPrice|string|null $price
* @param string $qs Anything else to append as query-string params
* @return string
*/
public function formatCustomerOrderLink(int $orderTemplatePlatform = OrderTemplatePlatforms::DOT, $restaurant = null, $menu = null, $category = null, $item = null, $price = null, $qs = '') {
$psa = [];
$segments = [
'restaurant' => $restaurant,
/
home
/deploy
/EHungry-2-joel
/Web
/classes
/Account.class.php
} else { /* DOT */
$url = $this->getDomainUrl();
}
return $url.'/';
}
/**
* Format an ordering link for the currently browsed ordering platform.
* Ordering links are formatted like: /order/{restaurant}/{menu}/{category}/{item}/{price} where each layer is optional.
*
* @param Restaurant|string|null $restaurant
* @param Menu|string|null $menu
* @param Category|string|null $category
* @param MenuItem|string|null $item
* @param MenuItemPrice|string|null $price
* @param string $qs Anything else to append as query-string params
* @return string
*/
public function formatCustomerOrderLinkForCurrentPlatform($restaurant = null, $menu = null, $category = null, $item = null, $price = null, $qs = ''): string {
return $this->formatCustomerOrderLink(OrderTemplatePlatforms::currentOrderingPlatform(isSpringroll()), $restaurant, $menu, $category, $item, $price, $qs);
}
/**
* Format an ordering link for a specific ordering platform.
* Ordering links are formatted like: /order/{restaurant}/{menu}/{category}/{item}/{price} where each layer is optional.
*
* @param int $orderTemplatePlatform {@see OrderTemplatePlatforms}
* @param Restaurant|string|null $restaurant
* @param Menu|string|null $menu
* @param Category|string|null $category
* @param MenuItem|string|null $item
* @param MenuItemPrice|string|null $price
* @param string $qs Anything else to append as query-string params
* @return string
*/
public function formatCustomerOrderLink(int $orderTemplatePlatform = OrderTemplatePlatforms::DOT, $restaurant = null, $menu = null, $category = null, $item = null, $price = null, $qs = '') {
$psa = [];
$segments = [
'restaurant' => $restaurant,
/
home
/deploy
/EHungry-2-joel
/Web
/marketplace
/routes
/restaurant_list.php
</ul>
</section>
<? } ?>
<? } ?>
</div>
<?
return ob_get_clean();
}
private static function restaurantCollection($attrs, $restaurants) {
$cart = \eHungry\Services\Cart::getCart();
$children = [];
foreach ($restaurants as $restaurant) {
$account = new \Account($restaurant->account_id);
$children[] = \EDS\html('a', [
'id' => 'restaurant_collection_' . $restaurant->id,
'class' => 'collection_card flex-shrink-0 d-block rounded-2 text-dark text-decoration-none',
'href' => $account->formatCustomerOrderLinkForCurrentPlatform($restaurant),
'onclick' => static::confirmNewCart($cart, $restaurant),
], static::collectionCard($restaurant, ['class' => 'h-100']));
}
return static::collection(array_merge([
'show_controls' => count($restaurants) > 1,
'scroll_step' => "$(this).find('.collection_card').width() + 16",
'breakout' => '0',
], $attrs), $children);
}
private static function confirmNewCart(\Cart $cart, \Restaurant $restaurant) {
return count($cart->cartItems) > 0 && $restaurant->id !== \eHungry\Services\Restaurant::getRestaurantId()
? "return window.confirm(`Switching to $restaurant->display_name will clear your cart. Press OK to start a new order or Cancel to keep your current order from ".\eHungry\Services\Restaurant::getRestaurant()->display_name.".`)"
: null;
}
private static function collection($attrs, $children) {
return \EDS\Collection(
array_merge($attrs, [
'class' => 'mt-5 mb-4 ' . ($attrs['class'] ?? ''),
/
home
/deploy
/EHungry-2-joel
/Web
/marketplace
/routes
/restaurant_list.php
<?
$mapped_restaurants = [];
foreach ($filtered_restaurants as $restaurant) {
$mapped_restaurants[] = [
'id' => $restaurant->id,
'name' => $restaurant->display_name,
'lat' => $restaurant->getLatitude(),
'lng' => $restaurant->getLongitude(),
];
}
?>
$(() => setMapRestaurants(<?=json_encode($mapped_restaurants)?>));
</script>
<? // Results ?>
<div id="restaurant-list">
<div id="collections">
<? $has_active_filters = count($active_params) > 0; ?>
<? if (!$has_active_filters) { ?>
<?=static::restaurantCollection(['id' => 'featured', 'title' => 'Featured'], DataService::getFeaturedRestaurants($coordinates))?>
<?=static::restaurantCollection(['id' => 'new', 'title' => 'New on Springroll'], DataService::getNewRestaurants($coordinates))?>
<?=static::restaurantCollection(['id' => 'dealsandcoupons', 'title' => 'Deals & Coupons'], DataService::getDealsAndCoupons($coordinates))?>
<? // We're using Deals & Coupons collection for now, but keeping this here in case we want to use that big 2 cards per scroll design later
// Promotions
/*$promotions = DataService::getPromotions();
$promotionsHtml = '';
foreach ($promotions as $promotion) {
$promotionsHtml .= static::promotionCard($promotion);
}*/
?>
<?//=static::collection(['id' => 'promotions', 'title' => 'Promotions'], $promotionsHtml)?>
<? } ?>
</div>
<? // Filtered restaurants ?>
<div id="filtered-restaurants-container" class="mt-4 px-4 px-<?=static::BREAKPOINT?>-0">
<h2 class="eds-display-text-title-m fw-medium" style="font-family: var(--springroll-font-display)">Restaurants in the area</h2>
/
home
/deploy
/EHungry-2-joel
/Web
/marketplace
/routes
/restaurant_list.php
}
return static::restaurantList($request);
}
public static function restaurantsByStateAndCity(array $params, array $request) {
$state = \EDS\undasherize($params['state']);
$city = \EDS\undasherize($params['city']);
$request = array_merge($request, static::getStateAndCityIfRestaurantsAvailable($state, $city));
$address = "$city, $state";
$request['search'] = $address;
$geocode_data = \ZipCode::getGeoLocation($address);
if ($geocode_data) {
$request['lat'] = $geocode_data[0];
$request['lng'] = $geocode_data[1];
}
return static::restaurantList($request);
}
private static function getStateAndCityIfRestaurantsAvailable(?string $state_or_abbr, ?string $city) {
$state_or_abbr = trim($state_or_abbr ?: '');
$city = trim($city ?: '');
$states = DataService::getStates();
$state_name = (
$state_or_abbr && array_key_exists($state_or_abbr, $states)
? $state_or_abbr
: (getStateFullName($state_or_abbr) && array_key_exists(getStateFullName($state_or_abbr), $states)
? getStateFullName($state_or_abbr)
: null)
);
$city_name = $state_name && in_array($city, $states[$state_name]) ? $city : null;
return ['state' => $state_name, 'city' => $city_name];
}
// Components
/
home
/deploy
/EHungry-2-joel
/Web
/Services
/Router.php
* public static function editUser(array $params, array $request) {}
* public static function deleteUser(array $params, array $request) {}
* }
* ```
*
* @return mixed
*/
public static function handle(string $method, string $url, array $request, array $route_classes) {
$account_id_string = Account::getAccountIdString();
$unprefixed_url = $account_id_string
? preg_replace("/^\/$account_id_string/", '', $url)
: $url;
foreach ($route_classes as $route_class) {
$routes = $route_class::ROUTES;
foreach ($routes as $path => $handler) {
$params = [];
if (preg_match("/^$path\/?$/i", "$method $unprefixed_url", $params)) {
return $route_class::$handler($params, $request);
}
}
}
http_response_code(404);
return '<div class="px-4 py-3">' . \EDS\Alert(['variant' => 'danger'], 'Not Found') . '</div>';
}
}
/
home
/deploy
/EHungry-2-joel
/Web
/marketplace
/router.php
require_once(CORE_PATH . 'auth/forgotpassword.php');
require_once(CORE_PATH . 'auth/login.php');
require_once(CORE_PATH . 'auth/register.php');
require_once(CORE_PATH . 'marketplace/assets/assets.php');
require_once(__DIR__ . '/routes/landing.php');
require_once(__DIR__ . '/routes/campaigns.php');
require_once(__DIR__ . '/routes/product.php');
require_once(__DIR__ . '/routes/restaurant_list.php');
require_once(__DIR__ . '/routes/restaurant_details.php');
require_once(__DIR__ . '/routes/support.php');
require_once(__DIR__ . '/routes/generatedfilesroute.php');
$handler_output = \eHungry\Services\Router::handle(
$_SERVER['REQUEST_METHOD'],
parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) ?? '/',
$_REQUEST,
[
\AccountSettings\ProfileInfoRoutes::class,
\AccountSettings\BasicInformationRoutes::class,
\AccountSettings\ChangePasswordRoutes::class,
\AccountSettings\AddressRoutes::class,
\AccountSettings\PaymentMethodRoutes::class,
\AccountSettings\CommunicationRoutes::class,
\AccountSettings\CampaignsRoutes::class,
\AccountSettings\AccountRoutes::class,
\AccountSettings\OrderRoutes::class,
\AccountSettings\CouponRoutes::class,
\Auth\ForgotPasswordRoutes::class,
\Auth\LoginRoutes::class,
\Auth\RegisterRoutes::class,
LandingRoute::class,
CampaignsRoute::class,
ProductRoute::class,
RestaurantListRoute::class,
RestaurantPageRoute::class,
SupportRoutes::class,
/
home
/deploy
/EHungry-2-joel
/Web
/controllers
/marketplace.php
<? include(CORE_PATH . 'marketplace/router.php');
/
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");
/
home
/deploy
/EHungry-2-joel
/Web
/index.php
<? /** @noinspection PhpIncludeInspection - to avoid marking dynamic includes */
//TODO create a Β«rootΒ»/_bootstrap.php which can be used by .psysh.php, tests/bootstrap.php and Web/index.php
require(dirname(__DIR__).'/PHP/base_consts.php');
require(dirname(__DIR__).'/PHP/autoloader.php');
initializeAutoLoader();
//disabled for now since we already have our own Alerts infrastructure, and it's not worth it to append another cloud provider to the startup of every freaking request; it's also not possible to catch errors this early if we depend on database checks, but we'll leave it here in case we change our mind?
//ErrorHandlers::sentryInit(); //early catch of errors and failsafe for smaller controllers, not in Sentry
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");
Environment & details:
| Key | Value |
| aid | "restaurants/new-york/farmingdale"
|
empty
empty
| Key | Value |
| PHPSESSID | "knug4ikuoquvn8e6efgdo83us8"
|
| Key | Value |
| loc | "en_US"
|
| customer_account_id | 24603
|
| cart | Cart {}
|
| restaurant_id | 14786
|
| menu_id | 17819
|
| Key | Value |
| UNIQUE_ID | "aWWdGCOlx2NTdnnjGdTV-wAAAAI"
|
| SCRIPT_URL | "/restaurants/new-york/farmingdale"
|
| SCRIPT_URI | "http://www.springroll.com.2.joel.ehungry.net/restaurants/new-york/farmingdale"
|
| HTTP_HOST | "www.springroll.com.2.joel.ehungry.net"
|
| HTTP_X_REAL_IP | "216.73.216.9"
|
| HTTP_X_CONFKEY | "Main_Domain:14844"
|
| HTTP_SCHEME | "https"
|
| HTTP_EHENV | "TODO"
|
| HTTP_CONNECTION | "close"
|
| HTTP_ACCEPT | "*/*"
|
| HTTP_USER_AGENT | "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
|
| HTTP_ACCEPT_ENCODING | "gzip, br, zstd, deflate"
|
| HTTP_COOKIE | "PHPSESSID=knug4ikuoquvn8e6efgdo83us8"
|
| PATH | "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
|
| SERVER_SIGNATURE | "" |
| SERVER_SOFTWARE | "Apache/2.4.62 () mod_wsgi/4.6.5 Python/3.7 PHP/7.2.34"
|
| SERVER_NAME | "www.springroll.com.2.joel.ehungry.net"
|
| SERVER_ADDR | "127.0.0.1"
|
| SERVER_PORT | "80"
|
| REMOTE_ADDR | "216.73.216.9"
|
| DOCUMENT_ROOT | "/home/deploy/EHungry-2-joel/Web"
|
| REQUEST_SCHEME | "http"
|
| CONTEXT_PREFIX | "" |
| CONTEXT_DOCUMENT_ROOT | "/home/deploy/EHungry-2-joel/Web"
|
| SERVER_ADMIN | "root@localhost"
|
| SCRIPT_FILENAME | "/home/deploy/EHungry-2-joel/Web/index.php"
|
| REMOTE_PORT | "46120"
|
| GATEWAY_INTERFACE | "CGI/1.1"
|
| SERVER_PROTOCOL | "HTTP/1.0"
|
| REQUEST_METHOD | "GET"
|
| QUERY_STRING | "aid=restaurants/new-york/farmingdale"
|
| REQUEST_URI | "/restaurants/new-york/farmingdale"
|
| SCRIPT_NAME | "/restaurants/new-york/farmingdale"
|
| PHP_SELF | "/restaurants/new-york/farmingdale"
|
| REQUEST_TIME_FLOAT | 1768267032.586
|
| REQUEST_TIME | 1768267032
|
empty
0. Whoops\Handler\PrettyPageHandler