GetLibraryConfig

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

GetLibraryConfig

Postby Muis » July 13th, 2012, 6:08 pm

When I compile this very simple script

Code: Select all
echo date('l jS \of F Y h:i:s A');


using Phalanger 3.0 to a console application, I get the following exception:

Unhandled Exception: PHP.Core.PhpNetInternalException: Guarded call ---> System.
ArgumentNullException: Value cannot be null.
Parameter name: descriptor
at PHP.Core.LocalConfiguration.GetLibraryConfig(PhpLibraryDescriptor descriptor)
at PHP.Library.PhpTimeZone.CurrentTimeZoneCache.DetermineTimeZone(Func`2& hangedFunc)
at PHP.Library.PhpTimeZone.CurrentTimeZoneCache.get_TimeZone()
at PHP.Library.PhpDateTime.FormatDate(String format)
at <d:/test.php>.<Script>.<Main>(ScriptContext <context>, Dictionary`2 <locals>, DObject <self>, DTypeDesc <includer>, Boolean <request>)
at PHP.Core.ScriptContext.GuardedMain(Object mainRoutine)
at PHP.Core.ScriptContext.GuardedCall[TData,TResult](Converter`2 routine, TData data, Boolean allowUserExceptions)
--- End of inner exception stack trace ---
at PHP.Core.ScriptContext.GuardedCall[TData,TResult](Converter`2 routine, TData data, Boolean allowUserExceptions)
at PHP.Core.ScriptContext.RunApplication(Delegate mainRoutine, String relativeSourcePath, String sourceRoot)
at <Global>.Run(String[] )

The reason seems to be the .config file, so I made it as simple as possible:

<!-- Phalanger configuration iutf-8hine.config file. -->

Code: Select all
<configuration>

<phpNet>
    <paths>
   <set name="DynamicWrappers" value="."/>
   <set name="Libraries" value="."/>         
   <set name="ExtManager" value="."/>
   <set name="ExtWrappers" value="."/>
   <set name="ExtTypeDefs" value="."/>
   <set name="ExtNatives" value="."/>
    </paths>
   
    <classLibrary>
      <add assembly="PhpNetClassLibrary, Version=3.0.0.0, Culture=neutral, PublicKeyToken=4af37afe3cde05fb" section="bcl" />
    </classLibrary>   
  </phpNet> 

</configuration>   


But I still get the exception, what could be the problem?
Muis
 
Posts: 2
Joined: July 13th, 2012, 6:03 pm

Re: GetLibraryConfig

Postby Jakub Misek » July 13th, 2012, 6:42 pm

Are there any modifications in your Phalanger sources?

This exception could not happen. Once PhpNetClassLibrary is loaded, Parameter name: descriptor is never null. I was unable to reproduce the problem. (maybe you compile with PhpNetClassLibrary in .config, and then running without PhpNetClassLibrary in .config?)

If you can debug this:
\Source\ClassLibrary\LibraryDescriptor.cs, line 68
should be called before
\Source\ClassLibrary\DateTime.CLR\DateTime.cs, line 333
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: GetLibraryConfig

Postby Muis » July 13th, 2012, 7:38 pm

Jakub Misek wrote:Are there any modifications in your Phalanger sources?


No, the standard binaries in Phalanger 3.0 2012-06-13.zip that I downloaded today.

Jakub Misek wrote:This exception could not happen. Once PhpNetClassLibrary is loaded, Parameter name: descriptor is never null. I was unable to reproduce the problem. (maybe you compile with PhpNetClassLibrary in .config, and then running without PhpNetClassLibrary in .config?)


If PhpNetClassLibrary in missing from .config during compilation, i get the 'undefined call to function date()' message when running the .exe file. Also, when replacing date() with phpinfo(), everything works fine. So it seems to have something to do with the date() call.
Muis
 
Posts: 2
Joined: July 13th, 2012, 6:03 pm

Re: GetLibraryConfig

Postby Jakub Misek » July 13th, 2012, 9:23 pm

It seems like there is PhpNetClassLibrary during compilation, but not during runtime.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague


Return to Phalanger project

Who is online

Users browsing this forum: No registered users and 13 guests

cron

User Control Panel

Login

Who is online

In total there are 13 users online :: 0 registered, 0 hidden and 13 guests (based on users active over the past 5 minutes)
Most users ever online was 297 on March 29th, 2024, 7:06 am

Users browsing this forum: No registered users and 13 guests