/var/www/vsepansionati.com/themes/platform/modules/listings/views/search/FilterBlock.php
$this->categoryId = 0;
$this->categoryType = 0;
}
if (! empty($catData['title_filter'])) {
$catData['title'] = $catData['title_filter'];
}
$this->categoryData = $catData;
$this->categoryDropdown();
$this->categoryTypes();
}
protected function isCheckKeyword()
{
return $this->isGET() || $this->getRequestAction() == 'popstate';
}
public function catByKeyword($keyword)
{
$model = Listings::model();
$catKeyReal = $model->catToReal($keyword, true);
$catData = $model->catDataByFilter(['keyword' => $catKeyReal], $this->catFields);
if (empty($catData) || !$catData['enabled']) {
return [];
}
$this->selectedCategory['id'] = $catData['id'];
$this->selectedCategory['level'] = $catData['numlevel'];
# replace part of the data of a real category with data from a virtual category
if ($keyword != $catKeyReal) {
$catDataVirtual = $model->catDataByFilter(['keyword' => $keyword], $this->catFieldsVirtual);
# other than the id/numlevel of the real category
$this->selectedCategory['id'] = $catDataVirtual['id'];
$this->selectedCategory['level'] = $catDataVirtual['numlevel'];
unset($catDataVirtual['id'], $catDataVirtual['numlevel']);
$catData = array_merge($catData, $catDataVirtual);
}
# Generating category image URLs
$icon = Listings::categoryIcon(0);
foreach ([$icon::BIG, $icon::SMALL] as $size) {
/var/www/vsepansionati.com/themes/platform/modules/listings/views/search/FilterBlock.php
* Forming data about the current category of ads in the filter
* @param int|null $categoryId
* @return void
*/
public function initCategory($categoryId = null)
{
if (! is_null($categoryId)) {
$this->categoryId = $categoryId;
$this->categoryData = [];
}
if (! empty($this->categoryData)) {
return;
}
$this->selectedCategory = ['id' => 0, 'level' => -1];
$catData = [];
if ($this->isCheckKeyword() && ! $this->categoryId) {
if (! empty($this->categoryKeyword)) {
$catData = $this->catByKeyword($this->categoryKeyword);
if (empty($catData['id'])) {
return;
}
$this->categoryId = $catData['id']; # Real Category ID
}
} else {
$this->selectedCategory['id'] = $this->categoryId;
$catData = Listings::model()->catData($this->categoryId, $this->catFields);
if (empty($catData) || !$catData['enabled']) {
$this->selectedCategory['id'] = 0;
}
}
if (! $this->selectedCategory['id']) {
$catData = Listings::model()->catData(Listings::CATS_ROOTID, $this->catFields);
$this->categoryId = 0;
$this->categoryType = 0;
}
if (! empty($catData['title_filter'])) {
$catData['title'] = $catData['title_filter'];
}
/var/www/vsepansionati.com/themes/platform/modules/listings/views/search/RealtyFilterBlock.php
$block->setTemplate('search/sort.mobile.block', 'listings');
});
}
/**
* @return RealtyPropsBlock|Block|null
*/
public function propsBlock()
{
return $this->getBlock('propsBlock');
}
public function initCategory($categoryId = null)
{
if (is_null($categoryId) && ! empty($this->categoriesMulti)) {
$this->applyCategoriesMulti();
}
if (empty($this->categoryData)) {
parent::initCategory($categoryId);
}
if (! $this->categoryId) {
$this->initCategoryDefault();
}
if (! empty($this->categoryData)) {
$this->categoryData['link'] = $this->catLink($this->categoryData);
if (! empty($this->categoryData['title_filter'])) {
$this->categoryData['title'] = $this->categoryData['title_filter'];
}
}
if ($this->categoryData['id'] ?? 0) {
$this->categoriesSelector();
}
}
protected function initCategoryDefault()
{
/var/www/vsepansionati.com/themes/platform/modules/listings/views/search/FilterBlock.php
/** @var array Sort types */
public $sortTypes;
/** @var array */
public $listViews;
/** @var array List of currencies */
public $listCurrencies;
/** @var bool List ajax mode */
public $ajax = false;
public function init()
{
parent::init();
$this->setTemplate('search/filter', 'listings');
$this->setTitle(_t('@listings', 'Filter'));
$this->addWrapper('search/filter.wrapper', 'listings', ['wrapperKey' => 'mobile']);
$this->initRequestMap();
$this->fillFilters();
$this->initCategory();
}
protected function initRequestMap()
{
$this->requestMap = [
'categoryId' => ['key' => 'c', 'type' => TYPE_UINT],
'categoryType' => ['key' => 'ct', 'type' => TYPE_UINT],
'categoryDynprops' => ['key' => 'd', 'type' => TYPE_ARRAY],
'categoryDynpropsChildren' => ['key' => 'dc', 'type' => TYPE_ARRAY],
'listView' => ['key' => 'lt', 'type' => TYPE_NOTAGS],
'currency' => ['key' => 'cur', 'type' => TYPE_UINT],
'sortBy' => ['key' => 'sort', 'type' => TYPE_NOTAGS],
'page' => ['key' => 'page', 'type' => TYPE_UINT],
'query' => ['key' => 'q', 'type' => TYPE_TEXT],
'regionDistrict' => ['key' => 'rd', 'type' => TYPE_ARRAY_UINT],
'regionMetro' => ['key' => 'rm', 'type' => TYPE_ARRAY_UINT],
'photosOnly' => ['key' => 'ph', 'type' => TYPE_BOOL],
'ownerType' => ['key' => 'ow', 'type' => TYPE_ARRAY_UINT],
'countOnly' => ['key' => 'cnt', 'type' => TYPE_BOOL],
'fixedListActive' => ['key' => 'fa', 'type' => TYPE_BOOL],
/var/www/vsepansionati.com/themes/platform/modules/listings/views/search/RealtyFilterBlock.php
use modules\listings\views\contracts\CategoryPage as CategoryPageContract;
class RealtyFilterBlock extends FilterBlock
{
public const MORE_EXPAND_COOKIE_KEY = 'more_expand';
public $shortMode = false;
public $shortShowOnMap = false;
public $moreExpand = 1;
/** @var int[] categories ID */
public $categoriesMulti;
/** @var array */
protected $categoriesSelectorFields = [];
public function init()
{
$this->setKey('filter');
$this->ajax = true;
parent::init();
}
protected function initRequestMap()
{
parent::initRequestMap();
$this->requestMap['categoriesMulti'] = ['key' => 'cm', 'type' => TYPE_ARRAY_UINT];
$this->categoriesSelectorFields = [
'id', 'pid', 'numlevel', 'numleft', 'numright', 'title', 'title_filter',
'keyword', 'landing_url', 'settings', 'subs_filter_title', 'virtual_ptr',
];
}
public function blocks()
{
parent::blocks();
$this->addBlock('categoryBlock', Block::class);
$this->addBlock('propsBlock', RealtyPropsBlock::class);
/var/www/vsepansionati.com/plugins/booking_p00db2f/views/search/FilterBlock.php
use js;
use func;
use config;
use Booking;
use Listings;
use bff\view\Block;
use modules\geo\views\FilterBlock as GeoFilterBlock;
use modules\listings\views\search\RealtyFilterBlock;
use modules\listings\views\search\FilterBlock AS PlatformFilterBlock;
class FilterBlock extends RealtyFilterBlock
{
/** @var int */
public $bookingFrom;
/** @var int */
public $bookingTo;
public function init()
{
parent::init();
$this->addWrapper(function ($content, $data) {
if (! $this->isBookingMode()) {
return $content;
}
$data['content'] = $content;
$data['selected'] = $this->bookingFrom && $this->bookingTo;
return Booking::template('search/filter.wrapper', $data);
});
$this->app->hooks()->onBlockData(GeoFilterBlock::class, function ($block, $params) {
if (! $this->isBookingMode()) {
return;
}
$params['data']['titleAll'] = Booking::lang('Where?');
});
}
public function blocks()
/var/www/vsepansionati.com/bff/view/Block.php
if ($property->isPublic() && !($property->getDeclaringClass()->getShortName() === 'Component')) {
$this->fillable[] = $property->getName();
} else {
$this->protected[] = $property->getName();
}
}
# Set parent before init
if (is_array($settings) && array_key_exists('parent', $settings)) {
$this->setParent($settings['parent']);
unset($settings['parent']);
}
$this->setSettings($settings);
if (! $this->language) {
$this->language = Lang::current();
}
$this->init();
$this->blocks();
$this->app->hook('view.block.init', $this);
}
/**
* Set block template
* @param string|callable $template
* @param Module|string|null $controller
* @return static
*/
public function setTemplate($template, $controller = null)
{
/** Extract controller from template names like 'controller::template' */
if (is_string($template) && strpos(trim($template), $this->view::HINT_DELIMITER) > 0) {
$segments = explode($this->view::HINT_DELIMITER, $template);
if (count($segments) === 2) {
[$controller, $template] = $segments;
}
/var/www/vsepansionati.com/bff/vendor/illuminate/container/Container.php
return new $concrete;
}
$dependencies = $constructor->getParameters();
// Once we have all the constructor's parameters we can create each of the
// dependency instances and then use the reflection instances to make a
// new instance of this class, injecting the created dependencies in.
try {
$instances = $this->resolveDependencies($dependencies);
} catch (BindingResolutionException $e) {
array_pop($this->buildStack);
throw $e;
}
array_pop($this->buildStack);
return $reflector->newInstanceArgs($instances);
}
/**
* Resolve all of the dependencies from the ReflectionParameters.
*
* @param \ReflectionParameter[] $dependencies
* @return array
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
*/
protected function resolveDependencies(array $dependencies)
{
$results = [];
foreach ($dependencies as $dependency) {
// If the dependency has an override for this particular build we will use
// that instead as the value. Otherwise, we will continue with this run
// of resolutions and let reflection attempt to determine the result.
if ($this->hasParameterOverride($dependency)) {
$results[] = $this->getParameterOverride($dependency);
/var/www/vsepansionati.com/bff/vendor/illuminate/container/Container.php
$needsContextualBuild = ! empty($parameters) || ! is_null($concrete);
// If an instance of the type is currently being managed as a singleton we'll
// just return an existing instance instead of instantiating new instances
// so the developer can keep using the same objects instance every time.
if (isset($this->instances[$abstract]) && ! $needsContextualBuild) {
return $this->instances[$abstract];
}
$this->with[] = $parameters;
if (is_null($concrete)) {
$concrete = $this->getConcrete($abstract);
}
// We're ready to instantiate an instance of the concrete type registered for
// the binding. This will instantiate the types, as well as resolve any of
// its "nested" dependencies recursively until all have gotten resolved.
if ($this->isBuildable($concrete, $abstract)) {
$object = $this->build($concrete);
} else {
$object = $this->make($concrete);
}
// If we defined any extenders for this type, we'll need to spin through them
// and apply them to the object being built. This allows for the extension
// of services, such as changing configuration or decorating the object.
foreach ($this->getExtenders($abstract) as $extender) {
$object = $extender($object, $this);
}
// If the requested type is registered as a singleton we'll want to cache off
// the instances in "memory" so we can return it later without creating an
// entirely new instance of an object on each subsequent request for it.
if ($this->isShared($abstract) && ! $needsContextualBuild) {
$this->instances[$abstract] = $object;
}
if ($raiseEvents) {
$this->fireResolvingCallbacks($abstract, $object);
/var/www/vsepansionati.com/bff/base/Container.php
<?php
namespace bff\base;
use Illuminate\Container\Container as IlluminateContainer;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Support\Str;
class Container extends IlluminateContainer
{
/**
* {@inheritdoc}
*
* @return mixed
*/
protected function resolve($abstract, $parameters = [], $raiseEvents = true)
{
try {
return parent::resolve($abstract, $parameters, $raiseEvents);
} catch (BindingResolutionException $e) {
/**
* Resolve views contract to default view implementation
*/
if (Str::contains($abstract, 'views\contracts')) {
$abstract = Str::replace('views\contracts', 'views', $abstract);
}
return parent::resolve($abstract, $parameters, $raiseEvents);
}
}
}
/var/www/vsepansionati.com/bff/vendor/illuminate/container/Container.php
$this->rebound($abstract);
}
}
/**
* Get the Closure to be used when building a type.
*
* @param string $abstract
* @param string $concrete
* @return \Closure
*/
protected function getClosure($abstract, $concrete)
{
return function ($container, $parameters = []) use ($abstract, $concrete) {
if ($abstract == $concrete) {
return $container->build($concrete);
}
return $container->resolve(
$concrete, $parameters, $raiseEvents = false
);
};
}
/**
* Determine if the container has a method binding.
*
* @param string $method
* @return bool
*/
public function hasMethodBinding($method)
{
return isset($this->methodBindings[$method]);
}
/**
* Bind a callback to resolve with Container::call.
*
* @param array|string $method
* @param \Closure $callback
/var/www/vsepansionati.com/bff/vendor/illuminate/container/Container.php
{
return $concrete === $abstract || $concrete instanceof Closure;
}
/**
* Instantiate a concrete instance of the given type.
*
* @param \Closure|string $concrete
* @return mixed
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
* @throws \Illuminate\Contracts\Container\CircularDependencyException
*/
public function build($concrete)
{
// If the concrete type is actually a Closure, we will just execute it and
// hand back the results of the functions, which allows functions to be
// used as resolvers for more fine-tuned resolution of these objects.
if ($concrete instanceof Closure) {
return $concrete($this, $this->getLastParameterOverride());
}
try {
$reflector = new ReflectionClass($concrete);
} catch (ReflectionException $e) {
throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
}
// If the type is not instantiable, the developer is attempting to resolve
// an abstract type such as an Interface or Abstract Class and there is
// no binding registered for the abstractions so we need to bail out.
if (! $reflector->isInstantiable()) {
return $this->notInstantiable($concrete);
}
$this->buildStack[] = $concrete;
$constructor = $reflector->getConstructor();
// If there are no constructors, that means there are no dependencies then
/var/www/vsepansionati.com/bff/vendor/illuminate/container/Container.php
$needsContextualBuild = ! empty($parameters) || ! is_null($concrete);
// If an instance of the type is currently being managed as a singleton we'll
// just return an existing instance instead of instantiating new instances
// so the developer can keep using the same objects instance every time.
if (isset($this->instances[$abstract]) && ! $needsContextualBuild) {
return $this->instances[$abstract];
}
$this->with[] = $parameters;
if (is_null($concrete)) {
$concrete = $this->getConcrete($abstract);
}
// We're ready to instantiate an instance of the concrete type registered for
// the binding. This will instantiate the types, as well as resolve any of
// its "nested" dependencies recursively until all have gotten resolved.
if ($this->isBuildable($concrete, $abstract)) {
$object = $this->build($concrete);
} else {
$object = $this->make($concrete);
}
// If we defined any extenders for this type, we'll need to spin through them
// and apply them to the object being built. This allows for the extension
// of services, such as changing configuration or decorating the object.
foreach ($this->getExtenders($abstract) as $extender) {
$object = $extender($object, $this);
}
// If the requested type is registered as a singleton we'll want to cache off
// the instances in "memory" so we can return it later without creating an
// entirely new instance of an object on each subsequent request for it.
if ($this->isShared($abstract) && ! $needsContextualBuild) {
$this->instances[$abstract] = $object;
}
if ($raiseEvents) {
$this->fireResolvingCallbacks($abstract, $object);
/var/www/vsepansionati.com/bff/base/Container.php
<?php
namespace bff\base;
use Illuminate\Container\Container as IlluminateContainer;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Support\Str;
class Container extends IlluminateContainer
{
/**
* {@inheritdoc}
*
* @return mixed
*/
protected function resolve($abstract, $parameters = [], $raiseEvents = true)
{
try {
return parent::resolve($abstract, $parameters, $raiseEvents);
} catch (BindingResolutionException $e) {
/**
* Resolve views contract to default view implementation
*/
if (Str::contains($abstract, 'views\contracts')) {
$abstract = Str::replace('views\contracts', 'views', $abstract);
}
return parent::resolve($abstract, $parameters, $raiseEvents);
}
}
}
/var/www/vsepansionati.com/bff/vendor/illuminate/container/Container.php
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
*/
public function makeWith($abstract, array $parameters = [])
{
return $this->make($abstract, $parameters);
}
/**
* Resolve the given type from the container.
*
* @param string|callable $abstract
* @param array $parameters
* @return mixed
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
*/
public function make($abstract, array $parameters = [])
{
return $this->resolve($abstract, $parameters);
}
/**
* {@inheritdoc}
*
* @return mixed
*/
public function get($id)
{
try {
return $this->resolve($id);
} catch (Exception $e) {
if ($this->has($id) || $e instanceof CircularDependencyException) {
throw $e;
}
throw new EntryNotFoundException($id, $e->getCode(), $e);
}
}
/var/www/vsepansionati.com/modules/listings/base.php
public function init()
{
parent::init();
$this->module_title = _t('listings', 'Listings');
# Dynprops
$this->attachComponent('dynprops', function () {
return $this->dp();
});
# ItemServices
Svc::registerServiceManager(ItemServices::KEY, ItemServices::class);
}
public function searchFilterBlock(array $settings = []): SearchFilterBlock
{
$this->app->singletonIf('listings.search.filter.block', function () use ($settings) {
return $this->app->make(SearchFilterBlock::class, [
'settings' => $settings,
]);
});
return bff('listings.search.filter.block');
}
public function onNewRequest($request)
{
parent::onNewRequest($request);
$this->cache = [];
}
/**
* Module system settings
* @param array $options @ref
* @return string
*/
public function settingsSystem(array &$options = []): string
{
/var/www/vsepansionati.com/bff/vendor/illuminate/container/Container.php
{
return $concrete === $abstract || $concrete instanceof Closure;
}
/**
* Instantiate a concrete instance of the given type.
*
* @param \Closure|string $concrete
* @return mixed
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
* @throws \Illuminate\Contracts\Container\CircularDependencyException
*/
public function build($concrete)
{
// If the concrete type is actually a Closure, we will just execute it and
// hand back the results of the functions, which allows functions to be
// used as resolvers for more fine-tuned resolution of these objects.
if ($concrete instanceof Closure) {
return $concrete($this, $this->getLastParameterOverride());
}
try {
$reflector = new ReflectionClass($concrete);
} catch (ReflectionException $e) {
throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
}
// If the type is not instantiable, the developer is attempting to resolve
// an abstract type such as an Interface or Abstract Class and there is
// no binding registered for the abstractions so we need to bail out.
if (! $reflector->isInstantiable()) {
return $this->notInstantiable($concrete);
}
$this->buildStack[] = $concrete;
$constructor = $reflector->getConstructor();
// If there are no constructors, that means there are no dependencies then
/var/www/vsepansionati.com/bff/vendor/illuminate/container/Container.php
$needsContextualBuild = ! empty($parameters) || ! is_null($concrete);
// If an instance of the type is currently being managed as a singleton we'll
// just return an existing instance instead of instantiating new instances
// so the developer can keep using the same objects instance every time.
if (isset($this->instances[$abstract]) && ! $needsContextualBuild) {
return $this->instances[$abstract];
}
$this->with[] = $parameters;
if (is_null($concrete)) {
$concrete = $this->getConcrete($abstract);
}
// We're ready to instantiate an instance of the concrete type registered for
// the binding. This will instantiate the types, as well as resolve any of
// its "nested" dependencies recursively until all have gotten resolved.
if ($this->isBuildable($concrete, $abstract)) {
$object = $this->build($concrete);
} else {
$object = $this->make($concrete);
}
// If we defined any extenders for this type, we'll need to spin through them
// and apply them to the object being built. This allows for the extension
// of services, such as changing configuration or decorating the object.
foreach ($this->getExtenders($abstract) as $extender) {
$object = $extender($object, $this);
}
// If the requested type is registered as a singleton we'll want to cache off
// the instances in "memory" so we can return it later without creating an
// entirely new instance of an object on each subsequent request for it.
if ($this->isShared($abstract) && ! $needsContextualBuild) {
$this->instances[$abstract] = $object;
}
if ($raiseEvents) {
$this->fireResolvingCallbacks($abstract, $object);
/var/www/vsepansionati.com/bff/base/Container.php
<?php
namespace bff\base;
use Illuminate\Container\Container as IlluminateContainer;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Support\Str;
class Container extends IlluminateContainer
{
/**
* {@inheritdoc}
*
* @return mixed
*/
protected function resolve($abstract, $parameters = [], $raiseEvents = true)
{
try {
return parent::resolve($abstract, $parameters, $raiseEvents);
} catch (BindingResolutionException $e) {
/**
* Resolve views contract to default view implementation
*/
if (Str::contains($abstract, 'views\contracts')) {
$abstract = Str::replace('views\contracts', 'views', $abstract);
}
return parent::resolve($abstract, $parameters, $raiseEvents);
}
}
}
/var/www/vsepansionati.com/bff/vendor/illuminate/container/Container.php
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
*/
public function makeWith($abstract, array $parameters = [])
{
return $this->make($abstract, $parameters);
}
/**
* Resolve the given type from the container.
*
* @param string|callable $abstract
* @param array $parameters
* @return mixed
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
*/
public function make($abstract, array $parameters = [])
{
return $this->resolve($abstract, $parameters);
}
/**
* {@inheritdoc}
*
* @return mixed
*/
public function get($id)
{
try {
return $this->resolve($id);
} catch (Exception $e) {
if ($this->has($id) || $e instanceof CircularDependencyException) {
throw $e;
}
throw new EntryNotFoundException($id, $e->getCode(), $e);
}
}
/var/www/vsepansionati.com/bff/helpers.php
define('TYPE_CONVERT_KEYS', 200); # value to subtract from array => keys types to convert to single types
# Extensions types
define('EXTENSION_TYPE_PLUGIN', 1);
define('EXTENSION_TYPE_THEME', 2);
define('EXTENSION_TYPE_MODULE', 3);
/**
* Get the available container instance.
* @param string|null $abstract
* @param array $parameters
* @return mixed|\Application
*/
function bff($abstract = null, array $parameters = [])
{
if (is_null($abstract)) {
return bff::i();
}
return bff::i()->make($abstract, $parameters);
}
/**
* File customization
* @param string $filePath full file path
* @param bool $customAllow allow customized file version: /custom/file
* @return string customized file path
*/
function modification(string $filePath, bool $customAllow = true): string
{
# Custom
static $customDir;
if (!isset($customDir)) {
$customDir = PATH_BASE . 'custom' . DIRECTORY_SEPARATOR;
if (!is_dir($customDir)) {
$customDir = false;
}
}
if ($customAllow && $customDir !== false) {
# Custom
/var/www/vsepansionati.com/modules/listings/base.php
$this->module_title = _t('listings', 'Listings');
# Dynprops
$this->attachComponent('dynprops', function () {
return $this->dp();
});
# ItemServices
Svc::registerServiceManager(ItemServices::KEY, ItemServices::class);
}
public function searchFilterBlock(array $settings = []): SearchFilterBlock
{
$this->app->singletonIf('listings.search.filter.block', function () use ($settings) {
return $this->app->make(SearchFilterBlock::class, [
'settings' => $settings,
]);
});
return bff('listings.search.filter.block');
}
public function onNewRequest($request)
{
parent::onNewRequest($request);
$this->cache = [];
}
/**
* Module system settings
* @param array $options @ref
* @return string
*/
public function settingsSystem(array &$options = []): string
{
return $this->template('admin/settings.sys', ['options' => &$options]);
}
/**
/var/www/vsepansionati.com/bff/vendor/illuminate/support/Facades/Facade.php
}
/**
* Handle dynamic, static calls to the object.
*
* @param string $method
* @param array $args
* @return mixed
*
* @throws \RuntimeException
*/
public static function __callStatic($method, $args)
{
$instance = static::getFacadeRoot();
if (! $instance) {
throw new RuntimeException('A facade root has not been set.');
}
return $instance->$method(...$args);
}
}
/var/www/vsepansionati.com/themes/platform/modules/listings/views/SearchPage.php
}
$this->app->hooks()->onBlockData(GeoFilterBlock::class, function ($block, $params) {
/** @var GeoFilterBlock $block */
$block->jsData(['ajax' => false]);
}, 7);
}
/**
* Handle request and route to page
* @param string $category
* @return mixed
*/
public static function handleRoute($category = '')
{
$category = trim($category, ' /\\');
$categoryRootId = Listings::CATS_ROOTID;
$filter = Listings::searchFilterBlock([
'categoryKeyword' => $category,
'categoryId' => ($category === '' ? $categoryRootId : null),
]);
# Unknown category keyword
if ($category && ! $filter->categoryId) {
return Errors::error404();
}
if (
Request::isGET() &&
$filter->categoryId &&
$filter->categoryData['numlevel'] == 1 &&
$filter->categoryData['settings']['subcats_view'] &&
! $filter->anyGetFilters
) {
return bff(contracts\CategoryPage::class, ['settings' => ['filter' => $filter]]);
}
if ($filter->categoryId && $filter->categoryId !== $categoryRootId) {
return bff(contracts\SearchCategoryPage::class, ['settings' => ['filter' => $filter]]);
/var/www/vsepansionati.com/modules/listings/routes.php
} elseif ($useViewCategory) {
if (empty($p['landing_url'])) {
$cat = !empty($p['category']) ? '/' . $p['category'] : '';
} else {
$cat = $p['landing_url'];
}
}
$url = $geo . $cat;
if ($url) {
$url = rtrim($url, '/');
}
return $url . '/' . $p['keyword'] . '-' . (!empty($p['id']) ? $p['id'] : '{item-id}') . '.html';
},
'priority' => 101,
],
# item search
'listings-items.search' => [
'pattern' => $prefix . '{/keyword/?}',
'callback' => function ($category = '') {
return modules\listings\views\SearchPage::handleRoute($category);
},
'page' => [SearchPage::class, SearchCategoryPage::class, CategoryPage::class],
'url' => function ($p, $o) use ($prefix) {
# form link based on the specified area (region), [city (city)]
# or taking into account the current filter settings by region
if (empty($p['landing_url'])) {
$url = Geo::url($p, $o['dynamic']) .
(empty($p['skip_prefix']) ? $prefix . '/' : '') .
(!empty($p['keyword']) ? $p['keyword'] . '/' : '');
} else {
$url = Geo::url($p, $o['dynamic'], false) . $p['landing_url'];
}
if (! empty($p['q'])) {
$url .= Url::query($p, ['landing_url', 'skip_prefix', 'keyword']);
}
return $url;
},
'priority' => 110,
],
# search for items (when changing the formation of URL: host/region/ => host/)
/var/www/vsepansionati.com/bff/base/Route.php
return bff::filter(
'routing.route.run.after.' . $this->getId(),
$this->runAction(),
$this,
$request
);
}
/**
* Run route action
* @return mixed
* @throws \Exception
*/
public function runAction()
{
$params = $this->getParams();
if ($this->controller instanceof Closure) {
return call_user_func_array($this->controller, array_values($params));
}
return bff()->callController(
$this->getControllerName(),
$this->getControllerMethod(),
$params,
[
'inject' => ! bff()->cron(),
'direct' => $this->isDirect(),
]
);
}
/**
* Parse action to get controller
* @return void
*/
protected function parseAction()
{
$callable = $this->action;
/var/www/vsepansionati.com/bff/base/Route.php
return bff::filter(
'routing.route.run.after.' . $this->getId(),
$this->runAction(),
$this,
$request
);
}
/**
* Run route action
* @return mixed
* @throws \Exception
*/
public function runAction()
{
$params = $this->getParams();
if ($this->controller instanceof Closure) {
return call_user_func_array($this->controller, array_values($params));
}
return bff()->callController(
$this->getControllerName(),
$this->getControllerMethod(),
$params,
[
'inject' => ! bff()->cron(),
'direct' => $this->isDirect(),
]
);
}
/**
* Parse action to get controller
* @return void
*/
protected function parseAction()
{
$callable = $this->action;
/var/www/vsepansionati.com/bff/base/Route.php
return false;
}
/**
* Run route
* @param \bff\http\Request $request
* @return \bff\http\Response|mixed
*/
public function run(Request $request)
{
bff::hook(
'routing.route.run.before.' . $this->getId(),
$this,
$request
);
return bff::filter(
'routing.route.run.after.' . $this->getId(),
$this->runAction(),
$this,
$request
);
}
/**
* Run route action
* @return mixed
* @throws \Exception
*/
public function runAction()
{
$params = $this->getParams();
if ($this->controller instanceof Closure) {
return call_user_func_array($this->controller, array_values($params));
}
return bff()->callController(
$this->getControllerName(),
/var/www/vsepansionati.com/bff/base/Router.php
}
}
if ($controller && $action) {
return $this->get(static::DIRECT_ROUTE, '', $controller . '/' . $action . '/');
}
return null;
}
/**
* Gather route middleware
* @param \bff\http\Request $request
* @param \bff\base\Route $route
* @return \bff\http\Response|mixed
*/
public function runRoute(Request $request, Route $route)
{
try {
# Run
$response = $route->run($request);
if ($response instanceof Block) {
$response = $response->render();
}
} catch (ResponseException $e) {
# Special type of exception in cases where unable to implement proper "return Response"
return $e->getResponse();
} catch (ModelRecordNotFoundException $e) {
if (Errors::no()) {
Errors::unknownRecord();
}
if ($request->isAJAX()) {
return Response::json(['data' => [], 'errors' => Errors::get()]);
}
} catch (NotFoundException $e) {
return Response::notFound($e->getResponse());
} catch (Throwable $e) {
if (! bff()->isDebug()) {
Errors::logException($e);
return Errors::error404();
}
/var/www/vsepansionati.com/bff/base/Application.php
if (is_string($middleware) && array_key_exists($middleware, $this->middlewareGroups)) {
foreach ($this->middlewareGroups[$middleware] as $key => $value) {
if (is_string($key)) {
$stack[$key] = $value;
} else {
$stack[] = $value;
}
}
} else {
$stack[] = $middleware;
}
}
if ($this->adminPanel()) {
# Admin
$stack[] = ['callback' => \bff\middleware\AdminPanel::class, 'priority' => 100];
} else {
# Frontend ...
$stack[] = ['callback' => function (Request $request, $next) use ($route) {
# Run
$response = $this->router()->runRoute($request, $route);
# Html + Layout
if (is_string($response)) {
return $this->view()->layoutResponse([
'centerblock' => $this->view()->vueRender(
$this->tags()->process($response)
),
]);
}
# Other response types
return Response::responsify($response);
}, 'priority' => 100];
}
} else {
if ($this->adminPanel()) {
# Admin
$stack[] = ['callback' => \bff\middleware\StartSession::class, 'priority' => 50];
$stack[] = ['callback' => \bff\middleware\AdminPanel::class, 'priority' => 100];
} else {
# Not found: Frontend ...
$stack[] = function () {
/var/www/vsepansionati.com/bff/vendor/illuminate/pipeline/Pipeline.php
return $this->handleException($passable, $e);
}
};
}
/**
* Get a Closure that represents a slice of the application onion.
*
* @return \Closure
*/
protected function carry()
{
return function ($stack, $pipe) {
return function ($passable) use ($stack, $pipe) {
try {
if (is_callable($pipe)) {
// If the pipe is a callable, then we will call it directly, but otherwise we
// will resolve the pipes out of the dependency container and call it with
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
/var/www/vsepansionati.com/bff/middleware/StartSession.php
/**
* Handle the given request within session state.
*
* @param \bff\http\Request $request
* @param \Illuminate\Contracts\Session\Session $session
* @param \Closure $next
* @return mixed
*/
protected function handleStatefulRequest(Request $request, $session, Closure $next)
{
// If a session driver has been configured, we will need to start the session here
// so that the data is ready for an application. Note that the Laravel sessions
// do not make use of PHP "native" sessions in any way since they are crappy.
$request->setSession(
$this->startSession($request, $session)
);
$this->collectGarbage($session);
$response = $next($request);
$this->storeCurrentUrl($request, $session);
if ($this->isSecureRequest($request, $session)) {
$response = $this->addCookieToResponse($response, $session);
// Again, if the session has been configured we will need to close out the session
// so that the attributes may be persisted to some storage medium. We will also
// add the session identifier cookie to the application response headers now.
$this->saveSession($request);
}
return $response;
}
/**
* Start the session for the given request.
*
* @param \bff\http\Request $request
* @param \Illuminate\Contracts\Session\Session $session
/var/www/vsepansionati.com/bff/middleware/StartSession.php
*/
public function handle($request, Closure $next)
{
if (! $this->sessionConfigured()) {
return $next($request);
}
# No session for robots
if ($request->isRobot()) {
config::temp('session.driver', 'array');
}
$session = $this->getSession($request);
if (
$this->manager->shouldBlock() ||
($request->route() instanceof Route && $request->route()->locksFor())
) {
return $this->handleRequestWhileBlocking($request, $session, $next);
} else {
return $this->handleStatefulRequest($request, $session, $next);
}
}
/**
* Handle the given request within session state.
*
* @param \bff\http\Request $request
* @param \Illuminate\Contracts\Session\Session $session
* @param \Closure $next
* @return mixed
*/
protected function handleRequestWhileBlocking(Request $request, $session, Closure $next)
{
if (! $request->route() instanceof Route) {
return;
}
$lockFor = $request->route() && $request->route()->locksFor()
? $request->route()->locksFor()
: 10;
/var/www/vsepansionati.com/bff/vendor/illuminate/pipeline/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
/var/www/vsepansionati.com/bff/middleware/UserLastActivity.php
use User;
use Users;
use bff\http\Request;
/**
* Marking the user's last activity
* @copyright Tamaranga
*/
class UserLastActivity
{
public function __invoke(Request $request, $next)
{
if (User::logined()) {
$userID = User::id();
# Update last activity
Users::updateUserLastActivity($userID);
}
return $next($request);
}
}
/var/www/vsepansionati.com/bff/vendor/illuminate/pipeline/Pipeline.php
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
/var/www/vsepansionati.com/bff/middleware/LoginAuto.php
$userData = Users::model()->userData($userID, ['user_id', 'user_id_ex', 'last_login']);
if (empty($userData)) {
break;
}
if (Users::model()->userIsAdministrator($userID)) {
break;
}
if ($hashFull !== Users::loginAutoHash($userData)) {
break;
}
if (Users::i()->authById($userID) === true) {
break;
}
return Redirect::route('users-login', [
'ref' => $request->url(true),
]);
} while (false);
return $next($request);
}
}
/var/www/vsepansionati.com/bff/vendor/illuminate/pipeline/Pipeline.php
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
/var/www/vsepansionati.com/bff/middleware/Offline.php
<?php //ICB0 71:0 81:146c ?><?php //00091
// Copyright Tamaranga. 2014-2022
// All Rights Reserved
echo('No IonCube Loader is installed. Please contact support.');exit(199);
?>
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
/var/www/vsepansionati.com/bff/vendor/illuminate/pipeline/Pipeline.php
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
/var/www/vsepansionati.com/app/middleware/SubdomainsValidation.php
break;
}
if (preg_match('/(.*)\.' . preg_quote(SITEHOST) . '/', $host, $matches) <= 0) {
break;
}
if (empty($matches[1])) {
break;
}
if (Geo::urlType() !== Geo::URL_SUBDOMAIN) {
return Errors::error404();
};
$region = Geo::regionDataByKeyword($matches[1]);
if (empty($region)) {
# Could not find region by keyword
return Errors::error404();
}
} while (false);
return $next($request);
}
}
/var/www/vsepansionati.com/bff/vendor/illuminate/pipeline/Pipeline.php
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
/var/www/vsepansionati.com/bff/middleware/Cors.php
* @param mixed $next
* @return ResponseInterface
*/
public function __invoke(RequestInterface $request, $next)
{
return $this->handle($request, $next);
}
/**
* Handle request
* @param RequestInterface $request
* @param mixed $next
* @return ResponseInterface
*/
public function handle(RequestInterface $request, $next)
{
# Skip requests without Origin header
if (! $request->hasHeader('Origin')) {
# Not an access control request
return $next($request);
}
# Preflight Request
if ($this->isPreflightRequest($request)) {
return $this->setCorsHeaders($request, ResponseFactory::empty(), true);
}
# Strict request validation
if ($this->strict() && ! $this->isAllowedRequest($request)) {
return ResponseFactory::createResponse(403, $this->options['forbidden_message'] ?? '');
}
return $this->setCorsHeaders($request, $next($request));
}
/**
* Is preflight request
* @param RequestInterface $request
* @return bool
*/
/var/www/vsepansionati.com/bff/vendor/illuminate/pipeline/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
/var/www/vsepansionati.com/bff/middleware/FrameGuard.php
<?php
namespace bff\middleware;
use Security;
use bff\http\Request;
/**
* X-Frame-Options
* @copyright Tamaranga
*/
class FrameGuard
{
public function __invoke(Request $request, $next)
{
if (! $request->isPOST()) {
Security::setIframeOptions();
}
return $next($request);
}
}
/var/www/vsepansionati.com/bff/vendor/illuminate/pipeline/Pipeline.php
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
/var/www/vsepansionati.com/bff/middleware/TrustedProxies.php
namespace bff\middleware;
use Cache;
use config;
use bff\http\Request;
/**
* Allowed proxies
* @copyright Tamaranga
*/
class TrustedProxies
{
public function __invoke(Request $request, $next)
{
$request->setTrustedProxies([]); // reset state between requests
$trusted = config::get('request.trusted.proxies');
if (is_null($trusted) || $trusted === '') {
return $next($request);
}
if (is_string($trusted)) {
if ($trusted === '*') {
$trusted = [
$request->remoteAddress(false, false) // current IP
];
} else {
$trusted = array_map('trim', explode(',', $trusted));
}
}
if (is_array($trusted)) {
$request->setTrustedProxies(
$this->mixinCloudFlareIps($trusted)
);
}
return $next($request);
}
/var/www/vsepansionati.com/bff/vendor/illuminate/pipeline/Pipeline.php
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
if (is_string($parameters)) {
/var/www/vsepansionati.com/bff/vendor/illuminate/pipeline/Pipeline.php
public function via($method)
{
$this->method = $method;
return $this;
}
/**
* Run the pipeline with a final destination callback.
*
* @param \Closure $destination
* @return mixed
*/
public function then(Closure $destination)
{
$pipeline = array_reduce(
array_reverse($this->pipes()), $this->carry(), $this->prepareDestination($destination)
);
return $pipeline($this->passable);
}
/**
* Run the pipeline and return the result.
*
* @return mixed
*/
public function thenReturn()
{
return $this->then(function ($passable) {
return $passable;
});
}
/**
* Get the final piece of the Closure onion.
*
* @param \Closure $destination
* @return \Closure
*/
/var/www/vsepansionati.com/bff/base/Application.php
}
return $result;
}
/**
* Run middleware stack
* @param array $pipes
* @param mixed $passable
* @param Closure|null $destination
* @return mixed|\bff\http\Response
*/
public function middlewareRun(array $pipes, $passable, ?Closure $destination = null)
{
return (new Pipeline($this))
->send($passable)
->through($pipes)
->then($destination ?? function ($passable) {
return $passable;
});
}
/**
* @param string $method
* @param array $parameters
* @return mixed
*/
public function __call($method, $parameters)
{
# Call macro method
if (static::hasMacro($method)) {
return $this->callMacro($method, $parameters);
}
return null;
}
/**
* Handle dynamic static method calls into the method.
* @param string $method
/var/www/vsepansionati.com/bff/base/Application.php
'dynamic' => true,
]);
}
} catch (Throwable $e) {
$route = null;
}
# Handle route
if ($route) {
# Controller/action fallback
bff::$class = $route->getControllerName();
bff::$event = $route->getControllerMethod();
# Set request route
$request->setRouteResolver(function () use ($route) {
return $route;
});
}
# Call middleware stack
$response = $this->middlewareRun($this->finalizeMiddleware(
$this->filter('app.middleware', $this->middlewares),
$route
), $request);
# Fix http protocol mismatch
if ($response->getProtocolVersion() !== ($requestProtocol = $request->getProtocolVersion())) {
if ($requestProtocol === '2.0') {
$requestProtocol = '2';
}
$response = $response->withProtocolVersion($requestProtocol);
}
# Respond
if ($respond) {
$this->respond($response);
}
return $response;
}
/var/www/vsepansionati.com/public_html/index.php
<?php
require __DIR__ . '/../bff/bootstrap.php';
bff()->run();