/var/www/natumbe.kz/bff/exception/ResponseException.php
<?php
namespace bff\exception;
/**
* Response Exception
* Special type of exception in cases where unable to implement proper "return Response"
*/
class ResponseException extends BaseException
{
}
/var/www/natumbe.kz/bff/vendor/composer/ClassLoader.php
/**
* @return void
*/
private static function initializeIncludeClosure()
{
if (self::$includeFile !== null) {
return;
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*
* @param string $file
* @return void
*/
self::$includeFile = \Closure::bind(static function($file) {
include $file;
}, null, null);
}
}
/var/www/natumbe.kz/bff/vendor/composer/ClassLoader.php
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
if (null !== $this->vendorDir) {
unset(self::$registeredLoaders[$this->vendorDir]);
}
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return true|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
$includeFile = self::$includeFile;
$includeFile($file);
return true;
}
return null;
}
/**
* Finds the path to the file where the class is defined.
*
* @param string $class The name of the class
*
* @return string|false The path if found, false otherwise
*/
public function findFile($class)
{
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
/var/www/natumbe.kz/bff/http/Response.php
$body = new Stream('php://temp', 'wb+');
$body->write(
mb_substr($html, 0, $pos) .
$code .
mb_substr($html, $pos)
);
$body->rewind();
return $this->withBody($body);
}
return $this;
}
/**
* Throws the response in a ResponseException instance.
* @throws ResponseException
*/
public function throw()
{
throw ResponseException::init($this);
}
}
/var/www/natumbe.kz/bff/modules/seo/Base.php
$last = mb_substr($path, -1);
if ($required) {
# URL должен обязательно завершаться слешем
if ($last !== '/') {
$path .= '/';
} else {
# исправляем множественные завершающие слешы
$path = rtrim($path, '/') . '/';
}
} else {
# URL должен обязательно быть без завершающего слеша
if ($last === '/') {
$path = rtrim($path, '/');
}
}
if ($path !== $url['path']) {
$url = Url::to($path, ['lang' => false, 'query' => (isset($url['query']) ? '?' . $url['query'] : '')]);
$redirect = Response::redirect($url, $opts['status'] ?? 301);
if ($options['throw'] ?? true) {
$redirect->throw();
} else {
return $redirect;
}
}
}
return false;
}
/**
* Вывод мета данных
* @param array $options дополнительные настройки
* @return string
*/
public function metaRender(array $options = [])
{
# дозаполняем мета-данные
foreach ($this->metaKeys as $k) {
if (isset($options[$k])) {
$this->metaSet($k, $options[$k]);
}
/var/www/natumbe.kz/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/natumbe.kz/bff/view/HasSeo.php
* Fill regions seo placeholders
* @param int|null $id active region id
* @return array
*/
public function seoMacrosRegionsData(?int $id = null)
{
return Geo::addRegionsSeoPlaceholders($this->seo, true, $id);
}
/**
* Проверка URL текущего запроса на обязательное наличие/отсутствие завершающего слеша
* @param bool $required true - URL должен обязательно завершаться слешем,
* false - URL должен обязательно быть без завершающего слеша
* @param array $opts ['status' - статус редиректа, 'throw' - Response исключение]
* @return \bff\http\Response|false
* @throws \bff\exception\ResponseException
*/
public function seoCorrectUrlEndSlash($required = true, array $opts = [])
{
return SEO::urlCorrectionEndSlash($required, $opts);
}
/**
* Active landing page data
* @return mixed
*/
public function seoLandingPage()
{
return SEO::landingPage();
}
/**
* Set seo meta-tags for page
* @param array $data @ref page data
* @param array $opts extra options [landing-skip, divider]
* @return void
*/
public function seoApply(array &$data = [], array $opts = [])
{
if ($data === []) {
/var/www/natumbe.kz/modules/listings/views/SearchPage.php
});
$this->addBlock('relinkBlock', RelinkBlock::class, function (RelinkBlock $block) {
$block->filter = $this->filter;
});
}
/**
* List block
* @return ListBlock|mixed
*/
public function getList()
{
return $this->getBlock('listBlock');
}
public function seo()
{
if ($this->isGET()) {
$this->seoCorrectUrlEndSlash();
}
$catID = $this->filter->categoryId;
$catData = &$this->filter->categoryData;
$region = $this->filter->region;
$total = $this->filter->total;
$this->seo->with([
'page' => $this->filter->page,
'total' => $total,
'total.text' => tpl::declension($total, _t('listings', 'listing;listings;listings')),
'query' => $this->filter->query,
]);
$geoData = $this->seoMacrosRegionsData($region);
# Canonical Url
$skipPrefix = ! $catID && $region && $this->config('listings.index.region.search.canonical', false); # TODO: sett?
$this->seo->canonicalUrl(
Listings::url('items.search', [
'keyword' => $catData['keyword'],
/var/www/natumbe.kz/modules/listings/views/SearchCategoryPage.php
$this->filter->addCategorySeo();
$meta = [];
foreach ($this->filter->categoryData['crumbs'] as $crumb) {
if ($crumb['id'] > 0) {
$meta[] = $crumb['title'];
}
}
$parent = sizeof($meta) > 1 ? $meta[sizeof($meta) - 2] : '';
$category = $this->filter->categoryData['title'];
$this->seo->with([
'category' => $category,
'category-parent' => $parent,
'category+parent' => $parent ? join(', ', [$category, $parent]) : $category,
'categories' => join(', ', $meta),
'categories.reverse' => join(', ', array_reverse($meta, true)),
]);
parent::seo();
}
public function seoSettings()
{
$this->seo
->placeholder('category', _t('listings', 'Title of current category'))
->placeholder('category-parent', _t('listings', 'Title of category above'))
->placeholder('category+parent', _t('listings', 'Title of current category + categories above'))
->placeholder('categories', _t('listings', 'Title of all categories'))
->placeholder('categories.reverse', _t('listings', 'Title of all categories<br />(reverse order)'))
->withLandingPageLink()
->inheritance();
parent::seoSettings();
}
}
/var/www/natumbe.kz/bff/view/Page.php
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();
# Update last breadcrumb title to breadcrumb from seo settings
if (! empty($this->data['breadcrumb']) && $this->hasBreadcrumbs()) {
$this->breadcrumbs->update(['title' => $this->data['breadcrumb']]);
}
# Wrap seotext in default seotext template
if (! empty($this->data['seotext'])) {
$this->data['seotext'] = $this->view->template('seotext', [
'seotext' => $this->data['seotext'],
], 'site');
}
# Blocks seo
$this->blocksIterator(function ($block) {
if (method_exists($block, 'seo')) {
$this->app->call([$block, 'seo']);
}
});
}
/var/www/natumbe.kz/bff/view/Block.php
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;
$data = $callback($this);
# throw response
if ($data instanceof Response) {
$data->throw();
}
return $data;
}
return ''; # no data no render
}
if ($this->beforeRender() === false) {
return ''; # cancel render
}
# No template - no render
$template = $this->getTemplate();
if ($template === '') {
return '';
}
# Prerender sub blocks
foreach ($this->data as $key => $value) {
if ($value instanceof self && $value->prerenderable()) {
$this->data[$key] = $value->render();
}
}
# Bind scope
$this->renderOptions['this'] = $this->renderOptions['this'] ?? $this;
# Template as callback
/var/www/natumbe.kz/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/natumbe.kz/bff/view/Block.php
return parent::config($key, $default, $opts);
}
/**
* 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/natumbe.kz/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/natumbe.kz/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/natumbe.kz/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/natumbe.kz/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/natumbe.kz/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/natumbe.kz/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/natumbe.kz/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/natumbe.kz/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/natumbe.kz/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/natumbe.kz/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/natumbe.kz/bff/middleware/Offline.php
<?php //ICB0 71:0 81:1468 ?><?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/natumbe.kz/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/natumbe.kz/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/natumbe.kz/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/natumbe.kz/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/natumbe.kz/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/natumbe.kz/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/natumbe.kz/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/natumbe.kz/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/natumbe.kz/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/natumbe.kz/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/natumbe.kz/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/natumbe.kz/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/natumbe.kz/public_html/index.php
<?php
$_SERVER["DOCUMENT_ROOT"] = __DIR__;
require_once($_SERVER['DOCUMENT_ROOT'].'/protect192/code/include.php');
require __DIR__ . '/../bff/bootstrap.php';
bff()->run();