Jump to content

Is this php-project approach good?


danielsh

Recommended Posts

Hello everyone, my first post and hopefully I'm not commiting any "crime" by calling for your help and suggestions.

I've been placed into a project which is not that confortable to me.

 

It's basically an internal website for the company I'm working for. Users will select and update a SQL database.

My confy enviroment is .NET (c#) and SQL, so the DB part and the web code behind is OK (almost done by now).

So, why don't I feel great about it? Because I've never worked with php.

 

I started digging and hopefully php won't be that much of a hussle. But, the main problem came when I wanted to get php and c# together... It's not as easy as it is for ASP inside .NET.

Advices I've read gave me a few solutions.

 

.Web Service from C# then consume it from php.

.Phalanger so I can write php code inside .NET platform.

.DOT NET library in php so I can use them together but it's a no go since apparently it's not working for the 4.0 framework of .NET.

 

 

The one I like the most is Phalanger, guess I'd feel a little bit at home there in the platform. Have any of you tried it? Will you drop this option because of..?

 

So, I'd like you to give me your suggestions, maybe I'm wrong, maybe something's missing for me. Is there something specific that I should look up to in order to do the php<->C# thing?

All I need to do is the Presentation layer in php working with classes/objects/methods from my C# code. From there it's done, C# to SQL and back.

 

Thanks in advance.

 

 

Link to comment
Share on other sites

It just seems odd that the business logic would be written in C#, but the presentation layer is mandated to be PHP.  I mean, ASP.NET MVC seems like the ideal solution from what you've told us.

 

Barring being able to convince your bosses/client to change their mind(s), Phalanger sounds like it would be your best bet since it all gets compiled down into the .NET IL.  I haven't tried it, but if it works as well as its codeplex site suggests, you shouldn't have any problems.

Link to comment
Share on other sites

My confy enviroment is .NET (c#) and SQL, so the DB part and the web code behind is OK (almost done by now).

So, why don't I feel great about it? Because I've never worked with php.

 

Limitations from above, reasons are unclear since IIS and apache are both running.

Guess it's something to do with "consistency" since all projectes there are php ones.

 

Pick up a good book on PHP and start reading. PHP has a very low level to entry.. (Imagine the blank page in front of you is your main() body and the full set of library functions pre-#import'ed). Something any .NET vet should pick up in a weekend.

 

Just because it is out of your confy zone doesn't mean you have to add unnecessary layers like Phalanger to avoid to actually have to learn a new language.

Link to comment
Share on other sites

Just because it is out of your confy zone doesn't mean you have to add unnecessary layers like Phalanger to avoid to actually have to learn a new language.

 

Well, according to its own project page, Phalanger is PHP, just ported over to .NET.

 

Also, how else would you suggest he handle his already existing C# objects in PHP?  His issue isn't that he's scared of PHP, but rather there's an existing backend written in C# whose presentation layer needs to be written in PHP according to his boss/client.  Exposing the existing C# data via web service or, even worse, storing them in a DB, is far less efficient than using Phalanger in this instance. 

 

All .NET languages get translated into an intermediate language, then compiled down even further.  If Phalanger really is PHP for .NET, then the OP has the ideal solution based on his requirements.  He'll be able to use his C# objects directly (include a namespace and go), and everything will be compiled.  There's the obvious learning curve of PHP, but if they're competent in C#, they'll be fine. 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.