Page 4 of 5

Re: dll will not recignize using pure mode in phpcore

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

Re: dll will not recignize using pure mode in phpcore

PostPosted: May 5th, 2014, 2:48 pm
by RobertPlummer
Is there no chance of using Perl-Compatible Regular Expressions, as php does for regexp?

Re: dll will not recignize using pure mode in phpcore

PostPosted: May 5th, 2014, 3:05 pm
by Jakub Misek
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,

Re: dll will not recignize using pure mode in phpcore

PostPosted: May 5th, 2014, 8:17 pm
by RobertPlummer
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!

Re: dll will not recignize using pure mode in phpcore

PostPosted: May 5th, 2014, 8:22 pm
by RobertPlummer

Re: dll will not recignize using pure mode in phpcore

PostPosted: May 9th, 2014, 11:08 am
by Jakub Misek
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,

Re: dll will not recignize using pure mode in phpcore

PostPosted: May 26th, 2014, 4:01 pm
by RobertPlummer
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?

Re: dll will not recignize using pure mode in phpcore

PostPosted: May 27th, 2014, 9:01 am
by Jakub Misek
Hi,

you didn't add reference to PhpNetClasslibrary.dll (C:\Windows\Microsoft.NET\assembly\GAC_MSIL\PhpNetClassLibrary\v4.0_4.0.0.0__4af37afe3cde05fb )

Re: dll will not recignize using pure mode in phpcore

PostPosted: May 28th, 2014, 1:42 pm
by RobertPlummer
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>

Re: dll will not recignize using pure mode in phpcore

PostPosted: May 28th, 2014, 2:12 pm
by Jakub Misek
The reference must be added for the PHP project as well.