/var/www/axl.com.ua/bff/db/Database.php
}
}
}
if (is_null($arg)) {
$query = $this->pdo->query($cmd);
} else {
$query = $this->pdo->prepare($cmd, $prepareOptions);
if (is_object($query)) {
foreach ($arg as $key => $value) {
if (
!(is_array($value) ?
$query->bindValue($key, $value[0], $value[1]) :
$query->bindValue($key, $value, $this->type($value))
)
) {
break;
}
}
$query->execute();
}
}
# Проверяем SQLSTATE
if (!$this->errorCheck($query, ['query' => $cmd, 'bind' => $arg])) {
if ($this->tag !== false) {
$this->tag = false;
}
return false;
}
if ($fetchType !== false || preg_match('/^\s*(?:SELECT|PRAGMA|SHOW|EXPLAIN)\s/i', $cmd)) {
if ($fetchFunc !== false) {
$this->result = $query->$fetchFunc($fetchType);
$this->rows = $query->rowCount();
$query = null;
} else {
$this->result = $query;
}
} else {
$this->rows = $this->result = $query->rowCount();
/var/www/axl.com.ua/bff/db/Database.php
}
}
}
if (is_null($arg)) {
$query = $this->pdo->query($cmd);
} else {
$query = $this->pdo->prepare($cmd, $prepareOptions);
if (is_object($query)) {
foreach ($arg as $key => $value) {
if (
!(is_array($value) ?
$query->bindValue($key, $value[0], $value[1]) :
$query->bindValue($key, $value, $this->type($value))
)
) {
break;
}
}
$query->execute();
}
}
# Проверяем SQLSTATE
if (!$this->errorCheck($query, ['query' => $cmd, 'bind' => $arg])) {
if ($this->tag !== false) {
$this->tag = false;
}
return false;
}
if ($fetchType !== false || preg_match('/^\s*(?:SELECT|PRAGMA|SHOW|EXPLAIN)\s/i', $cmd)) {
if ($fetchFunc !== false) {
$this->result = $query->$fetchFunc($fetchType);
$this->rows = $query->rowCount();
$query = null;
} else {
$this->result = $query;
}
} else {
$this->rows = $this->result = $query->rowCount();
/var/www/axl.com.ua/bff/db/Database.php
if ($returnID !== false) {
if ($this->isPgSQL()) {
# RETURNING expression (pgsql)
if (is_string($returnID)) {
$query .= ' RETURNING ' . $this->wrapColumn($returnID);
list($fetchType, $fetchFunc) = [0, 'fetchColumn']; // one_data
} elseif (is_array($returnID)) {
$query .= ' RETURNING ' . join(', ', $this->wrapColumn($returnID));
list($fetchType, $fetchFunc) = [PDO::FETCH_ASSOC, 'fetch']; // one_array
}
return $this->exec($query, $bind, 0, $fetchType, $fetchFunc);
} else {
# lastInsertId (mysql, ...)
$this->exec($query, $bind);
return $this->insert_id($table, $returnID);
}
} else {
return $this->exec($query, $bind);
}
}
/**
* Получаем ID последней добавленной записи
* @param string $table название таблицы
* @param string $columnName название поля ID
* @param string $sequencePostfix окончание в названии последовательности(sequence) (tableName_FieldName)
* @return int
*/
public function insert_id($table = '', $columnName = 'id', $sequencePostfix = '_seq')
{
$result = (int)$this->pdo->lastInsertId($table . ($columnName ? '_' . $columnName : '') . $sequencePostfix);
return (empty($result) ? 0 : $result);
}
/**
* Выполняем UPDATE запрос
* @param string $table название таблицы
/var/www/axl.com.ua/modules/listings/model.php
# because today's statistics record may already have been created
$res = $this->db->update(
static::TABLE_ITEMS_VIEWS,
[$field . ' = ' . $field . ' + 1'],
['item_id' => $itemID, 'period' => $date]
);
# update failed
if (empty($res)) {
# 2. start counting statistics for today
if (! empty($viewsToday)) {
$this->db->update(static::TABLE_ITEMS, [
'views_today' => 0,
], ['id' => $itemID]);
}
$res = $this->db->insert(static::TABLE_ITEMS_VIEWS, [
'item_id' => $itemID,
$field => 1,
'period' => $date,
], false);
}
# static::TABLE_ITEMS:
# 3. wind up counter of items views / Contacts for today (+ total)
if (!empty($res)) {
$this->db->update(
static::TABLE_ITEMS,
[
'views_total = views_total + 1',
'views_today = views_today + 1',
'views_' . $viewType . '_total = views_' . $viewType . '_total + 1',
],
['id' => $itemID]
);
}
return !empty($res);
}
/**
/var/www/axl.com.ua/modules/listings/views/ItemPage.php
unset($v);
} else {
$data['image_view'] = $images->urlDefault($images::szView);
}
# Video
$this->item['video'] = Listings::itemVideo()->viewIframe($this->item['video_embed']);
# Dynprops
$data['dynprops'] = Listings::dp()->onView($this->item['cat_id'], $this->item, ['dataOnly' => -1]);
# Is favorite
$data['fav'] = Listings::favorites()->isFavorite($this->itemId, $this->userId);
# Increment views if not:
# - owner
# - redirect from admin panel
# - page refresh
if (!$this->item['owner'] && $this->from != 'adm' && !$this->request->isRefresh()) {
if (Listings::model()->itemViewsIncrement($this->itemId, 'item', $this->item['views_today'])) {
$this->item['views_total']++;
$this->item['views_today']++;
}
}
# Free top up
if ($this->input->get('up_free', TYPE_UINT) == 1 && $this->item['owner']) {
$up = Listings::itemServices('up');
if ($up) {
$msg = $up->upFree($this->itemId);
if ($this->errors->no()) {
$data['msg_success'] = $msg;
} else {
$data['msg_error'] = join('<br />', $this->errors->get());
}
}
}
$data['premoderation'] = Listings::premoderation();
/var/www/axl.com.ua/bff/view/Block.php
continue;
}
# Do not override data keys
if (array_key_exists($key, $this->data)) {
continue;
}
$this->data[$key] = &$this->$key;
}
}
/**
* Gather data before render
* @return void
*/
protected function gatherData()
{
$this->fillSettings();
$this->settingsToData();
$this->data = $this->data();
$this->app->hook('view.block.data', $this, ['data' => & $this->data]);
if (is_array($this->data)) {
$this->blocksIterator(function ($block, $key) {
$this->data[$key] = $block;
});
}
}
/**
* Get block (and sub blocks) data without rendering
* @return array|mixed
*/
public function getData()
{
$this->gatherData();
if (is_array($this->data)) {
foreach ($this->data as $key => $value) {
/var/www/axl.com.ua/bff/view/Block.php
$wrapper['renderOptions'] ?? $this->renderOptions
);
continue;
}
if (is_callable($wrapper['template'])) {
$content = call_user_func($wrapper['template'], $content, $this->data);
}
}
}
return $content;
}
/**
* Render block content
* @return string|mixed
*/
protected function renderContent()
{
$this->gatherData();
# Try to return data
if (! is_array($this->data)) {
if ($this->data instanceof self) {
return $this->data->render();
}
# cancel render
if ($this->beforeRender() === false) {
return '';
}
# string is a render goal
if (is_string($this->data)) {
return $this->data;
}
# throw response
if ($this->data instanceof Response) {
$this->data->throw();
}
if ($this->data instanceof Closure) {
$callback = $this->data;
/var/www/axl.com.ua/bff/view/Page.php
* @return mixed
*/
protected function renderContent()
{
if (! $this->app->adminPanel()) {
$this->loadSettings();
$this->fillSettings();
}
if ($this->isSubmitAction()) {
if ($response = $this->handleActionRequest('submit')) {
return $response;
}
} else {
if ($response = $this->handleActionRequest()) {
return $response;
}
}
return parent::renderContent();
}
/**
* Init before render to fill seo data used in template (titleh1, breadcrumbs ...)
* @return bool|void
*/
protected function beforeRender()
{
if (parent::beforeRender() === false) {
return false;
}
if ($this->skipSeo) {
return;
}
if (is_array($this->data)) {
$this->seoSettings();
$this->seo();
/var/www/axl.com.ua/bff/view/Block.php
return $response;
}
/**
* Before render
* @return bool|void
*/
protected function beforeRender()
{
$this->beforeRenderRotation();
}
/**
* Render block
* @return string|mixed
*/
public function render()
{
$content = $this->renderContent();
if (! is_string($content)) {
return $content;
}
$content = $this->applyWrappers($content);
return $this->app->filter('view.block.render', $content, $this);
}
/**
* Apply content wrappers
* @param string $content
* @return false|mixed|\Psr\Http\Message\ResponseInterface|string
*/
protected function applyWrappers($content)
{
if (! empty($this->wrappers)) {
foreach (array_reverse($this->wrappers) as $wrapper) {
if (empty($wrapper['template'])) {
continue;
/var/www/axl.com.ua/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()) {
return Errors::error404();
}
return Errors::handleException($e);
}
return $response;
/var/www/axl.com.ua/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->tagsProcess($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 () {
return Response::notFound();
};
/var/www/axl.com.ua/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/axl.com.ua/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/axl.com.ua/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/axl.com.ua/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/axl.com.ua/bff/middleware/UserLastActivity.php
use User;
use Users;
use bff\http\Request;
/**
* Помечаем последнюю активность пользователя
* @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/axl.com.ua/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/axl.com.ua/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/axl.com.ua/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/axl.com.ua/bff/middleware/Offline.php
<?php //ICB0 71:0 ?><?php //00091
// Copyright Tamaranga. 2014-2022
// All Rights Reserved
echo('No IonCube Loader is installed. Please contact support.');exit(199);
?>
HR+cPt/aJLkkIBQSkrVOU1rdfgAgCxnBtKCkL+FXxLPYjnPakP6EBey6ztFfT4vsfbbrrYiEcr7Q
u9WqRlIU41n0oVQYQRlMKOpbG2kT66/r0bNurNlIr8naQo1w+UjAtPqzfXW2UMYMZxkjH1o3J/y5
I83NAiPxo0CW413f1fVvlv90LzhmGU+AdpCCQxaNcU3XWp1YN3HuYN6BH+eF/77dHsRmm7Sr/a/z
B7FwfOsmSQHteuN5ShFBL8us/kdHhfvTwBUi8qLntQdUx9dg+5A0yv9mnGspkLbBTpV4PhZpXfE/
VqVu4vgiiOrAkznXba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+GD9yfd6FvVnficm4gcfimqcJbjYQxSS4mFVTkD8AZGbtJwMecz3y9LoFkgqvYmffr
67nvINY8ZvM0qeG9lVe0UM5AJYUVOx9UyqpxTTNFWNsQosO96CtQSFHGv/7SjtInRL6g/PGOV7ih
zUIlD9pPt1u0qvOgObjV6Dkd5KzzHwH02QLrVQEuKLivsqu0D6PPKbHjETpKj1xW/OQ++S7502cR
/var/www/axl.com.ua/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/axl.com.ua/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/axl.com.ua/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/axl.com.ua/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/axl.com.ua/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/axl.com.ua/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/axl.com.ua/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/axl.com.ua/bff/middleware/TrustedProxies.php
namespace bff\middleware;
use Cache;
use config;
use bff\http\Request;
/**
* Разрешенные proxy
* @copyright Tamaranga
*/
class TrustedProxies
{
public function __invoke(Request $request, $next)
{
$request->setTrustedProxies([]); # сбрасываем состояние между запросами
$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) # текущий IP
];
} else {
$trusted = array_map('trim', explode(',', $trusted));
}
}
if (is_array($trusted)) {
$request->setTrustedProxies(
$this->mixinCloudFlareIps($trusted)
);
}
return $next($request);
}
/var/www/axl.com.ua/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/axl.com.ua/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/axl.com.ua/bff/base/Application.php
}
return $result;
}
/**
* Запуск стека middleware
* @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.
/var/www/axl.com.ua/bff/base/Application.php
'seo-redirects' => 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/axl.com.ua/public_html/index.php
<?php
require __DIR__ . '/../bff/bootstrap.php';
bff()->run();