diff --git a/app/modules/api/Init.php b/app/modules/api/Init.php index 475f6f0b..e191af76 100644 --- a/app/modules/api/Init.php +++ b/app/modules/api/Init.php @@ -81,7 +81,7 @@ final class Init extends ModuleBase */ public function initialize($controller) { - debugLog(__FUNCTION__); + logger(__FUNCTION__); // Initialize context $this->context->initialize(); diff --git a/app/modules/web/Controllers/IndexController.php b/app/modules/web/Controllers/IndexController.php index 45989d20..535def46 100644 --- a/app/modules/web/Controllers/IndexController.php +++ b/app/modules/web/Controllers/IndexController.php @@ -24,7 +24,6 @@ namespace SP\Modules\Web\Controllers; -use SP\Http\Response; use SP\Modules\Web\Controllers\Helpers\LayoutHelper; /** @@ -43,7 +42,8 @@ final class IndexController extends ControllerBase public function indexAction() { if (!$this->session->isLoggedIn()) { - Response::redirect('index.php?r=login'); + $this->router->response() + ->redirect('index.php?r=login'); } else { $this->dic->get(LayoutHelper::class)->getFullLayout('main', $this->acl); diff --git a/app/modules/web/Controllers/StatusController.php b/app/modules/web/Controllers/StatusController.php index 25b99970..fae7a18d 100644 --- a/app/modules/web/Controllers/StatusController.php +++ b/app/modules/web/Controllers/StatusController.php @@ -79,7 +79,7 @@ final class StatusController extends SimpleControllerBase } } - debugLog($requestData->message); + logger($requestData->message); } $this->returnJsonResponse(JsonResponse::JSON_ERROR, __u('Versión no disponible')); @@ -114,7 +114,7 @@ final class StatusController extends SimpleControllerBase $this->returnJsonResponseData($notices); } - debugLog($requestData->message); + logger($requestData->message); } $this->returnJsonResponse(JsonResponse::JSON_ERROR, __u('Notificaciones no disponibles')); diff --git a/app/modules/web/Controllers/Traits/ItemTrait.php b/app/modules/web/Controllers/Traits/ItemTrait.php index 0b3e00ea..e69f4398 100644 --- a/app/modules/web/Controllers/Traits/ItemTrait.php +++ b/app/modules/web/Controllers/Traits/ItemTrait.php @@ -83,7 +83,7 @@ trait ItemTrait $customFields[] = $customField; } catch (CryptoException $e) { - debugLog($e->getMessage()); + logger($e->getMessage()); } } diff --git a/app/modules/web/Init.php b/app/modules/web/Init.php index f1c09b7c..c0bc53c6 100644 --- a/app/modules/web/Init.php +++ b/app/modules/web/Init.php @@ -111,7 +111,7 @@ final class Init extends ModuleBase */ public function initialize($controller) { - debugLog(__METHOD__); + logger(__METHOD__); // Iniciar la sesión de PHP $this->initSession($this->configData->isEncryptSession()); @@ -127,7 +127,7 @@ final class Init extends ModuleBase // Initialize theme $this->theme->initialize(); } else { - debugLog('Browser reload'); + logger('Browser reload'); $this->context->setAppStatus(SessionContext::APP_STATUS_RELOADED); @@ -185,7 +185,7 @@ final class Init extends ModuleBase $this->pluginManager->loadPlugins(); if ($this->context->isLoggedIn() && $this->context->getAppStatus() === SessionContext::APP_STATUS_RELOADED) { - debugLog('Reload user profile'); + logger('Reload user profile'); // Recargar los permisos del perfil de usuario $this->context->setUserProfile($this->container->get(UserProfileService::class)->getById($this->context->getUserData()->getUserProfileId())->getProfile()); } @@ -282,7 +282,7 @@ final class Init extends ModuleBase // Recargar los permisos del perfil de usuario // $this->session->setUserProfile(Profile::getItem()->getById($this->session->getUserData()->getUserProfileId())); } catch (CryptoException $e) { - debugLog($e->getMessage()); + logger($e->getMessage()); SessionContext::restart(); return; diff --git a/lib/Base.php b/lib/Base.php index 3dd48885..158c716e 100644 --- a/lib/Base.php +++ b/lib/Base.php @@ -73,13 +73,13 @@ try { Bootstrap::run($builder->build()); } catch (\Exception $e) { - debugLog($e->getMessage()); - debugLog($e->getTraceAsString()); + logger($e->getMessage()); + logger($e->getTraceAsString()); die($e->getMessage()); } catch (\Psr\Container\ContainerExceptionInterface $e) { - debugLog($e->getMessage()); - debugLog($e->getTraceAsString()); + logger($e->getMessage()); + logger($e->getTraceAsString()); die($e->getMessage()); } \ No newline at end of file diff --git a/lib/BaseFunctions.php b/lib/BaseFunctions.php index 6699f61e..f67be42a 100644 --- a/lib/BaseFunctions.php +++ b/lib/BaseFunctions.php @@ -23,46 +23,94 @@ */ /** - * Función para enviar mensajes al log de errores + * [type] [caller] data + */ +define('LOG_FORMAT', "[%s] [%s] %s"); +/** + * [timestamp] [type] [caller] data + */ +define('LOG_FORMAT_OWN', "%s [%s] [%s] %s\n"); + +/** + * Basic logger to handle some debugging and exception messages. + * + * It will log messages into syspass.log or PHP error log file. + * + * In order to log debugging messages, DEBUG constant must be set to true. + * + * A more advanced event logging should be handled through EventDispatcher * * @param mixed $data - * @param bool $printLastCaller + * @param string $type */ -function debugLog($data, $printLastCaller = false) +function logger($data, $type = 'DEBUG') { - $line = date('Y-m-d H:i:s') . ' - ' . print_r($data, true) . PHP_EOL; + if (!DEBUG && $type === 'DEBUG') { + return; + } + + $date = date('Y-m-d H:i:s'); + $caller = getLastCaller(); + + if (is_scalar($data)) { + $line = sprintf(LOG_FORMAT_OWN, $date, $type, $caller, $data); + } else { + $line = sprintf(LOG_FORMAT_OWN, $date, $type, $caller, print_r($data, true)); + } + $useOwn = (!defined('LOG_FILE') || !error_log($line, 3, LOG_FILE) ); if ($useOwn === false) { - error_log(print_r($data, true)); - } - - if ($printLastCaller === true) { - if ($useOwn === true) { - error_log(formatTrace(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)), 3, LOG_FILE); + if (is_scalar($data)) { + $line = sprintf(LOG_FORMAT, $type, $caller, $data); } else { - error_log(formatTrace(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS))); + $line = sprintf(LOG_FORMAT, $type, $caller, print_r($data, true)); } + + error_log($line); } } /** - * Procesar una excepción y registrarla en el log + * Print last callers from backtrace + */ +function printLastCallers() +{ + logger(formatTrace(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS))); +} + +/** + * Print last caller from backtrace + * + * @return string + */ +function getLastCaller() +{ + $callers = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3); + + if (isset($callers[2]) + && isset($callers[2]['class']) + && isset($callers[2]['function']) + ) { + return $callers[2]['class'] . '::' . $callers[2]['function']; + } + + return 'N/A'; +} + +/** + * Process an exception and log into the error log * * @param \Exception $exception */ function processException(\Exception $exception) { - debugLog(__($exception->getMessage())); - debugLog($exception->getTraceAsString()); + logger(sprintf("%s\n%s", __($exception->getMessage()), $exception->getTraceAsString()), 'EXCEPTION'); - $previous = $exception->getPrevious(); - - if ($previous !== null) { - debugLog(__($previous->getMessage())); - debugLog($previous->getTraceAsString()); + if (($previous = $exception->getPrevious()) !== null) { + logger(sprintf("(P) %s\n%s", __($previous->getMessage()), $previous->getTraceAsString()), 'EXCEPTION'); } } @@ -92,7 +140,7 @@ function formatTrace($trace) * Alias gettext function * * @param string $message - * @param bool $translate Si es necesario traducir + * @param bool $translate Si es necesario traducir * * @return string */ @@ -118,7 +166,7 @@ function __u($message) * * @param string $domain * @param string $message - * @param bool $translate + * @param bool $translate * * @return string */ @@ -186,7 +234,7 @@ function initModule($module) function nDirname($dir, $levels) { if (version_compare(PHP_VERSION, '7.0') === -1) { - debugLog(realpath(dirname($dir) . str_repeat('../', $levels))); + logger(realpath(dirname($dir) . str_repeat('../', $levels))); return realpath(dirname($dir) . str_repeat('../', $levels)); } diff --git a/lib/SP/Bootstrap.php b/lib/SP/Bootstrap.php index 3b209631..338b7c16 100644 --- a/lib/SP/Bootstrap.php +++ b/lib/SP/Bootstrap.php @@ -130,10 +130,10 @@ final class Bootstrap $oops = "Oops, it looks like this content doesn't exist..."; $this->router->onError(function ($router, $err_msg, $type, $err) { - debugLog('Routing error: ' . $err_msg); + logger('Routing error: ' . $err_msg); /** @var Exception|\Throwable $err */ - debugLog('Routing error: ' . $err->getTraceAsString()); + logger('Routing error: ' . $err->getTraceAsString()); /** @var Klein $router */ $router->response()->body($err_msg); @@ -152,7 +152,7 @@ final class Bootstrap $method = $action . 'Action'; if (!method_exists($controllerClass, $method)) { - debugLog($controllerClass . '::' . $method); + logger($controllerClass . '::' . $method); throw new RuntimeException($oops); } @@ -162,7 +162,7 @@ final class Bootstrap self::$container->get(InitApi::class) ->initialize($controller); - debugLog('Routing call: ' . $controllerClass . '::' . $method); + logger('Routing call: ' . $controllerClass . '::' . $method); return call_user_func([new $controllerClass(self::$container, $method, $apiRequest), $method]); } catch (\Exception $e) { @@ -195,7 +195,7 @@ final class Bootstrap $controllerClass = 'SP\\Modules\\' . ucfirst(APP_MODULE) . '\\Controllers\\' . ucfirst($controller) . 'Controller'; if (!method_exists($controllerClass, $method)) { - debugLog($controllerClass . '::' . $method); + logger($controllerClass . '::' . $method); throw new RuntimeException($oops); } @@ -209,7 +209,7 @@ final class Bootstrap break; } - debugLog('Routing call: ' . $controllerClass . '::' . $method . '::' . print_r($params, true)); + logger('Routing call: ' . $controllerClass . '::' . $method . '::' . print_r($params, true)); return call_user_func_array([new $controllerClass(self::$container, $method), $method], $params); } catch (\Exception $e) { @@ -236,7 +236,7 @@ final class Bootstrap */ protected function initializeCommon() { - debugLog(__FUNCTION__); + logger(__FUNCTION__); self::$checkPhpVersion = Checks::checkPhpVersion(); @@ -314,7 +314,7 @@ final class Bootstrap && touch(LOG_FILE) && chmod(LOG_FILE, 0600) ) { - debugLog('Setup log file: ' . LOG_FILE); + logger('Setup log file: ' . LOG_FILE); } if (date_default_timezone_get() === 'UTC') { @@ -420,14 +420,14 @@ final class Bootstrap switch ($module) { case 'web': - debugLog('------------'); - debugLog('Boostrap:web'); + logger('------------'); + logger('Boostrap:web'); $bs->router->dispatch($bs->request->getRequest()); break; case 'api': - debugLog('------------'); - debugLog('Boostrap:api'); + logger('------------'); + logger('Boostrap:api'); $bs->router->dispatch($bs->request->getRequest()); break; diff --git a/lib/SP/Config/Config.php b/lib/SP/Config/Config.php index 4dabd0c3..15154165 100644 --- a/lib/SP/Config/Config.php +++ b/lib/SP/Config/Config.php @@ -107,7 +107,7 @@ final class Config self::$timeUpdated = $this->configData->getConfigDate(); $this->configLoaded = true; - debugLog('Config loaded'); + logger('Config loaded'); } } @@ -250,7 +250,7 @@ final class Config public function generateUpgradeKey() { if (empty($this->configData->getUpgradeKey())) { - debugLog('Generating upgrade key'); + logger('Generating upgrade key'); return $this->saveConfig($this->configData->setUpgradeKey(Util::generateRandomBytes(16)), false); } diff --git a/lib/SP/Config/ConfigCache.php b/lib/SP/Config/ConfigCache.php index f78a5561..fbb6a7bb 100644 --- a/lib/SP/Config/ConfigCache.php +++ b/lib/SP/Config/ConfigCache.php @@ -64,7 +64,7 @@ final class ConfigCache try { $this->fileCache->save(self::CONFIG_CACHE_FILE, $configData); - debugLog('Saved config cache'); + logger('Saved config cache'); } catch (FileException $e) { processException($e); } @@ -81,7 +81,7 @@ final class ConfigCache $configData = $this->fileCache->load(self::CONFIG_CACHE_FILE); if ($configData instanceof ConfigData) { - debugLog('Loaded config cache'); + logger('Loaded config cache'); return $configData; } diff --git a/lib/SP/Core/Acl/Actions.php b/lib/SP/Core/Acl/Actions.php index f502530b..4b6c1f32 100644 --- a/lib/SP/Core/Acl/Actions.php +++ b/lib/SP/Core/Acl/Actions.php @@ -91,7 +91,7 @@ final class Actions try { $this->actions = $this->fileStorage->load(self::ACTIONS_CACHE_FILE); - debugLog('Loaded actions cache'); + logger('Loaded actions cache'); } catch (FileException $e) { processException($e); @@ -105,7 +105,7 @@ final class Actions */ protected function mapAndSave() { - debugLog('ACTION CACHE MISS'); + logger('ACTION CACHE MISS'); $this->map(); $this->saveCache(); @@ -154,7 +154,7 @@ final class Actions try { $this->fileStorage->save(self::ACTIONS_CACHE_FILE, $this->actions); - debugLog('Saved actions cache'); + logger('Saved actions cache'); } catch (FileException $e) { processException($e); } diff --git a/lib/SP/Core/Context/SessionContext.php b/lib/SP/Core/Context/SessionContext.php index 00e4a494..e85d3318 100644 --- a/lib/SP/Core/Context/SessionContext.php +++ b/lib/SP/Core/Context/SessionContext.php @@ -54,7 +54,7 @@ final class SessionContext extends ContextBase */ public static function close() { - debugLog('Session closed'); + logger('Session closed'); session_write_close(); @@ -124,7 +124,7 @@ final class SessionContext extends ContextBase { try { if (self::$isLocked) { - debugLog('Session locked; key=' . $key); + logger('Session locked; key=' . $key); } else { parent::setContextKey($key, $value); } diff --git a/lib/SP/Core/Crypt/Crypt.php b/lib/SP/Core/Crypt/Crypt.php index 4b269f78..31cedaf1 100644 --- a/lib/SP/Core/Crypt/Crypt.php +++ b/lib/SP/Core/Crypt/Crypt.php @@ -59,7 +59,7 @@ final class Crypt return Crypto::encrypt((string)$data, $key); } catch (CryptoException $e) { - debugLog($e->getMessage()); + logger($e->getMessage()); throw $e; } @@ -82,7 +82,7 @@ final class Crypt return KeyProtectedByPassword::loadFromAsciiSafeString($key)->unlockKey($password); } catch (CryptoException $e) { - debugLog($e->getMessage()); + logger($e->getMessage()); throw $e; } @@ -113,7 +113,7 @@ final class Crypt return Crypto::decrypt($data, Key::loadFromAsciiSafeString($securedKey)); } catch (CryptoException $e) { - debugLog($e->getMessage()); + logger($e->getMessage()); throw $e; } @@ -138,7 +138,7 @@ final class Crypt return KeyProtectedByPassword::createRandomPasswordProtectedKey($password); } catch (CryptoException $e) { - debugLog($e->getMessage()); + logger($e->getMessage()); throw $e; } diff --git a/lib/SP/Core/Crypt/CryptSessionHandler.php b/lib/SP/Core/Crypt/CryptSessionHandler.php index 171652e3..7f64c9a1 100644 --- a/lib/SP/Core/Crypt/CryptSessionHandler.php +++ b/lib/SP/Core/Crypt/CryptSessionHandler.php @@ -81,8 +81,8 @@ final class CryptSessionHandler extends \SessionHandler } catch (CryptoException $e) { self::$isSecured = false; - debugLog($e->getMessage()); - debugLog('Session data not encrypted.'); + logger($e->getMessage()); + logger('Session data not encrypted.'); return $data; } @@ -118,8 +118,8 @@ final class CryptSessionHandler extends \SessionHandler } catch (CryptoException $e) { self::$isSecured = false; - debugLog('Could not encrypt session data.'); - debugLog($e->getMessage()); + logger('Could not encrypt session data.'); + logger($e->getMessage()); } return parent::write($id, $data); diff --git a/lib/SP/Core/Crypt/Hash.php b/lib/SP/Core/Crypt/Hash.php index 59e5b617..11bb9132 100644 --- a/lib/SP/Core/Crypt/Hash.php +++ b/lib/SP/Core/Crypt/Hash.php @@ -63,7 +63,7 @@ final class Hash $key = hash('sha256', $key); if ($isCheck === false) { - debugLog('[INFO] Password string shortened using SHA256 and then BCRYPT'); + logger('[INFO] Password string shortened using SHA256 and then BCRYPT'); } } diff --git a/lib/SP/Core/Crypt/SecureKeyCookie.php b/lib/SP/Core/Crypt/SecureKeyCookie.php index fbff805b..274bcb0a 100644 --- a/lib/SP/Core/Crypt/SecureKeyCookie.php +++ b/lib/SP/Core/Crypt/SecureKeyCookie.php @@ -69,7 +69,7 @@ final class SecureKeyCookie extends Cookie $data = $this->getCookieData($cookie, $key); if ($data === false) { - debugLog('Cookie verification error.'); + logger('Cookie verification error.'); return $this->saveKey($key); } @@ -83,7 +83,7 @@ final class SecureKeyCookie extends Cookie try { return Key::loadFromAsciiSafeString($vault->getData($key)); } catch (CryptoException $e) { - debugLog($e->getMessage()); + logger($e->getMessage()); return false; } @@ -127,16 +127,16 @@ final class SecureKeyCookie extends Cookie $vault->saveData($this->securedKey->saveToAsciiSafeString(), $key); if ($this->setCookie($this->sign(serialize($vault), $key))) { - debugLog('Generating a new session key.'); + logger('Generating a new session key.'); return $this->securedKey; } else { - debugLog('Could not generate session key cookie.'); + logger('Could not generate session key cookie.'); unset($this->securedKey); } } catch (CryptoException $e) { - debugLog($e->getMessage()); + logger($e->getMessage()); } return false; diff --git a/lib/SP/Core/Crypt/Session.php b/lib/SP/Core/Crypt/Session.php index 03235005..fb97da8e 100644 --- a/lib/SP/Core/Crypt/Session.php +++ b/lib/SP/Core/Crypt/Session.php @@ -78,7 +78,7 @@ final class Session */ public static function reKey(SessionContext $sessionContext) { - debugLog(__METHOD__); + logger(__METHOD__); $oldSeed = session_id() . $sessionContext->getSidStartTime(); diff --git a/lib/SP/Core/Events/EventDispatcherBase.php b/lib/SP/Core/Events/EventDispatcherBase.php index f63412e5..771a733f 100644 --- a/lib/SP/Core/Events/EventDispatcherBase.php +++ b/lib/SP/Core/Events/EventDispatcherBase.php @@ -60,7 +60,7 @@ abstract class EventDispatcherBase implements EventDispatcherInterface // throw new InvalidClassException(sprintf(__('Observador ya inicializado "%s"'), $observerClass)); } - debugLog('Attach: ' . $observerClass); + logger('Attach: ' . $observerClass); $this->observers[$observerClass] = $observer; } diff --git a/lib/SP/Core/Language.php b/lib/SP/Core/Language.php index 90a95a07..bb9ddb69 100644 --- a/lib/SP/Core/Language.php +++ b/lib/SP/Core/Language.php @@ -213,8 +213,8 @@ final class Language putenv('LANGUAGE=' . $lang); if (!($result = setlocale(LC_ALL, $locales))) { - debugLog('Could not set locales'); - debugLog('Domain path: ' . LOCALES_PATH); + logger('Could not set locales'); + logger('Domain path: ' . LOCALES_PATH); } bindtextdomain('messages', LOCALES_PATH); diff --git a/lib/SP/Core/UI/Theme.php b/lib/SP/Core/UI/Theme.php index 60e10bac..d9e146e3 100644 --- a/lib/SP/Core/UI/Theme.php +++ b/lib/SP/Core/UI/Theme.php @@ -165,7 +165,7 @@ final class Theme implements ThemeInterface try { $this->icons = $this->fileCache->load(self::ICONS_CACHE_FILE); - debugLog('Loaded icons cache'); + logger('Loaded icons cache'); return $this->icons; } catch (FileException $e) { @@ -183,7 +183,7 @@ final class Theme implements ThemeInterface try { $this->fileCache->save(self::ICONS_CACHE_FILE, $this->icons); - debugLog('Saved icons cache'); + logger('Saved icons cache'); } catch (FileException $e) { processException($e); } diff --git a/lib/SP/DataModel/CustomFieldData.php b/lib/SP/DataModel/CustomFieldData.php index 4e597b97..9ae61a1d 100644 --- a/lib/SP/DataModel/CustomFieldData.php +++ b/lib/SP/DataModel/CustomFieldData.php @@ -63,7 +63,7 @@ class CustomFieldData */ public function getId() { - return $this->id; + return (int)$this->id; } /** @@ -71,7 +71,7 @@ class CustomFieldData */ public function setId($id) { - $this->id = $id; + $this->id = (int)$id; } /** diff --git a/lib/SP/DataModel/TrackData.php b/lib/SP/DataModel/TrackData.php index 3d22c0a0..69b13f5c 100644 --- a/lib/SP/DataModel/TrackData.php +++ b/lib/SP/DataModel/TrackData.php @@ -152,7 +152,7 @@ class TrackData extends DataModelBase } elseif (strlen($ip) > 4) { $this->ipv6 = $ip; } elseif ($ip === false) { - debugLog(sprintf('%s : %s', __('IP inválida'), $track_ip)); + logger(sprintf('%s : %s', __('IP inválida'), $track_ip)); throw new InvalidArgumentException(__u('IP inválida'), InvalidArgumentException::ERROR, $track_ip); } diff --git a/lib/SP/Html/DataGrid/DataGridBase.php b/lib/SP/Html/DataGrid/DataGridBase.php index d499ab30..ba3b920f 100644 --- a/lib/SP/Html/DataGrid/DataGridBase.php +++ b/lib/SP/Html/DataGrid/DataGridBase.php @@ -331,7 +331,7 @@ abstract class DataGridBase implements DataGridInterface try { $this->_actionsTemplate = $this->checkTemplate($template); } catch (FileNotFoundException $e) { - debugLog($e->getMessage()); + logger($e->getMessage()); } return $this; @@ -360,7 +360,7 @@ abstract class DataGridBase implements DataGridInterface try { $this->_pagerTemplate = $this->checkTemplate($template, $base); } catch (FileNotFoundException $e) { - debugLog($e->getMessage()); + logger($e->getMessage()); } return $this; diff --git a/lib/SP/Html/Minify.php b/lib/SP/Html/Minify.php index f4ca0a5b..d2bc9bee 100644 --- a/lib/SP/Html/Minify.php +++ b/lib/SP/Html/Minify.php @@ -123,7 +123,7 @@ final class Minify try { $data .= '/* URL: ' . $file['name'] . ' */' . PHP_EOL . Util::getDataFromUrl($file['name']); } catch (SPException $e) { - debugLog($e->getMessage()); + logger($e->getMessage()); } } else { @@ -259,7 +259,7 @@ final class Minify 'md5' => md5_file($filePath) ); } else { - debugLog('File not found: ' . $filePath); + logger('File not found: ' . $filePath); } } @@ -310,7 +310,7 @@ final class Minify 'md5' => md5_file($filePath) ); } else { - debugLog('File not found: ' . $filePath); + logger('File not found: ' . $filePath); } } diff --git a/lib/SP/Http/Request.php b/lib/SP/Http/Request.php index b05309d9..3421341a 100644 --- a/lib/SP/Http/Request.php +++ b/lib/SP/Http/Request.php @@ -236,7 +236,7 @@ final class Request // Desencriptar con la clave RSA if ($clearData === false) { - debugLog('No RSA encrypted data from request'); + logger('No RSA encrypted data from request'); return $encryptedData; } diff --git a/lib/SP/Http/Response.php b/lib/SP/Http/Response.php index 723d9ac9..fe833f98 100644 --- a/lib/SP/Http/Response.php +++ b/lib/SP/Http/Response.php @@ -24,7 +24,6 @@ namespace SP\Http; -use SP\Bootstrap; use SP\Core\Exceptions\SPException; use SP\Util\Json; @@ -100,37 +99,4 @@ final class Response exit(json_encode($data)); } } - - /** - * Devuelve una respuesta de error en formato HTML. - * - * @param $data - */ - public static function printHtmlError($data) - { - $error = '