Using PHP 'define' in Phalanger
2 posts
• Page 1 of 1
Using PHP 'define' in Phalanger
I need to define some constants in a Phalanger class. For example:
define("HEADER", TRUE)
When I compile the class, I get a compiler error along the lines of 'define is not recognized'.
What am I missing here?
Thanks!
define("HEADER", TRUE)
When I compile the class, I get a compiler error along the lines of 'define is not recognized'.
What am I missing here?
Thanks!
- MX26
- Posts: 18
- Joined: May 14th, 2014, 4:49 pm
Re: Using PHP 'define' in Phalanger
Hi,
"define" is a functions declared in PhpNetClasslibrary.dll. Ensure this extension is referenced (it should be by default unless you have broken machine.config file) In your app.config or web.config or machine.config (C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config and C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config) should be following piece of configuration at the end of the file:
BTW you can define constants using 'const' keyword.
Thanks,
"define" is a functions declared in PhpNetClasslibrary.dll. Ensure this extension is referenced (it should be by default unless you have broken machine.config file) In your app.config or web.config or machine.config (C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config and C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config) should be following piece of configuration at the end of the file:
- Code: Select all
<phpNet>
<classLibrary>
<add assembly="PhpNetClassLibrary, Version=4.0.0.0, Culture=neutral, PublicKeyToken=4af37afe3cde05fb"/>
BTW you can define constants using 'const' keyword.
Thanks,
Jakub Misek │ DEVSENSE s.r.o. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 6 guests