GetLibraryConfig
4 posts
• Page 1 of 1
GetLibraryConfig
When I compile this very simple script
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. -->
But I still get the exception, what could be the problem?
- 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
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
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. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
Re: GetLibraryConfig
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
It seems like there is PhpNetClassLibrary during compilation, but not during runtime.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 34 guests