using custom .net class in php

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

using custom .net class in php

Postby cadean » August 24th, 2015, 6:45 pm

Hi,

I have searched your support forum and wiki, but unfortunately my search terms are not specific enough to find anything useful. I have a need to execute custom .net c# classes from our php code. When I enter the php "use" keyword your tool displays a list of the Microsoft .net classes, but does not display my own custom classes. Do you have documentation, or a wiki article, that describes the steps I must follow to render my classes available in the php "use" statement? I have added my projects as References to the project as created from your Phalanger "Empty Wen Application" template, but this did not help.

Thanks!
cadean
 
Posts: 2
Joined: August 24th, 2015, 6:32 pm

Re: using custom .net class in php

Postby cadean » August 25th, 2015, 4:14 pm

Hi,

Attached is a picture of the current failure. Note that I am not a PHP developer, but my team will be supporting a PHP team with our custom .NET class libraries.

There is a generated metadata file that appears to be accurate:
<?php // Generated code

namespace Intel\IT\EAAS\LCap\Services\Aurora\Common;

class CPassport
{
#region Functions

/**
*
* @param mixed $objA
* @param mixed $objB
*
* @return bool
*/
public function Equals($objA, $objB) { /* function body is hidden */ }

/**
*
* @return void
*/
protected function Finalize() { /* function body is hidden */ }

/**
*
* @return \System\Collections\Generic\IEnumerable`1[[Intel\IT\EAAS\LCap\Services\Aurora\Contract\PassportMatter, Contract, Version=1\0\0\0, Culture=neutral, PublicKeyToken=null]]
*/
public function GetAllMatters() { /* function body is hidden */ }

Thanks,
You do not have the required permissions to view the files attached to this post.
cadean
 
Posts: 2
Joined: August 24th, 2015, 6:32 pm

Re: using custom .net class in php

Postby Jakub Misek » August 26th, 2015, 1:23 pm

Hi,

Sorry for the delay.

Please ensure you are referencing your .NET dll from your Phalanger project.

You can either add reference within Visual Studio, or add following into your web.config or app.config
Code: Select all
<phpnet><classLibrary><add url='bin\mydll.dll' />


There is an example showing the first option at viewtopic.php?f=13&t=541 . I've updated the sample for latest Phalanger.

There might be an issue, if the class is not resolved in compile-time - in this case, I would suggest the second option and add reference into web.config/app.config so the reference will be resolved in runtime.
Jakub Misek │ DEVSENSE s.r.o. │ Email: jakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2056
Joined: January 4th, 2012, 2:42 pm
Location: Prague


Return to Phalanger Tools

Who is online

Users browsing this forum: No registered users and 1 guest

User Control Panel

Login

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 62 on January 7th, 2012, 10:54 pm

Users browsing this forum: No registered users and 1 guest
Phalanger