danielsh Posted July 19, 2012 Share Posted July 19, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/265947-is-this-php-project-approach-good/ Share on other sites More sharing options...
ignace Posted July 19, 2012 Share Posted July 19, 2012 Why do you need to use PHP with C#? Why not use ASP.NET? Quote Link to comment https://forums.phpfreaks.com/topic/265947-is-this-php-project-approach-good/#findComment-1362747 Share on other sites More sharing options...
danielsh Posted July 19, 2012 Author Share Posted July 19, 2012 First question popping up for me too. 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. Quote Link to comment https://forums.phpfreaks.com/topic/265947-is-this-php-project-approach-good/#findComment-1362773 Share on other sites More sharing options...
KevinM1 Posted July 19, 2012 Share Posted July 19, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/265947-is-this-php-project-approach-good/#findComment-1362777 Share on other sites More sharing options...
danielsh Posted July 19, 2012 Author Share Posted July 19, 2012 thanks for the insight Kevin, will try Phalanger out. Quote Link to comment https://forums.phpfreaks.com/topic/265947-is-this-php-project-approach-good/#findComment-1362779 Share on other sites More sharing options...
ignace Posted July 19, 2012 Share Posted July 19, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/265947-is-this-php-project-approach-good/#findComment-1362794 Share on other sites More sharing options...
KevinM1 Posted July 19, 2012 Share Posted July 19, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/265947-is-this-php-project-approach-good/#findComment-1362854 Share on other sites More sharing options...
danielsh Posted July 20, 2012 Author Share Posted July 20, 2012 As Kevin just said, I'm not scared of php and in fact, I'd love learning it. But for this particular matter, Phalanger seems to be the perfect door to enter the php world. Think I'm gonna go for it. Quote Link to comment https://forums.phpfreaks.com/topic/265947-is-this-php-project-approach-good/#findComment-1362975 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.