diff --git a/api.php b/api.php
index ce9762aa..ec4779d1 100644
--- a/api.php
+++ b/api.php
@@ -26,7 +26,7 @@ use Psr\Container\ContainerInterface;
use SP\Domain\Core\Bootstrap\BootstrapInterface;
use SP\Domain\Core\Bootstrap\ModuleInterface;
use SP\Modules\Api\Bootstrap;
-use SP\Util\FileSystemUtil;
+use SP\Util\FileSystem;
use function SP\processException;
@@ -34,7 +34,7 @@ const APP_ROOT = __DIR__;
const APP_MODULE = 'api';
try {
- $dic = FileSystemUtil::require(FileSystemUtil::buildPath(APP_ROOT, 'lib', 'Base.php'), ContainerInterface::class);
+ $dic = FileSystem::require(FileSystem::buildPath(APP_ROOT, 'lib', 'Base.php'), ContainerInterface::class);
Bootstrap::run($dic->get(BootstrapInterface::class), $dic->get(ModuleInterface::class));
} catch (Throwable $e) {
diff --git a/app/modules/api/Init.php b/app/modules/api/Init.php
index b0f2aca9..818cdd1b 100644
--- a/app/modules/api/Init.php
+++ b/app/modules/api/Init.php
@@ -41,7 +41,7 @@ use SP\Domain\Upgrade\Services\UpgradeDatabaseService;
use SP\Domain\Upgrade\Services\UpgradeUtil;
use SP\Infrastructure\Database\DatabaseUtil;
use SP\Infrastructure\File\FileException;
-use SP\Util\HttpUtil;
+use SP\Util\Http;
use function SP\logger;
@@ -91,7 +91,7 @@ final class Init extends HttpModuleBase
$this->language->setLanguage();
// Checks if it needs to switch the request over HTTPS
- HttpUtil::checkHttps($this->configData, $this->request);
+ Http::checkHttps($this->configData, $this->request);
// Checks if sysPass is installed
$this->checkInstalled();
diff --git a/app/modules/cli/Init.php b/app/modules/cli/Init.php
index 5c8bce5e..2f7f8cfa 100644
--- a/app/modules/cli/Init.php
+++ b/app/modules/cli/Init.php
@@ -31,7 +31,7 @@ use SP\Core\Language;
use SP\Core\ModuleBase;
use SP\Core\ProvidersHelper;
use SP\Domain\Core\LanguageInterface;
-use SP\Util\VersionUtil;
+use SP\Util\Version;
use Symfony\Component\Console\Application as ConsoleApplication;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
@@ -96,7 +96,7 @@ final class Init extends ModuleBase
private function initCli(): void
{
$this->consoleApplication->setName('sysPass CLI');
- $this->consoleApplication->setVersion(implode('.', VersionUtil::getVersionArray()));
+ $this->consoleApplication->setVersion(implode('.', Version::getVersionArray()));
$this->consoleApplication->addCommands($this->cliCommandHelper->getCommands());
$this->consoleApplication->run(
diff --git a/app/modules/web/Controllers/AccountFile/ViewController.php b/app/modules/web/Controllers/AccountFile/ViewController.php
index 0cea826e..65550868 100644
--- a/app/modules/web/Controllers/AccountFile/ViewController.php
+++ b/app/modules/web/Controllers/AccountFile/ViewController.php
@@ -31,7 +31,7 @@ use SP\Core\Events\EventMessage;
use SP\Domain\Core\Exceptions\SPException;
use SP\Http\JsonMessage;
use SP\Modules\Web\Controllers\Traits\JsonTrait;
-use SP\Util\FileSystemUtil;
+use SP\Util\FileSystem;
/**
* Class ViewController
@@ -61,7 +61,7 @@ final class ViewController extends AccountFileBase
$this->view->addTemplate('file', 'itemshow');
- if (FileSystemUtil::isImage($fileData)) {
+ if (FileSystem::isImage($fileData)) {
$this->view->assign('data', chunk_split(base64_encode($fileData->getContent())));
$this->view->assign('fileData', $fileData);
$this->view->assign('isImage', 1);
diff --git a/app/modules/web/Controllers/Helpers/Grid/NotificationGrid.php b/app/modules/web/Controllers/Helpers/Grid/NotificationGrid.php
index 39271d53..1799fb87 100644
--- a/app/modules/web/Controllers/Helpers/Grid/NotificationGrid.php
+++ b/app/modules/web/Controllers/Helpers/Grid/NotificationGrid.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -37,7 +37,7 @@ use SP\Html\DataGrid\DataGridInterface;
use SP\Html\DataGrid\Layout\DataGridHeader;
use SP\Html\Html;
use SP\Infrastructure\Database\QueryResult;
-use SP\Util\DateUtil;
+use SP\Util\Date;
use function SP\__;
@@ -143,7 +143,7 @@ final class NotificationGrid extends GridBase
'date',
false,
function ($value) {
- return DateUtil::getDateFromUnix($value);
+ return Date::getDateFromUnix($value);
}
);
$gridData->addDataRowSource('type');
diff --git a/app/modules/web/Controllers/Helpers/LayoutHelper.php b/app/modules/web/Controllers/Helpers/LayoutHelper.php
index a0a2c5fd..c6dcbeac 100644
--- a/app/modules/web/Controllers/Helpers/LayoutHelper.php
+++ b/app/modules/web/Controllers/Helpers/LayoutHelper.php
@@ -40,8 +40,8 @@ use SP\Html\DataGrid\Action\DataGridAction;
use SP\Http\Uri;
use SP\Mvc\View\TemplateInterface;
use SP\Plugin\PluginManager;
-use SP\Util\FileSystemUtil;
-use SP\Util\VersionUtil;
+use SP\Util\FileSystem;
+use SP\Util\Version;
use function SP\__;
use function SP\processException;
@@ -151,7 +151,7 @@ final class LayoutHelper extends HelperBase
*/
protected function getResourcesLinks(): void
{
- $version = VersionUtil::getVersionStringNormalized();
+ $version = Version::getVersionStringNormalized();
$baseUrl = ($this->configData->getApplicationUrl() ?? $this->uriContext->getWebUri()) .
$this->uriContext->getSubUri();
@@ -171,7 +171,7 @@ final class LayoutHelper extends HelperBase
$jsUriTheme = new Uri($baseUrl);
$jsUriTheme->addParams(
[
- 'b' => FileSystemUtil::buildPath($this->theme->getPath(), 'js'),
+ 'b' => FileSystem::buildPath($this->theme->getPath(), 'js'),
'f' => implode(',', $themeInfo['js'])
]
);
@@ -207,7 +207,7 @@ final class LayoutHelper extends HelperBase
$cssUriTheme = new Uri($baseUrl);
$cssUriTheme->addParams(
[
- 'b' => FileSystemUtil::buildPath($this->theme->getPath(), 'css'),
+ 'b' => FileSystem::buildPath($this->theme->getPath(), 'css'),
'f' => implode(',', $themeInfo['css'])
]
);
@@ -228,7 +228,7 @@ final class LayoutHelper extends HelperBase
if (count($jsResources) > 0) {
$jsUriPlugin = new Uri($baseUrl);
$jsUriPlugin->addParams([
- 'b' => FileSystemUtil::buildPath($base, 'js'),
+ 'b' => FileSystem::buildPath($base, 'js'),
'f' => implode(',', $jsResources)
]);
@@ -239,7 +239,7 @@ final class LayoutHelper extends HelperBase
$cssUriPlugin = new Uri($baseUrl);
$cssUriPlugin->addParams(
[
- 'b' => FileSystemUtil::buildPath($base, 'css'),
+ 'b' => FileSystem::buildPath($base, 'css'),
'f' => implode(',', $cssResources)
]
);
diff --git a/app/modules/web/Controllers/PublicLink/SaveCreateFromAccountController.php b/app/modules/web/Controllers/PublicLink/SaveCreateFromAccountController.php
index ea04d9df..30f26d22 100644
--- a/app/modules/web/Controllers/PublicLink/SaveCreateFromAccountController.php
+++ b/app/modules/web/Controllers/PublicLink/SaveCreateFromAccountController.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -32,7 +32,7 @@ use SP\Domain\Account\Services\PublicLink;
use SP\Domain\Core\Acl\AclActionsInterface;
use SP\Http\JsonMessage;
use SP\Modules\Web\Controllers\Traits\JsonTrait;
-use SP\Util\PasswordUtil;
+use SP\Util\Password;
/**
* Class SaveCreateFromAccountController
@@ -65,7 +65,7 @@ final class SaveCreateFromAccountController extends PublicLinkSaveBase
'id' => PublicLink::TYPE_ACCOUNT,
'itemId' => $accountId,
'notify' => (bool)$notify,
- 'hash' => PasswordUtil::generateRandomBytes()
+ 'hash' => Password::generateRandomBytes()
]
);
diff --git a/app/modules/web/Controllers/Resource/CssController.php b/app/modules/web/Controllers/Resource/CssController.php
index 82e8f87b..378ac29b 100644
--- a/app/modules/web/Controllers/Resource/CssController.php
+++ b/app/modules/web/Controllers/Resource/CssController.php
@@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Resource;
use SP\Http\Request as HttpRequest;
use SP\Infrastructure\File\FileHandler;
-use SP\Util\FileSystemUtil;
+use SP\Util\FileSystem;
/**
* Class CssController
@@ -57,11 +57,11 @@ final class CssController extends ResourceBase
->addFiles($files)
->getMinified();
} else {
- $files = $this->buildFiles(FileSystemUtil::buildPath(PUBLIC_PATH, 'vendor', 'css'), self::CSS_MIN_FILES);
+ $files = $this->buildFiles(FileSystem::buildPath(PUBLIC_PATH, 'vendor', 'css'), self::CSS_MIN_FILES);
$this->minify->builder()
->addFiles($files, false)
- ->addFile(new FileHandler(FileSystemUtil::buildPath(PUBLIC_PATH, 'css', 'fonts.min.css')), false)
+ ->addFile(new FileHandler(FileSystem::buildPath(PUBLIC_PATH, 'css', 'fonts.min.css')), false)
->getMinified();
}
}
@@ -77,7 +77,7 @@ final class CssController extends ResourceBase
$base = $insecure ? HttpRequest::getSecureAppPath($base) : $base;
return array_map(
- fn(string $file) => new FileHandler(FileSystemUtil::buildPath($base, $file)),
+ fn(string $file) => new FileHandler(FileSystem::buildPath($base, $file)),
$files
);
}
diff --git a/app/modules/web/Controllers/Resource/JsController.php b/app/modules/web/Controllers/Resource/JsController.php
index 2e95363e..f797fee6 100644
--- a/app/modules/web/Controllers/Resource/JsController.php
+++ b/app/modules/web/Controllers/Resource/JsController.php
@@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Resource;
use SP\Http\Request as HttpRequest;
use SP\Infrastructure\File\FileHandler;
-use SP\Util\FileSystemUtil;
+use SP\Util\FileSystem;
/**
* Class JsController
@@ -80,7 +80,7 @@ final class JsController extends ResourceBase
$this->minify
->builder()
->addFiles(
- $this->buildFiles(FileSystemUtil::buildPath(PUBLIC_PATH, 'vendor', 'js'), self::JS_MIN_FILES),
+ $this->buildFiles(FileSystem::buildPath(PUBLIC_PATH, 'vendor', 'js'), self::JS_MIN_FILES),
false
)
->getMinified();
@@ -88,7 +88,7 @@ final class JsController extends ResourceBase
$this->minify
->builder()
->addFiles(
- $this->buildFiles(FileSystemUtil::buildPath(PUBLIC_PATH, 'js'), self::JS_APP_MIN_FILES),
+ $this->buildFiles(FileSystem::buildPath(PUBLIC_PATH, 'js'), self::JS_APP_MIN_FILES),
false
)
->getMinified();
@@ -107,7 +107,7 @@ final class JsController extends ResourceBase
$base = $insecure ? HttpRequest::getSecureAppPath($base) : $base;
return array_map(
- fn(string $file) => new FileHandler(FileSystemUtil::buildPath($base, $file)),
+ fn(string $file) => new FileHandler(FileSystem::buildPath($base, $file)),
$files
);
}
diff --git a/app/modules/web/Controllers/Status/StatusController.php b/app/modules/web/Controllers/Status/StatusController.php
index 2ff45c0e..4454dcff 100644
--- a/app/modules/web/Controllers/Status/StatusController.php
+++ b/app/modules/web/Controllers/Status/StatusController.php
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -29,7 +29,7 @@ use SP\Domain\Core\AppInfoInterface;
use SP\Domain\Core\Exceptions\CheckException;
use SP\Http\JsonMessage;
use SP\Modules\Web\Controllers\Traits\JsonTrait;
-use SP\Util\VersionUtil;
+use SP\Util\Version;
use Throwable;
/**
@@ -69,7 +69,7 @@ final class StatusController extends StatusBase
'.'.
$matches['build'];
- if (VersionUtil::checkVersion(VersionUtil::getVersionStringNormalized(), $pubVersion)) {
+ if (Version::checkVersion(Version::getVersionStringNormalized(), $pubVersion)) {
return $this->returnJsonResponseData([
'version' => $requestData->tag_name,
'url' => $requestData->html_url,
diff --git a/app/modules/web/Init.php b/app/modules/web/Init.php
index 14413e1c..96d7b072 100644
--- a/app/modules/web/Init.php
+++ b/app/modules/web/Init.php
@@ -80,7 +80,7 @@ use SP\Modules\Web\Controllers\Status\StatusController;
use SP\Modules\Web\Controllers\Task\TrackStatusController;
use SP\Modules\Web\Controllers\Upgrade\IndexController as UpgradeIndexController;
use SP\Modules\Web\Controllers\Upgrade\UpgradeController;
-use SP\Util\HttpUtil;
+use SP\Util\Http;
use function SP\logger;
use function SP\processException;
@@ -211,7 +211,7 @@ final class Init extends HttpModuleBase
$this->language->setLanguage($isReload);
// Comprobar si es necesario cambiar a HTTPS
- HttpUtil::checkHttps($this->configData, $this->request);
+ Http::checkHttps($this->configData, $this->request);
$partialInit = in_array($controller, self::PARTIAL_INIT, true);
diff --git a/app/modules/web/themes/material-blue/views/account/search-rows.inc b/app/modules/web/themes/material-blue/views/account/search-rows.inc
index 32c9b1e7..715cb665 100644
--- a/app/modules/web/themes/material-blue/views/account/search-rows.inc
+++ b/app/modules/web/themes/material-blue/views/account/search-rows.inc
@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
- * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
+ * @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -26,7 +26,7 @@
* @var ThemeIconsInterface $icons
* @var callable $_getvar
* @var ConfigDataInterface $configData
- * @var \SP\Domain\Account\Adapters\AccountSearchItem $account
+ * @var AccountSearchItem $account
* @var DataGridTab $data
* @var DataGridActionBase $actionMenu
* @var DataGridActionBase $action
@@ -39,7 +39,7 @@ use SP\Domain\Core\Acl\AclActionsInterface;
use SP\Domain\Core\UI\ThemeIconsInterface;
use SP\Html\DataGrid\Action\DataGridActionBase;
use SP\Html\DataGrid\DataGridTab;
-use SP\Util\DateUtil;
+use SP\Util\Date;
if (!isset($data)) {
$data = $_getvar('data');
@@ -373,7 +373,7 @@ $favoriteRouteOff = $_getvar('favoriteRouteOff');
printf(
'%s: %s',
__('Expiry Date'),
- DateUtil::getDateFromUnix($accountSearchData->getPublicLinkDateExpire())
+ Date::getDateFromUnix($accountSearchData->getPublicLinkDateExpire())
); ?>
%s)',
Installer::VERSION_TEXT,
- VersionUtil::getVersionStringNormalized()
+ Version::getVersionStringNormalized()
); ?>
@@ -76,7 +77,7 @@
0
):
?>
@@ -189,7 +190,7 @@
endif; ?>
+ if (Version::checkVersion($_getvar('version'), '210.17022601')): ?>
-
diff --git a/app/modules/web/themes/material-blue/views/notification/notification.inc b/app/modules/web/themes/material-blue/views/notification/notification.inc
index 23d8ada3..e29a46fe 100644
--- a/app/modules/web/themes/material-blue/views/notification/notification.inc
+++ b/app/modules/web/themes/material-blue/views/notification/notification.inc
@@ -35,7 +35,7 @@ use SP\Domain\Core\UI\ThemeIconsInterface;
use SP\Domain\Notification\Models\Notification;
use SP\Mvc\View\Components\SelectItem;
use SP\Mvc\View\TemplateInterface;
-use SP\Util\DateUtil;
+use SP\Util\Date;
$notification = $_getvar('notification');
?>
@@ -98,7 +98,7 @@ $notification = $_getvar('notification');
name="notification_date" type="text"
class="mdl-textfield__input mdl-color-text--indigo-400"
value="getDate()); ?>"
+ echo Date::getDateFromUnix($notification->getDate()); ?>"
>