-
Notifications
You must be signed in to change notification settings - Fork 562
Fix: Move class into src/
#581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/news/Entry.php
Outdated
@@ -11,7 +11,7 @@ class Entry { | |||
]; | |||
|
|||
const WEBROOT = "https://www.php.net"; | |||
const PHPWEB = __DIR__ . '/../'; | |||
const PHPWEB = __DIR__ . '/../../'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run
bin/createNewsEntry
and
bin/createReleaseEntry
to confirm that this still works as expected.
bin/createNewsEntry
Outdated
@@ -2,8 +2,9 @@ | |||
<?php | |||
PHP_SAPI == 'cli' or die("Please run this script using the cli sapi"); | |||
|
|||
require(__DIR__ . '/../include/news_entry.inc'); | |||
use phpweb\news\Entry; | |||
require_once __DIR__ . '/../src/news/Entry.php'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
require_once
should also suffice, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually better (a second require/include would fail due to class is already defined).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Thank you, @cmb69 and @kamil-tekiela! |
This pull request
src/
πββοΈ Given #579, it could make sense to start moving (and extracting additional) classes into
src/
.Sooner or later we could even add auto-loading, instead of relying on
require
statements.Examples of PSR-4 autoloader implementations can be found here.