Page 1 of 1

Simple PHP Application

PostPosted: August 20th, 2012, 9:43 pm
by lllSpylll
I'm trying to compile a PHP library in .NET so it can be used in one of my .NET projects.

The code is very simple, but when debugging it in Visual Studio, the output of the function "explode" doesn't return the correct result.

Here's the PHP library I'm trying to compile:

Address Standardization Solution -- PHP 5 Edition
http://www.analysisandsolutions.com/sof ... -0.tar.bz2

1) I extracted the library, created a Class Library Phalanger project and set it to pure mode.

2) I created a file in my project called Library.php with the following contents:

<?php

[Export]
class Library
{
function __construct()
{
}
}

?>

3) I wrote a unit test that does the following:

object foo = new AddressStandardizationSolution().AddressLineStandardization("123 Main Street");


4) In the source code (AddressStandardizationSolution.php), there's a call to $parts = explode(' ', $address); I'm expecting it to return an array with 3 elements ["123", "Main", "Street"], but it returns array with 0 elements. I'm assuming there's something wrong here with my setup, but I can't tell what I'm doing wrong.

If anybody can help me, I'd appreciate it a lot. It should work, but doesn't.

Thanks for any help you can provide.