]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Move utils classes to Shaarli\Helper namespace and folder
authorArthurHoaro <arthur@hoa.ro>
Fri, 16 Oct 2020 11:34:59 +0000 (13:34 +0200)
committerArthurHoaro <arthur@hoa.ro>
Tue, 27 Oct 2020 18:41:38 +0000 (19:41 +0100)
15 files changed:
application/History.php
application/front/controller/visitor/InstallController.php
application/helper/ApplicationUtils.php [moved from application/ApplicationUtils.php with 99% similarity]
application/helper/FileUtils.php [moved from application/FileUtils.php with 99% similarity]
application/legacy/LegacyLinkDB.php
application/legacy/LegacyUpdater.php
application/render/PageBuilder.php
application/security/BanManager.php
composer.json
init.php
tests/helper/ApplicationUtilsTest.php [moved from tests/ApplicationUtilsTest.php with 99% similarity]
tests/helper/FileUtilsTest.php [moved from tests/FileUtilsTest.php with 99% similarity]
tests/security/BanManagerTest.php
tests/utils/FakeApplicationUtils.php
tests/utils/ReferenceHistory.php

index 4fd2f29444ea8a6122740a25f77fc97847e868d4..bd5c1bf7318b63cec18905f99075b5c3a89c3a40 100644 (file)
@@ -4,6 +4,7 @@ namespace Shaarli;
 use DateTime;
 use Exception;
 use Shaarli\Bookmark\Bookmark;
