[web-php] master: Fix autoload redirect failure (#788)
| From: | Lu Fei via GitHub | Date: | Mon, 26 Jun 2023 13:32:48 +0000 |
| Subject: | [web-php] master: Fix autoload redirect failure (#788) | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-30902@lists.php.net to get a copy of this message | ||
Author: Lu Fei (sy-records)
Committer: GitHub (web-flow)
Pusher: Girgias
Date: 2023-06-26T14:19:29+01:00
Commit: https://github.com/php/web-php/commit/bf7eff4a9cce342b6aa5fbeef92affcf56a378c8
Raw diff: https://github.com/php/web-php/commit/bf7eff4a9cce342b6aa5fbeef92affcf56a378c8.diff
Fix autoload redirect failure (#788)
Changed paths:
A src/autoload.php
D autoload.php
M bin/createNewsEntry
M bin/createReleaseEntry
M include/shared-manual.inc
M tests/UserNotes/Sorter/sort-no-notes.phpt
M tests/UserNotes/Sorter/sort-notes-full.phpt
M tests/UserNotes/Sorter/sort-single-note-with-no-votes.phpt
M tests/UserNotes/Sorter/sort-some-notes.phpt
Diff:
diff --git a/bin/createNewsEntry b/bin/createNewsEntry
index baae69935f..2e0209e851 100755
--- a/bin/createNewsEntry
+++ b/bin/createNewsEntry
@@ -2,7 +2,7 @@
<?php
PHP_SAPI == 'cli' or die("Please run this script using the cli sapi");
-require_once __DIR__ . '/../autoload.php';
+require_once __DIR__ . '/../src/autoload.php';
use phpweb\News\Entry;
diff --git a/bin/createReleaseEntry b/bin/createReleaseEntry
index cd98b83d04..38d8fa7941 100755
--- a/bin/createReleaseEntry
+++ b/bin/createReleaseEntry
@@ -2,7 +2,7 @@
<?php
PHP_SAPI == 'cli' or die("Please run this script using the cli sapi");
-require_once __DIR__ . '/../autoload.php';
+require_once __DIR__ . '/../src/autoload.php';
use phpweb\News\Entry;
diff --git a/include/shared-manual.inc b/include/shared-manual.inc
index 5b973140e2..8e457b7648 100644
--- a/include/shared-manual.inc
+++ b/include/shared-manual.inc
@@ -22,7 +22,7 @@ $PGI = []; $SIDEBAR_DATA = '';
// User note display functions
// =============================================================================
-require_once __DIR__ . '/../autoload.php';
+require_once __DIR__ . '/../src/autoload.php';
use phpweb\UserNotes\Sorter;
use phpweb\UserNotes\UserNote;
diff --git a/autoload.php b/src/autoload.php
similarity index 94%
rename from autoload.php
rename to src/autoload.php
index 5625b60623..7ae42625c3 100644
--- a/autoload.php
+++ b/src/autoload.php
@@ -5,7 +5,7 @@
*/
spl_autoload_register(static function (string $class): void {
$prefix = 'phpweb\\';
- $directory = __DIR__ . '/src/';
+ $directory = __DIR__ . '/';
$length = strlen($prefix);
diff --git a/tests/UserNotes/Sorter/sort-no-notes.phpt b/tests/UserNotes/Sorter/sort-no-notes.phpt
index 3162da17dd..2bfc988c07 100644
--- a/tests/UserNotes/Sorter/sort-no-notes.phpt
+++ b/tests/UserNotes/Sorter/sort-no-notes.phpt
@@ -8,7 +8,7 @@ precision=-1
use phpweb\UserNotes\Sorter;
use phpweb\UserNotes\UserNote;
-require_once __DIR__ . "/../../../autoload.php";
+require_once __DIR__ . "/../../../src/autoload.php";
$notes = [];
diff --git a/tests/UserNotes/Sorter/sort-notes-full.phpt
b/tests/UserNotes/Sorter/sort-notes-full.phpt
index 31328a6cdf..008d790845 100644
--- a/tests/UserNotes/Sorter/sort-notes-full.phpt
+++ b/tests/UserNotes/Sorter/sort-notes-full.phpt
@@ -8,7 +8,7 @@ precision=-1
use phpweb\UserNotes\Sorter;
use phpweb\UserNotes\UserNote;
-require_once __DIR__ . "/../../../autoload.php";
+require_once __DIR__ . "/../../../src/autoload.php";
$file = file(__DIR__ . "/../../../backend/notes/d7/d7742c269d23ea86");
$notes = [];
diff --git a/tests/UserNotes/Sorter/sort-single-note-with-no-votes.phpt
b/tests/UserNotes/Sorter/sort-single-note-with-no-votes.phpt
index 5e13ef5691..2c02366f35 100644
--- a/tests/UserNotes/Sorter/sort-single-note-with-no-votes.phpt
+++ b/tests/UserNotes/Sorter/sort-single-note-with-no-votes.phpt
@@ -8,7 +8,7 @@ precision=-1
use phpweb\UserNotes\Sorter;
use phpweb\UserNotes\UserNote;
-require_once __DIR__ . "/../../../autoload.php";
+require_once __DIR__ . "/../../../src/autoload.php";
$notes = [
new UserNote('1', '', '', '1613487094', '',
'', 0, 0),
diff --git a/tests/UserNotes/Sorter/sort-some-notes.phpt
b/tests/UserNotes/Sorter/sort-some-notes.phpt
index 108a8fb90a..02f7d53211 100644
--- a/tests/UserNotes/Sorter/sort-some-notes.phpt
+++ b/tests/UserNotes/Sorter/sort-some-notes.phpt
@@ -8,7 +8,7 @@ precision=-1
use phpweb\UserNotes\Sorter;
use phpweb\UserNotes\UserNote;
-require_once __DIR__ . "/../../../autoload.php";
+require_once __DIR__ . "/../../../src/autoload.php";
$notes = [
new UserNote('1', '', '', '1613487094', '',
'', 0, 2),