2

I've been developing a metasearch engine for private torrent trackers for about a year and a half. It's written in PHP (some parts in OOP) and JS, simply because that's all I know.
Now I want to make a desktop version, a standalone cross platform application.

Basically, what the app does is:

  • Send login data to the tracker. (file_get_contents())
  • Receive the generated cookies. ($http_response_header)
  • Access the search URL using the generated cookies. (file_get_contents())
  • Parse the HTML response with regex. (preg_match())
  • Show results of all trackers.

Mainly works with remote sites.

The way the program works now, allows the user to add trackers to search without touching the main program code. They function as plug-ins. That's the regex part and the most important one. I will maintain both codes (PHP and desktop), so it is important to be able to implement regular expressions in the same way in both applications.

So, I need help on choosing the right language, to do the same I'm doing with PHP.

I leave the program page to help you better understand what it's about.
Official site
SourceForge

Sorry if this is a a silly question, but I need guidance.
Thanks in advance, azeós.

Reed
  • 14,703
  • 8
  • 66
  • 110
azeós
  • 4,853
  • 4
  • 21
  • 40
  • This is very general, but you could look at learning some Java in order to build a cross-platform desktop application. You'll need to get very comfortable with OOP and learn how to program GUI components. You'll also want to learn how to program web services to interface with your PHP-side public API. – Stegrex Sep 18 '12 at 04:07
  • Ok, that's two points for Java. And what about Python? I read that is an option to cross platform applications. For what I need, is there any reason for going for one and no for the other? – azeós Sep 18 '12 at 05:00
  • Reading other answers, looks like any language that has access to a GUI library could work. Main reason I mentioned Java is that it's fairly standard in schools, lots of resources. I haven't done any desktop stuff with Python, but I'm sure it could be useful too. In this case though, it really depends on ease of programming the GUI. Depending on which GUI you use, it could be easy, or it could be a total pain. In terms of portability, Java is still fairly standard out there today for portable desktop apps. – Stegrex Sep 18 '12 at 05:33
  • Unsure why this question was closed. I don't see any lack of specificity. Certainly "port to another language" is one possible answer, but the other answers are specific to getting a PHP application to work on the desktop: PHP-GTK, and wrapping a small webserver and browser, have already been given. There's also https://phalanger.codeplex.com/ as a possibility. – Dewi Morgan Oct 14 '15 at 04:34

2 Answers2

2

This could be a good opportunity to learn some Java, but you might also consider a library that gives PHP access to a GUI framework like http://gtk.php.net/.

There's a related question on SO that might also give you some ideas.

Community
  • 1
  • 1
GargantuChet
  • 5,691
  • 1
  • 30
  • 41
  • Actually I'm trying PHP GTK, but I think is time to learn a new language. Anyway, in the question you mention, they talk about "Phalanger", I'll give it a try. Thx. – azeós Sep 18 '12 at 04:52
  • I think C++ might be better suited for your application. Usually torrent related apps can easily go overboard and start using resources like crazy. However, try out this native desktop packager for PHP. http://www.nightrain.naetech.com/ – roosevelt Nov 13 '13 at 04:40
0

One sneaky way to distribute your application without forking your development process would be to leave most of the code as PHP and to include a copy of PHP and a lightweight web server (such as nginx). Those two are licensed under BSD-style licenses, which seem to be compatible with distribution. At that point, your "desktop application" would be a local web server, which the user can access at "http://localhost:12345" (or your port of choice) in their favorite web browser.

If this idea doesn't seem ridiculous enough yet, you can also consider using Mozilla XULRunner, which is a cross-platform desktop application engine on which Firefox runs. You would likely need to combine that with the server listed above. Depending on how much XUL you are willing to learn, you may find that the extra Javascript permissions give you enough power to run the whole application within XUL alone.

Jeff Bowman
  • 90,959
  • 16
  • 217
  • 251
  • I want to avoid the installation of external programs (aka web server). But, may be until I develop the desktop version, I could include a portable server with PHP. That's not a bad option... – azeós Sep 19 '12 at 03:43