/var/www/dev.reklama.lv/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', (string) $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/dev.reklama.lv/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', (string) $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/dev.reklama.lv/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/dev.reklama.lv/modules/listings/model.php
$res = $this->db->update(
static::TABLE_ITEMS_VIEWS,
[$field . ' = ' . $field . ' + ' . $increment],
['item_id' => $itemID, 'period' => $date]
);
# update failed
if (empty($res) && $res !== false) {
# 2. start counting statistics for today
if (! empty($viewsToday)) {
$this->db->update(static::TABLE_ITEMS, [
'views_today' => 0,
], ['id' => $itemID]);
$opts['views_today'] = 0;
}
$res = $this->db->insert(static::TABLE_ITEMS_VIEWS, [
'item_id' => $itemID,
$field => $increment,
'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 + ' . $increment,
'views_today = views_today + ' . $increment,
'views_' . $viewType . '_total = views_' . $viewType . '_total + ' . $increment,
],
['id' => $itemID]
);
isset($opts['views_today']) && $opts['views_today'] += $increment;
isset($opts['views_total']) && $opts['views_total'] += $increment;
}
return !empty($res);
}
/var/www/dev.reklama.lv/modules/listings/views/ItemPage.php
$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()) {
Listings::model()->itemViewsIncrement(
$this->itemId,
'item',
$this->item['views_today'],
[
'views_total' => & $this->item['views_total'],
'views_today' => & $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();
# Share code
/var/www/dev.reklama.lv/bff/view/Block.php
foreach ($this->fillable as $key) {
# 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->fillableToData();
$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/dev.reklama.lv/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/dev.reklama.lv/bff/view/Page.php
$this->fillSettings();
}
if ($this->isSubmitAction()) {
if ($response = $this->handleActionRequest('submit')) {
if (is_array($response)) {
return $this->getActionResponse($response);
}
return $response;
}
} else {
if ($response = $this->handleActionRequest()) {
if (is_array($response)) {
return $this->getActionResponse($response);
}
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/dev.reklama.lv/bff/view/Block.php
return $summary ?: $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/dev.reklama.lv/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();
}
return Errors::handleException($e);
}
/var/www/dev.reklama.lv/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->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 () {
return Response::notFound();
};
/var/www/dev.reklama.lv/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/dev.reklama.lv/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/dev.reklama.lv/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/dev.reklama.lv/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/dev.reklama.lv/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/dev.reklama.lv/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/dev.reklama.lv/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/dev.reklama.lv/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/dev.reklama.lv/bff/middleware/Offline.php
<?php //ICB0 71:0 81:144c ?><?php //00091
// Copyright Tamaranga. 2014-2022
// All Rights Reserved
echo('No IonCube Loader is installed. Please contact support.');exit(199);
?>
HR+cPto856OOLEr9wJk1HNt9DvHCKLznaHoBAjukDf068dk1hwuM3epZQFjBKOyLio1SR8Rtp5Hu
c233Gb6PsEoH7jcFTIWRptJaAM4fi7qcqElgfHmCSNzYooYfGmFpLuS14kEnDFNbrwCOuzjJ+dki
11PlzaSD4aukQzW7K6n8cFIUJfISsjgJLqi+rLW8xFH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h1QzoK9LlHqhrQC9doBbxQoNmuB
frON5AMhWxoYD3uAlePK/+qUDENS/MZwwaYiOQpAwDpTuCSd/pgQxYU+FOEiL/B1KHbeEMO5SdA+
GrQwr3sYJtDHO+Dw+ub25lmEistBqXopG5sfbdKWiFfoxEwElvA/frI82Zeh82vREKWDvVOdeQVk
eqjuqhkZG8Y+nUHwX1cChlwwu5FL9d5I6+CXE4/q6CovwQ/S8cuJ+bPuCI/yX2t9CK3VcKmSL/rt
Cf6DFSrChoIOxwyDmOp5WDizrQN2s/VLSNAgGmXcvE59wRrutVQCI4D4yWye1OWasnOJ8iiaApRl
/var/www/dev.reklama.lv/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/dev.reklama.lv/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/dev.reklama.lv/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/dev.reklama.lv/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/dev.reklama.lv/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/dev.reklama.lv/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/dev.reklama.lv/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/dev.reklama.lv/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/dev.reklama.lv/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/dev.reklama.lv/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/dev.reklama.lv/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/dev.reklama.lv/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/dev.reklama.lv/public_html/index.php
<?php
require __DIR__ . '/../bff/bootstrap.php';
bff()->run();