-
-
Notifications
You must be signed in to change notification settings - Fork 665
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
add prefix in @:phpConstants #5006
Conversation
This adds the possibility to add a prefix in
And you get: |
What's that |
Global namespace. You can also use |
Hm, I just saw, that |
Ah, using |
Hm, strange. I added another comment 2 days ago, don't know where that went. As I wrote in #4876: It would be nice to have this error fixed, because being able to define externs in the global namespace is a real improvement for the php target, I think. |
Hmm, I'm not sure if that part of the typer should come across type paths that have been influenced by I wonder if there's a missing check for |
The compilation server should correctly restore the original class name since it does save/restore cl_path |
But I think that's quite a bad idea to have clashing names to classes, we definitely don't want to support that. Why not using @:native("\SOAP_SSL_METHOD_") ? |
What is the module type path?
Maybe. As I said: no errors in normal compilation. I wouldn't have made that PR otherwise.
Again: What is the original class name?
But these are only the extern native names or paths...
Because that would generate: The thing is: PHP has lots of functions, constants and what not in the global namespace. It would be nice to be able to use them directly from Haxe with extern classes and abstracts (just like you can in other targets). And basically it works quite well. There's only this problem with the compilation server. Could you have a look at it mabe? |
@mockey I think it's a bad idea in general to rely on same class names not clashing, this might break anytime in future haxe updates and we don't have to have to support this exception. Try to find another way to get the same result without using @:native |
I'm not sure if I would consider "" or "" as real class names.
What about a PHP-specific solution then with an own metadata like |
@mockey using @:native will change the internal class name in haxe system A PHP-specific solution is ok. |
No description provided.