+use Shaarli\Helper\FileUtils;
 
 /**
  * Class History
index 564a577740795b5a23ec826152d93611035a77e9..223292946657169ebd1f42d82afcc5c4971bd46e 100644 (file)
@@ -4,10 +4,10 @@ declare(strict_types=1);
 
 namespace Shaarli\Front\Controller\Visitor;
 
-use Shaarli\ApplicationUtils;
 use Shaarli\Container\ShaarliContainer;
 use Shaarli\Front\Exception\AlreadyInstalledException;
 use Shaarli\Front\Exception\ResourcePermissionException;
+use Shaarli\Helper\ApplicationUtils;
 use Shaarli\Languages;
 use Shaarli\Security\SessionManager;
 use Slim\Http\Request;
similarity index 99%
rename from application/ApplicationUtils.php
rename to application/helper/ApplicationUtils.php
index bd1c7cf3f42a06a427d817821c5c9a058f549aba..4b34e114caf380d7c6cf28512c908c200f299b88 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-namespace Shaarli;
+namespace Shaarli\Helper;
 
 use Exception;
 use Shaarli\Config\ConfigManager;
similarity index 99%
rename from application/FileUtils.php
rename to application/helper/FileUtils.php
index 3f940751ccdcc9f7b2f720ee7f04eedc40d83920..2d50d8504af1b68ed975e62dcab390b2caa0f49c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-namespace Shaarli;
+namespace Shaarli\Helper;
 
 use Shaarli\Exceptions\IOException;
 
index 7bf76fd471087fe0477b935b4cb1bf771ae1ab46..5c02a21b48a69222bee6a3543f36f918b95b402e 100644 (file)
@@ -8,7 +8,7 @@ use DateTime;
 use Iterator;
 use Shaarli\Bookmark\Exception\BookmarkNotFoundException;
 use Shaarli\Exceptions\IOException;
-use Shaarli\FileUtils;
+use Shaarli\Helper\FileUtils;
 use Shaarli\Render\PageCacheManager;
 
 /**
index 0ab3a55bd572898b07e51099fc8bd7ae23f5d7fe..fe1a286fdb02bbcc0d559210b867f7b9602a3d0a 100644 (file)
@@ -7,7 +7,6 @@ use RainTPL;
 use ReflectionClass;
 use ReflectionException;
 use ReflectionMethod;
-use Shaarli\ApplicationUtils;
 use Shaarli\Bookmark\Bookmark;
 use Shaarli\Bookmark\BookmarkArray;
 use Shaarli\Bookmark\BookmarkFilter;
@@ -17,6 +16,7 @@ use Shaarli\Config\ConfigJson;
 use Shaarli\Config\ConfigManager;
 use Shaarli\Config\ConfigPhp;
 use Shaarli\Exceptions\IOException;
+use Shaarli\Helper\ApplicationUtils;
 use Shaarli\Thumbnailer;
 use Shaarli\Updater\Exception\UpdaterException;
 
index 512bb79e3555cc4833566af10822cea5be67b649..25e0e284cb3415dcb511794dba8cbc9e276a3d5d 100644 (file)
@@ -5,9 +5,9 @@ namespace Shaarli\Render;
 use Exception;
 use Psr\Log\LoggerInterface;
 use RainTPL;
-use Shaarli\ApplicationUtils;
 use Shaarli\Bookmark\BookmarkServiceInterface;
 use Shaarli\Config\ConfigManager;
+use Shaarli\Helper\ApplicationUtils;
 use Shaarli\Security\SessionManager;
 use Shaarli\Thumbnailer;
 
index f72c8b7b8a1643c87c2f92e8ffcad8fef4385b37..288cbde05fd2e77009b6622b8669729d02903ba6 100644 (file)
@@ -4,7 +4,7 @@
 namespace Shaarli\Security;
 
 use Psr\Log\LoggerInterface;
-use Shaarli\FileUtils;
+use Shaarli\Helper\FileUtils;
 
 /**
  * Class BanManager
index 64f0025ed6d540510d210f511eaa58824269ca90..9449258668054f396bf86816282880b1fd83b302 100644 (file)
@@ -59,6 +59,7 @@
             "Shaarli\\Front\\Controller\\Admin\\": "application/front/controller/admin",
             "Shaarli\\Front\\Controller\\Visitor\\": "application/front/controller/visitor",
             "Shaarli\\Front\\Exception\\": "application/front/exceptions",
+            "Shaarli\\Helper\\": "application/helper",
             "Shaarli\\Http\\": "application/http",
             "Shaarli\\Legacy\\": "application/legacy",
             "Shaarli\\Netscape\\": "application/netscape",
index ab0e4ea743648684298d048a1e2e01ea7f9c9d02..d84627129516969bff1e1baed69540d415aea369 100644 (file)
--- a/init.php
+++ b/init.php
@@ -2,7 +2,7 @@
 
 require_once __DIR__ . '/vendor/autoload.php';
 
-use Shaarli\ApplicationUtils;
+use Shaarli\Helper\ApplicationUtils;
 use Shaarli\Security\SessionManager;
 
 // Set 'UTC' as the default timezone if it is not defined in php.ini
similarity index 99%
rename from tests/ApplicationUtilsTest.php
rename to tests/helper/ApplicationUtilsTest.php
index ac46cbf129df09479f039d44f3eeee3784b299be..654857b944e7925cfd81b1cd915600495fea9f2a 100644 (file)
@@ -1,7 +1,8 @@
 <?php
-namespace Shaarli;
+namespace Shaarli\Helper;
 
 use Shaarli\Config\ConfigManager;
+use Shaarli\FakeApplicationUtils;
 
 require_once 'tests/utils/FakeApplicationUtils.php';
 
similarity index 99%
rename from tests/FileUtilsTest.php
rename to tests/helper/FileUtilsTest.php
index 3384504a70c1d5daaff727c8655ce6a317786a36..948e46d1a404971addb7a658d199707a9f9d4783 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-namespace Shaarli;
+namespace Shaarli\Helper;
 
 use Exception;
 use Shaarli\Exceptions\IOException;
index 22aa86661ad8309edc6ecf245c9833b9c14898c8..29d2791b0198b1ec3b8787799b6f51f860e60381 100644 (file)
@@ -4,7 +4,7 @@
 namespace Shaarli\Security;
 
 use Psr\Log\LoggerInterface;
-use Shaarli\FileUtils;
+use Shaarli\Helper\FileUtils;
 use Shaarli\TestCase;
 
 /**
index de83d598575a9af23c335a0aa32ee770042c2399..d5289ede2c735afcb8aceb4a14d2c7a7e5e5f9a4 100644 (file)
@@ -2,6 +2,8 @@
 
 namespace Shaarli;
 
+use Shaarli\Helper\ApplicationUtils;
+
 /**
  * Fake ApplicationUtils class to avoid HTTP requests
  */
index 516c9f51ea22d195bf71f70bcc9b786c083beade..aed5d2cf1a8baa85f16d8c53dff653f8cf98345c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-use Shaarli\FileUtils;
+use Shaarli\Helper\FileUtils;
 use Shaarli\History;
 
 /**