/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
/controllers
/customer.php
}
}
if (isset($_SESSION['_CORDOVA_APP']) && $_SESSION['_CORDOVA_APP'] && strstr($account->getEnabledModules(), (string)APP_MODULE)) {
$_REQUEST['_CORDOVA_APP'] = true;
}
$template_id = isset($_REQUEST['_CORDOVA_APP']) && $_REQUEST['_CORDOVA_APP']? Template::DEFAULT_ID : ($account->template_id?: Template::DEFAULT_ID);
$template = new Template($template_id);
$version = $template->version ?: 3;
if (!apache_note('AppVersion')) {
apache_note('AppVersion', $version);
}
$templateName = $template->getFolderName();
$_REQUEST['_VERSION'] = $version;
$showCart = false;
$_REQUEST['_TEMPLATE_SETTINGS'] = TemplateAccountSetting::getAllForAccountAndTemplate($account->getId(), $template->getId());
$currentOrderingPlatform = OrderTemplatePlatforms::currentOrderingPlatform(isSpringroll());
$activePromotion = $account->activePromotions($currentOrderingPlatform)->first();
if ($activePromotion && $activePromotion->url_tag && $_REQUEST["form"] == $activePromotion->url_tag) {
$_REQUEST["form"] = "promotion";
}
$status = isValidPage($_REQUEST["form"]);
//v4 pages that can can be accessed without logging in
if ($_REQUEST['_VERSION'] == 4) {
define('IS_EDIT', isset($_SESSION['edit_order_id']) && is_numeric($_SESSION['edit_order_id']));
switch ($_REQUEST['form']) {
case 'checkout':
case 'mycoupons':
case 'orderconfirmation':
case 'validatecallback':
case 'redirect':
case 'mercurycomplete':
case 'paypalcomplete':
$status = 1;
/home
/deploy
/EHungry-2-joel
/Web
/controllers
/customer.php
}
}
if (isset($_SESSION['_CORDOVA_APP']) && $_SESSION['_CORDOVA_APP'] && strstr($account->getEnabledModules(), (string)APP_MODULE)) {
$_REQUEST['_CORDOVA_APP'] = true;
}
$template_id = isset($_REQUEST['_CORDOVA_APP']) && $_REQUEST['_CORDOVA_APP']? Template::DEFAULT_ID : ($account->template_id?: Template::DEFAULT_ID);
$template = new Template($template_id);
$version = $template->version ?: 3;
if (!apache_note('AppVersion')) {
apache_note('AppVersion', $version);
}
$templateName = $template->getFolderName();
$_REQUEST['_VERSION'] = $version;
$showCart = false;
$_REQUEST['_TEMPLATE_SETTINGS'] = TemplateAccountSetting::getAllForAccountAndTemplate($account->getId(), $template->getId());
$currentOrderingPlatform = OrderTemplatePlatforms::currentOrderingPlatform(isSpringroll());
$activePromotion = $account->activePromotions($currentOrderingPlatform)->first();
if ($activePromotion && $activePromotion->url_tag && $_REQUEST["form"] == $activePromotion->url_tag) {
$_REQUEST["form"] = "promotion";
}
$status = isValidPage($_REQUEST["form"]);
//v4 pages that can can be accessed without logging in
if ($_REQUEST['_VERSION'] == 4) {
define('IS_EDIT', isset($_SESSION['edit_order_id']) && is_numeric($_SESSION['edit_order_id']));
switch ($_REQUEST['form']) {
case 'checkout':
case 'mycoupons':
case 'orderconfirmation':
case 'validatecallback':
case 'redirect':
case 'mercurycomplete':
case 'paypalcomplete':
$status = 1;
/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");