Skip to content
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

WIP: Namespace all PHP files #9481

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

mvorisek
Copy link
Contributor

@mvorisek mvorisek commented Jun 5, 2024

No description provided.

@@ -212,9 +215,13 @@
],
"autoload": {
"classmap": [
"program/unnamespaced-legacy-classes.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.

@alecpl this PR is a draft PR and I would have time to finish it in week or two.

But before I will continue, I want to get your green light about this legacy support and get your feedback.

What I coded already and what you can see now is all global functions and global classes are put under temporary namespace but the functions/classes can still be accessed as before from external/legacy code. Can you please have a look and possibly do some tests to confirm this is working for you before I will continue?

@alecpl
Copy link
Member

alecpl commented Jun 5, 2024

This is scary. Why? Why everywhere?

@mvorisek
Copy link
Contributor Author

mvorisek commented Jun 5, 2024

There are many reasons, one technical is we need namespace for effective autoloading to be able to use PSR-4...

I propose to land this with the legacy autoloader which will imply minimal changes needed and in next major version to require namespaces classes to be used in external projects only.

For more discussion there is this thread: #9481 (comment)

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.

2 participants