dll will not recignize using pure mode in phpcore

Discussion about the open-source Phalanger [?] project.

Re: dll will not recignize using pure mode in phpcore

Postby RobertPlummer » April 21st, 2014, 9:07 pm

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

Postby RobertPlummer » April 21st, 2014, 9:13 pm

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

Postby Jakub Misek » April 21st, 2014, 10:28 pm

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.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: dll will not recignize using pure mode in phpcore

Postby RobertPlummer » April 22nd, 2014, 12:47 am

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

Postby RobertPlummer » April 24th, 2014, 3:24 pm

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

Postby RobertPlummer » April 25th, 2014, 12:31 pm

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.
RobertPlummer
 
Posts: 37
Joined: April 7th, 2014, 1:45 pm

Re: dll will not recignize using pure mode in phpcore

Postby Jakub Misek » April 25th, 2014, 7:07 pm

Great you are looking into Phalanger!

.phpx is the same as .php, it just won't confuse other PHP IDEs.

by putting
Code: Select all
[assembly: \Export] class XYZ{}
Phalanger will mar all classes as exported and will generate nice C# methods over PHP functions used internally by Phalanger.

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. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: dll will not recignize using pure mode in phpcore

Postby RobertPlummer » April 28th, 2014, 1:52 am

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

Postby Jakub Misek » April 28th, 2014, 1:20 pm

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. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: dll will not recignize using pure mode in phpcore

Postby RobertPlummer » April 28th, 2014, 1:30 pm

SWEET!!! Trying...
RobertPlummer
 
Posts: 37
Joined: April 7th, 2014, 1:45 pm

PreviousNext

Return to Phalanger project

Who is online

Users browsing this forum: No registered users and 17 guests

cron

User Control Panel

Login

Who is online

In total there are 17 users online :: 0 registered, 0 hidden and 17 guests (based on users active over the past 5 minutes)
Most users ever online was 208 on March 28th, 2024, 8:50 am

Users browsing this forum: No registered users and 17 guests