dll will not recignize using pure mode in phpcore
46 posts
• Page 2 of 5 • 1, 2, 3, 4, 5
Re: dll will not recignize using pure mode in phpcore
If I use "[assembly: \Export]" using phpstorm (the best php IDE out there), it breaks the php. What do you suggest then, moving forward?
- RobertPlummer
- Posts: 37
- Joined: April 7th, 2014, 1:45 pm
Re: dll will not recignize using pure mode in phpcore
Further, that isn't valid php markup, as I get the following:
- Code: Select all
Parse error: syntax error, unexpected '[', expecting function (T_FUNCTION) in /home/robert/Projects/wikiLingo/WikiLingo/Parser.php on line 27
- RobertPlummer
- Posts: 37
- Joined: April 7th, 2014, 1:45 pm
Re: dll will not recignize using pure mode in phpcore
Thats right, some Phalanger language extensions are not compatible with standard PHP.
Assembly-wide attributes like [assembly: \Export] may be defined in separate .phpx file (e.g. AssemblyInfo.phpx), so PHP IDEs would ignore them.
However I agree, so such constructs should be made backward compatible. PHPDoc would be good option.
Assembly-wide attributes like [assembly: \Export] may be defined in separate .phpx file (e.g. AssemblyInfo.phpx), so PHP IDEs would ignore them.
However I agree, so such constructs should be made backward compatible. PHPDoc would be good option.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
Re: dll will not recignize using pure mode in phpcore
Is there any documentation on using phpx? A quick search on GitHub revieled nothing. Do I simply create a file called "AssemblyInfo.phpx" with it's contents "[assembly: \Export]"?
- RobertPlummer
- Posts: 37
- Joined: April 7th, 2014, 1:45 pm
Re: dll will not recignize using pure mode in phpcore
I'd be willing to make the contributions for the comments to be used to assist in exporting the code using the pure mode, but can I get some assistence with where to add these features? Where the existing code is located? Which IDE I should be using? WHen I open in VS 2013, it seems incompatible, and the same with MonoDevelop 4.
- RobertPlummer
- Posts: 37
- Joined: April 7th, 2014, 1:45 pm
Re: dll will not recignize using pure mode in phpcore
I compiled MonoDevelop 4.2.2, and it seems to work nice with Phalanger. So I've found the majority of the parsing. I can now see the PHPDocBlock.cs (Phalanger/Source/Core.Parsers/PHPDocBlock.cs) parser, and the CustomAttributes.cs (Phalanger/Source/Core.Parsers/AST/CustomAttributes.cs) file. I actually have done a bit of work converting Jison (yacc -> bison -> jison) to C#, so I am very familiar with the concepts used here and how parsers and lexers work. The amount of logic being pushed around here is outstanding!
Anyway, I will keep investigating, but any pointers would be nice. It'd be nice if we simply could use a new PHPDoc tag, perhaps "@export", which would trigger what [\Export] does.
Anyway, I will keep investigating, but any pointers would be nice. It'd be nice if we simply could use a new PHPDoc tag, perhaps "@export", which would trigger what [\Export] does.
- RobertPlummer
- Posts: 37
- Joined: April 7th, 2014, 1:45 pm
Re: dll will not recignize using pure mode in phpcore
Great you are looking into Phalanger!
.phpx is the same as .php, it just won't confuse other PHP IDEs.
by putting
Surely use of PHPDoc is possible and easy; just by time Phalanger attributes were designed, there were no support for PHPDoc yet.
.phpx is the same as .php, it just won't confuse other PHP IDEs.
by putting
- Code: Select all
[assembly: \Export] class XYZ{}
Surely use of PHPDoc is possible and easy; just by time Phalanger attributes were designed, there were no support for PHPDoc yet.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
Re: dll will not recignize using pure mode in phpcore
This fake class will trigger the entire folder (all namespaces, classes, etc.) and all nested folders to be exported as a dll?
- RobertPlummer
- Posts: 37
- Joined: April 7th, 2014, 1:45 pm
Re: dll will not recignize using pure mode in phpcore
this attribute marks entire assembly so every PHP method in every class will be wrapped in a C#-like method so they can be called from C# in nicely.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
Re: dll will not recignize using pure mode in phpcore
SWEET!!! Trying...
- RobertPlummer
- Posts: 37
- Joined: April 7th, 2014, 1:45 pm
46 posts
• Page 2 of 5 • 1, 2, 3, 4, 5
Who is online
Users browsing this forum: No registered users and 11 guests