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 Jakub Misek » May 4th, 2014, 10:00 am

If you add file containing
Code: Select all
<?php [assembly:\Export]class someclassname{}
you can then make it much simpler, like
Code: Select all
var parser = new WikiLingo.Parser();
var output = parser.parse("bold");


.NET reg.expr. are greedy by default I assume, you would have to specify PCRE_UNGREEDY (\U) to make it ungreedy? Any unsupported modifier would be reported in runtime as a warning.
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 » May 5th, 2014, 2:48 pm

Is there no chance of using Perl-Compatible Regular Expressions, as php does for regexp?
RobertPlummer
 
Posts: 37
Joined: April 7th, 2014, 1:45 pm

Re: dll will not recignize using pure mode in phpcore

Postby Jakub Misek » May 5th, 2014, 3:05 pm

RobertPlummer wrote:Is there no chance of using Perl-Compatible Regular Expressions, as php does for regexp?
Do you have any test case for preg_match that behave differently under PHP and Phalanger?

Thanks,
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 » May 5th, 2014, 8:17 pm

I'm to the point where I can parse, but no matches are being found. I'm so close! There is an attribute of the WikiLingo\Parser class, called "matches", it should be full of matches, but nothing is being matched from the regex that I am I using. None of the regex I'm using is too complex. How would I move forward to debug effectively?

Thanks for all your help Jakub!
RobertPlummer
 
Posts: 37
Joined: April 7th, 2014, 1:45 pm

Re: dll will not recignize using pure mode in phpcore

Postby RobertPlummer » May 5th, 2014, 8:22 pm

RobertPlummer
 
Posts: 37
Joined: April 7th, 2014, 1:45 pm

Re: dll will not recignize using pure mode in phpcore

Postby Jakub Misek » May 9th, 2014, 11:08 am

That looks great!

You can put a breakpoint on that regex (e.g. preg_match, not sure where it is exactly) if it is being executed and you can add some debug output to see the regular expression.

I would then try the same expression in PHP and in Phalanger, to see the difference.

Thanks,
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 » May 26th, 2014, 4:01 pm

An exception of type 'PHP.Core.PhpException' occurred in PhpNetCore.dll but was not handled in user code


The error:
Additional information: Call to undefined function: 'WikiLingo\ini_get'


And what throws it:
Code: Select all
$this->pcreRecursionLimit = ini_get("pcre.recursion_limit");


What do I do now?
RobertPlummer
 
Posts: 37
Joined: April 7th, 2014, 1:45 pm

Re: dll will not recignize using pure mode in phpcore

Postby Jakub Misek » May 27th, 2014, 9:01 am

Hi,

you didn't add reference to PhpNetClasslibrary.dll (C:\Windows\Microsoft.NET\assembly\GAC_MSIL\PhpNetClassLibrary\v4.0_4.0.0.0__4af37afe3cde05fb )
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 » May 28th, 2014, 1:42 pm

Wanna bet? ;)

Code: Select all
<ItemGroup>
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="PhpNetClassLibrary, Version=4.0.0.0, Culture=neutral, PublicKeyToken=4af37afe3cde05fb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\Phalanger\Source\ClassLibrary\obj\Debug)\PhpNetClassLibrary.dll</HintPath>
    </Reference>
    <Reference Include="PhpNetCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0a8e8c4c76728c71, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\Phalanger\Source\Core\obj\Debug)\PhpNetCore.dll</HintPath>
    </Reference>
    <Reference Include="PhpNetCore.CodeDom, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0a8e8c4c76728c71, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\Phalanger\Source\Core.CodeDom\obj\Debug)\PhpNetCore.CodeDom.dll</HintPath>
    </Reference>
    <Reference Include="PhpNetCore.DuckTyping, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0a8e8c4c76728c71, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\Phalanger\Source\Core.DuckTyping\obj\Debug)\PhpNetCore.DuckTyping.dll</HintPath>
    </Reference>
    <Reference Include="PhpNetCore.Parsers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0a8e8c4c76728c71, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\Phalanger\Source\Core.Parsers\obj\Debug)\PhpNetCore.Parsers.dll</HintPath>
    </Reference>
    <Reference Include="PhpNetCurl, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2771987119c16a03, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\Phalanger\Source\Extensions\Curl\obj\Debug)\PhpNetCurl.dll</HintPath>
    </Reference>
    <Reference Include="PhpNetGd2, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2771987119c16a03, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\Phalanger\Source\Extensions\Gd2\obj\Debug)\PhpNetGd2.dll</HintPath>
    </Reference>
    <Reference Include="PhpNetMbstring, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2771987119c16a03, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\Phalanger\Source\Extensions\mbstring\obj\Debug)\PhpNetMbstring.dll</HintPath>
    </Reference>
    <Reference Include="PhpNetZip, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2771987119c16a03, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\Phalanger\Source\Extensions\Zip\obj\Debug)\PhpNetZip.dll</HintPath>
    </Reference>
    <Reference Include="System.Web.DynamicData" />
    <Reference Include="System.Web.Entity" />
    <Reference Include="System.Web.ApplicationServices" />
    <Reference Include="System.ComponentModel.DataAnnotations" />
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Core" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="System.Web.Extensions" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Web" />
    <Reference Include="System.Xml" />
    <Reference Include="System.Configuration" />
    <Reference Include="System.Web.Services" />
    <Reference Include="System.EnterpriseServices" />
    <Reference Include="WikiLingo, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\wikiLingo.net\WikiLingo.dll</HintPath>
    </Reference>
  </ItemGroup>
RobertPlummer
 
Posts: 37
Joined: April 7th, 2014, 1:45 pm

Re: dll will not recignize using pure mode in phpcore

Postby Jakub Misek » May 28th, 2014, 2:12 pm

The reference must be added for the PHP project as well.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

PreviousNext

Return to Phalanger project

Who is online

Users browsing this forum: No registered users and 2 guests

cron

User Control Panel

Login

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 5 minutes)
Most users ever online was 124 on September 25th, 2020, 6:57 am

Users browsing this forum: No registered users and 2 guests