Skip to content

Conversation

@localheinz
Copy link
Contributor

@localheinz localheinz commented Jun 28, 2022

This pull request

  • moves a previously introduced class into 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.


const WEBROOT = "https://www.php.net";
const PHPWEB = __DIR__ . '/../';
const PHPWEB = __DIR__ . '/../../';
Copy link
Contributor Author

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.


require(__DIR__ . '/../include/news_entry.inc');
use phpweb\news\Entry;
require_once __DIR__ . '/../src/news/Entry.php';
Copy link
Contributor Author

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?

Copy link
Member

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).

Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@kamil-tekiela kamil-tekiela merged commit d6f23ea into php:master Jun 29, 2022
@localheinz
Copy link
Contributor Author

Thank you, @cmb69 and @kamil-tekiela!

@localheinz localheinz deleted the fix/move branch June 29, 2022 18:16
@localheinz localheinz mentioned this pull request Jul 3, 2022
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants