Error ! Inclusions are not allowed in the pure unit !

Phalanger Tools for Visual Studio [?] is complete PHP/Phalanger integration into Visual Studio development environment.

Error ! Inclusions are not allowed in the pure unit !

Postby Kamb!z » May 24th, 2013, 10:04 am

Hello;

i can solve my past problem in CURL thank you of Jakub Misek :)

but a new problem for me :)

when i use of INCLUDES why don't work standard methods ?

my example of includes are :

simple : include_once 'myclass.php'; or simple : include 'myclass.php';

or include_once dirname(__FILE__).'/methods/method_base.php';

give me : Error 3 Inclusions are not allowed in the pure unit.

how i can fix this problem ?

Thank you for your helps :)
Kamb!z
 
Posts: 3
Joined: May 22nd, 2013, 8:58 am

Re: Error ! Inclusions are not allowed in the pure unit !

Postby Jakub Misek » May 24th, 2013, 2:45 pm

Hi,

'Pure' mode corresponds to C# compilation mode - all the files are as one, you can only code classes, all of them are defined instantly in your program, and inclusions are not necessary.

If you are targeting normal PHP mode, where you have to include files etc., change the compilation mode to 'Standard'

For more information see http://wiki.php-compiler.net/Pure_mode

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: Error ! Inclusions are not allowed in the pure unit !

Postby Kamb!z » May 24th, 2013, 3:00 pm

Jakub Misek wrote:Hi,

'Pure' mode corresponds to C# compilation mode - all the files are as one, you can only code classes, all of them are defined instantly in your program, and inclusions are not necessary.

If you are targeting normal PHP mode, where you have to include files etc., change the compilation mode to 'Standard'

For more information see http://wiki.php-compiler.net/Pure_mode

Thanks,


Sorry i can't understand ! in Standard mode php compiler is standard but i cannot access to Class and function on PHP ! how i can create new instant of PHP Standard mode clases into on my .net c# project? :)
Kamb!z
 
Posts: 3
Joined: May 22nd, 2013, 8:58 am

Re: Error ! Inclusions are not allowed in the pure unit !

Postby Jakub Misek » May 24th, 2013, 3:15 pm

To use standard PHP code from C#, compile PHP in standard mode, and use PHP.Core.ScriptContext API. Of course Pure mode lets you much easier interoperability options, you are just limited with inclusions and global code.

More e.g. at http://www.php-compiler.net/blog/2012/n ... langer-3-0
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 Tools

Who is online

Users browsing this forum: No registered users and 10 guests

cron

User Control Panel

Login

Who is online

In total there are 10 users online :: 0 registered, 0 hidden and 10 guests (based on users active over the past 5 minutes)
Most users ever online was 256 on March 28th, 2024, 9:42 am

Users browsing this forum: No registered users and 10 guests