88 * License: GNU/GPLv2
99 * @see LICENSE.txt
1010 *
11- * This file: The loader (last modified: 2026.03.17 ).
11+ * This file: The loader (last modified: 2026.03.18 ).
1212 */
1313
1414namespace phpMussel \Core ;
@@ -166,12 +166,12 @@ class Loader
166166 /**
167167 * @var string The path to the core asset files.
168168 */
169- private $ AssetsPath = __DIR__ . DIRECTORY_SEPARATOR . '.. ' . DIRECTORY_SEPARATOR . 'assets ' . DIRECTORY_SEPARATOR ;
169+ private $ AssetsPath = __DIR__ . \ DIRECTORY_SEPARATOR . '.. ' . \ DIRECTORY_SEPARATOR . 'assets ' . \ DIRECTORY_SEPARATOR ;
170170
171171 /**
172172 * @var string The path to the core L10N files.
173173 */
174- private $ L10NPath = __DIR__ . DIRECTORY_SEPARATOR . '.. ' . DIRECTORY_SEPARATOR . 'l10n ' . DIRECTORY_SEPARATOR ;
174+ private $ L10NPath = __DIR__ . \ DIRECTORY_SEPARATOR . '.. ' . \ DIRECTORY_SEPARATOR . 'l10n ' . \ DIRECTORY_SEPARATOR ;
175175
176176 /**
177177 * @var array Channels information for request.
@@ -221,7 +221,7 @@ public function __construct(
221221
222222 /** Fallback to try for undefined VendorPath. */
223223 if (!$ VendorPath ) {
224- $ VendorPath = __DIR__ . DIRECTORY_SEPARATOR . '.. ' . DIRECTORY_SEPARATOR . '.. ' . DIRECTORY_SEPARATOR . '.. ' . DIRECTORY_SEPARATOR . '.. ' . DIRECTORY_SEPARATOR . 'vendor ' ;
224+ $ VendorPath = __DIR__ . \ DIRECTORY_SEPARATOR . '.. ' . \ DIRECTORY_SEPARATOR . '.. ' . \ DIRECTORY_SEPARATOR . '.. ' . \ DIRECTORY_SEPARATOR . '.. ' . \ DIRECTORY_SEPARATOR . 'vendor ' ;
225225 }
226226
227227 /** The specified vendor directory doesn't exist or isn't readable. */
@@ -233,7 +233,7 @@ public function __construct(
233233
234234
235235 /** Safeguard for symlinked installations. */
236- $ VendorPath = $ this ->buildPath (\dirname ($ _SERVER ['DOCUMENT_ROOT ' ] . $ _SERVER ['SCRIPT_NAME ' ]) . DIRECTORY_SEPARATOR . 'vendor ' , false );
236+ $ VendorPath = $ this ->buildPath (\dirname ($ _SERVER ['DOCUMENT_ROOT ' ] . $ _SERVER ['SCRIPT_NAME ' ]) . \ DIRECTORY_SEPARATOR . 'vendor ' , false );
237237
238238 /** Eep.. Still not working. Generate exception. */
239239 if ($ VendorPath === '' || !\is_dir ($ VendorPath ) || !\is_readable ($ VendorPath )) {
@@ -281,10 +281,10 @@ public function __construct(
281281 /** Calculate configuration path. */
282282 if ($ ConfigurationPath && \is_readable ($ ConfigurationPath )) {
283283 $ this ->ConfigurationPath = $ ConfigurationPath ;
284- } elseif ($ VendorPath && \is_readable ($ VendorPath . DIRECTORY_SEPARATOR . '.. ' . DIRECTORY_SEPARATOR . 'phpmussel.ini ' )) {
285- $ this ->ConfigurationPath = $ VendorPath . DIRECTORY_SEPARATOR . '.. ' . DIRECTORY_SEPARATOR . 'phpmussel.ini ' ;
286- } elseif ($ VendorPath && \is_readable ($ VendorPath . DIRECTORY_SEPARATOR . '.. ' . DIRECTORY_SEPARATOR . 'phpmussel.yml ' )) {
287- $ this ->ConfigurationPath = $ VendorPath . DIRECTORY_SEPARATOR . '.. ' . DIRECTORY_SEPARATOR . 'phpmussel.yml ' ;
284+ } elseif ($ VendorPath && \is_readable ($ VendorPath . \ DIRECTORY_SEPARATOR . '.. ' . \ DIRECTORY_SEPARATOR . 'phpmussel.ini ' )) {
285+ $ this ->ConfigurationPath = $ VendorPath . \ DIRECTORY_SEPARATOR . '.. ' . \ DIRECTORY_SEPARATOR . 'phpmussel.ini ' ;
286+ } elseif ($ VendorPath && \is_readable ($ VendorPath . \ DIRECTORY_SEPARATOR . '.. ' . \ DIRECTORY_SEPARATOR . 'phpmussel.yml ' )) {
287+ $ this ->ConfigurationPath = $ VendorPath . \ DIRECTORY_SEPARATOR . '.. ' . \ DIRECTORY_SEPARATOR . 'phpmussel.yml ' ;
288288 } else {
289289 throw new \Exception ('Unable to locate phpMussel \'s configuration file. ' );
290290 }
@@ -323,13 +323,13 @@ public function __construct(
323323 if (!$ VendorPath ) {
324324 continue ;
325325 }
326- $ $ Path = $ VendorPath . DIRECTORY_SEPARATOR . '.. ' . DIRECTORY_SEPARATOR . 'phpmussel- ' . \strtolower (\substr ($ Path , 0 , -4 ));
326+ $ $ Path = $ VendorPath . \ DIRECTORY_SEPARATOR . '.. ' . \ DIRECTORY_SEPARATOR . 'phpmussel- ' . \strtolower (\substr ($ Path , 0 , -4 ));
327327 }
328328 if (!$ this ->buildPath ($ $ Path , false )) {
329329 throw new \Exception (\sprintf ('Unable to build the path, "%s". ' , $ $ Path ));
330330 }
331331 if (($ End = \substr ($ $ Path , -1 )) && $ End !== '/ ' && $ End !== '\\' ) {
332- $ $ Path .= DIRECTORY_SEPARATOR ;
332+ $ $ Path .= \ DIRECTORY_SEPARATOR ;
333333 }
334334 $ this ->$ Path = $ $ Path ;
335335 }
@@ -811,20 +811,20 @@ public function buildPath(string $Path, bool $PointsToFile = true): string
811811 $ Path = $ this ->timeFormat ($ this ->Time , $ Path );
812812
813813 /** We'll skip is_dir/mkdir calls if open_basedir is populated (to avoid PHP bug #69240). */
814- $ Restrictions = \strlen (ini_get ('open_basedir ' )) > 0 ;
814+ $ Restrictions = \strlen (\ ini_get ('open_basedir ' )) > 0 ;
815815
816816 /** Split path into steps. */
817- $ Steps = \preg_split ('~[ \\\\/]~ ' , $ Path , -1 , PREG_SPLIT_NO_EMPTY );
817+ $ Steps = \preg_split ('~[ \\\\/]~ ' , $ Path , -1 , \ PREG_SPLIT_NO_EMPTY );
818818
819819 /** Separate file from path. */
820820 $ File = $ PointsToFile ? \array_pop ($ Steps ) : '' ;
821821
822822 /** Build directories. */
823823 foreach ($ Steps as $ Step ) {
824824 if (!isset ($ Rebuilt )) {
825- $ Rebuilt = \preg_match ('~^[ \\\\/]~ ' , $ Path ) ? DIRECTORY_SEPARATOR . $ Step : $ Step ;
825+ $ Rebuilt = \preg_match ('~^[ \\\\/]~ ' , $ Path ) ? \ DIRECTORY_SEPARATOR . $ Step : $ Step ;
826826 } else {
827- $ Rebuilt .= DIRECTORY_SEPARATOR . $ Step ;
827+ $ Rebuilt .= \ DIRECTORY_SEPARATOR . $ Step ;
828828 }
829829 if (\preg_match ('~^\.+$~ ' , $ Step )) {
830830 continue ;
@@ -846,7 +846,7 @@ public function buildPath(string $Path, bool $PointsToFile = true): string
846846
847847 /** Append file. */
848848 if ($ File ) {
849- $ Rebuilt .= ($ Rebuilt ? DIRECTORY_SEPARATOR : '' ) . $ File ;
849+ $ Rebuilt .= ($ Rebuilt ? \ DIRECTORY_SEPARATOR : '' ) . $ File ;
850850 }
851851
852852 /** Return the final rebuilt path. */
@@ -1047,8 +1047,8 @@ public function isDirEmpty(string $Directory): bool
10471047 */
10481048 public function deleteDirectory (string $ Dir ): void
10491049 {
1050- while (\strrpos ($ Dir , DIRECTORY_SEPARATOR ) !== false ) {
1051- $ Dir = \substr ($ Dir , 0 , \strrpos ($ Dir , DIRECTORY_SEPARATOR ));
1050+ while (\strrpos ($ Dir , \ DIRECTORY_SEPARATOR ) !== false ) {
1051+ $ Dir = \substr ($ Dir , 0 , \strrpos ($ Dir , \ DIRECTORY_SEPARATOR ));
10521052 if (!\is_dir ($ Dir ) || !$ this ->isDirEmpty ($ Dir )) {
10531053 break ;
10541054 }
@@ -1085,10 +1085,10 @@ public function logRotation(string $Pattern): bool
10851085 $ Files [$ Item ] = \filemtime ($ Item );
10861086 }
10871087 }
1088- $ Count = count ($ Files );
1088+ $ Count = \ count ($ Files );
10891089 $ Err = 0 ;
10901090 if ($ Count > $ Limit ) {
1091- \asort ($ Files , SORT_NUMERIC );
1091+ \asort ($ Files , \ SORT_NUMERIC );
10921092 foreach ($ Files as $ Item => $ Modified ) {
10931093 if ($ Action === 'Archive ' ) {
10941094 $ Err += !$ this ->gZCompressFile ($ Item );
@@ -1114,22 +1114,22 @@ public function logRotation(string $Pattern): bool
11141114 */
11151115 public function resolvePaths (string $ Base , bool $ LastIsFile = true , bool $ GZ = true ): \Generator
11161116 {
1117- $ Steps = \preg_split ('~[ \\\\/]~ ' , $ Base , -1 , PREG_SPLIT_NO_EMPTY );
1117+ $ Steps = \preg_split ('~[ \\\\/]~ ' , $ Base , -1 , \ PREG_SPLIT_NO_EMPTY );
11181118 $ LastStep = $ LastIsFile ? \array_pop ($ Steps ) : '' ;
11191119 $ BaseFrom = '' ;
11201120 $ Remainder = '' ;
11211121 foreach ($ Steps as $ Step ) {
11221122 if (!$ Remainder && \strpos ($ Step , '{ ' ) === false && \strpos ($ Step , '} ' ) === false ) {
1123- $ BaseFrom .= $ Step . DIRECTORY_SEPARATOR ;
1123+ $ BaseFrom .= $ Step . \ DIRECTORY_SEPARATOR ;
11241124 continue ;
11251125 }
1126- $ Remainder .= ($ Remainder ? DIRECTORY_SEPARATOR : '' ) . $ Step ;
1126+ $ Remainder .= ($ Remainder ? \ DIRECTORY_SEPARATOR : '' ) . $ Step ;
11271127 }
11281128 if (!$ BaseFrom || !\is_dir ($ BaseFrom ) || !\is_readable ($ BaseFrom )) {
11291129 return ;
11301130 }
11311131 if ($ Remainder && $ LastStep ) {
1132- $ LastStep = DIRECTORY_SEPARATOR . $ LastStep ;
1132+ $ LastStep = \ DIRECTORY_SEPARATOR . $ LastStep ;
11331133 }
11341134 $ Steps = \preg_replace (
11351135 ['~ \\{(?:dd|mm|yy|hh|ii|ss) \\}~i ' , '~ \\{yyyy \\}~i ' , '~ \\{(?:Day|Mon) \\}~i ' , '~ \\{tz \\}~i ' , '~ \\{t:z \\}~i ' ],
@@ -1309,7 +1309,7 @@ private function initialiseCache(): void
13091309 if (($ End = \substr ($ this ->CachePath , -1 )) === '\\' || $ End === '/ ' ) {
13101310 $ this ->Cache ->FFDefault = $ this ->CachePath . 'cache.dat ' ;
13111311 } else {
1312- $ this ->Cache ->FFDefault = $ this ->CachePath . DIRECTORY_SEPARATOR . 'cache.dat ' ;
1312+ $ this ->Cache ->FFDefault = $ this ->CachePath . \ DIRECTORY_SEPARATOR . 'cache.dat ' ;
13131313 }
13141314 }
13151315
0 commit comments