are there any C++ version for PHP Snoopy?
Snoopy is a PHP class that provides the functionality of a web-browser.
http://sourceforge.net/projects/snoopy/
The closest pure C++ solution I know is people that have written there own browser automation or scraping using Qt and Webkit, though there doesn't seem to be a library you could interface directly with. Most of the code snippets that are posted using the Python binding to Qt and Webkit.
You could try using phantomjs directly as opposed to through its Javascript API.
Related
I need to make my PHP app cooperate with CPLEX Solver. The good news is I'm familiar with LP, but the bad news is I haven't used CPLEX until now. From the documentation I can see that using CPLEX is fairly easy through the integrated IDE, or via default C, JAVA, C#, Python APIs or a callable library API. Unfortunately, I can't seem to find any examples at all of CPLEX being used from PHP.
Is such a thing even possible? I know I can execute any bash command through exec, but CPLEX often requires several interactive steps to be performed to solve a single problem, and I don'g know how to do that from PHP;
If answer to 1. is 'yes', can anyone share even a simple example of how it can be done? I.e. a PHP script that calls CPLEX to resolve an LP problem.
There won't likely be any ready made examples because there is only a callable lib for C and an API for C++, Java and C#. There is also a separate Python API.
You could potentially use Gearman or write a REST wrapper in Python that your PHP app could consume.
Alternatively you could write your own PHP extension that wraps the C functions you need to call. Not sure if you can precisely what you need to do with Zephir but you could have a look - it's really simple to get started with...
I am using Google App Engine PHP SDK for Windows v1.8.8 and would like to use jQuery for client-side validation and Ajax interaction with a server-side Cloud SQL database. I haven't tried using it yet, but given the difficulties of client-side debugging, I thought I should ask some simple questions that I have not seen definitively answered anywhere:
Does the Google App Engine PHP SDK support jQuery natively?
Is there a jQuery file in the SDK that needs to be included in my scripts?
If I need to download a jQuery library, what would be a good choice?
Thank you for any information you can provide.
All of the App Engine SDKs are completely agnostic to client-side JavaScript frameworks. Use whatever you'd like. There's no direct notion of 'native' support.
When you deploy, you're welcome to use use as a CDN (Content Distribution Network) for jQuery. See https://developers.google.com/speed/libraries/devguide#jquery for supported versions of jQuery.
When I look through the source code files I have downloaded from the PHP website, I get lost so easy. What I would like to do is obtain all the source code needed to create a Console application that takes your PHP code and executes it. I would also like to maybe be able to add C++ functions and calll them from PHP. I have done this quite simply with Lua on my Mac via Xcode, but I don't think it will be that easy using PHP on a different system using a different program.
You can write PHP extensions using C (or C++, I suppose) to expose libraries to PHP, but PHP isn't designed to be embedded in applications other than web servers.
Little 2019 update about #duskwuff comment.
PHP8 will have JIT compiler, so, no, PHP will no longer be used only for web.
As you can see on image, PHP8 compiler is faster than Java, C compiler etc.
I like php, and I'm beginning to like java. I heard that jsp is officially deprecated (on the oracle website) and I'm trying to figure out how I could get data from a php script (from field data, image uploads) send it to my java program and have the results sent back to my php script.
Now I know I could use php for everything but some websites (such as google) use multiple back ends such as C and python.
There are several possibilities to interface PHP and Java. To name a few you coud try:
Make a Webservice in Java and call this Webservice in PHP.
Use another RPC protocol, like Thrift.
There is also the PHP/Java bridge.
Quercus is a PHP implementation in Java. When using this, you can just write functions in Java and call them from PHP.
PHP has experimental support for integrating Java.
I have developed a PHP web application, but a client insists on a real Windows application, since he doesn't like running the software inside a browser.
Are there any solutions for this, any compilers to turn a web project into a Windows exe ?
I have looked at Phc-Win , but that seems more suited for small command line utils, not for entire web-applications...
UPDATE:
just found this myself, both look quite promising...
http://www.zzee.com/phpexe/
http://www.exeoutput.com/index.php
There's no tool for this, short of a simple wrapper app that embeds a browser inside an otherwise normal application window. Your PHP app would have to be completely re-written to include ALL of the overhead code necessary to build a GUI - basically all the 'display' stuff that a browser does automatically, would have to added to your app.
Well some of you did not google good enough:
http://www.appcelerator.com/products/titanium-cross-platform-application-development/
Supports most of the "web-languages" to write native Applications.
Tutorial Reference for Appcelerator: http://appceleratortitanium.com/tutorials/3-appcelerator-titanium-tutorial-beginners.html
Quote:
"Q: What languages can I use to make desktop apps?
A: Javascript, PHP, Python, Ruby, HTML, HTML5, and CSS."
Not exactly what you are looking for: http://www.roadsend.co/home/index.php?pageID=compiler
You may look into "HipHop" (made by Facebook): Converts PHP to compileable C++-
There's a tool for this. :-) I never used it but you can try this: Winbinder.
It is simple to compile your PHP source code into an executable. Facebook released a compiler for PHP in early-2010, called HipHop, which aims to create C++. You could then compile this code, for example using gcc, to machine-code.
The more difficult point for a complex Web-App like yours is the user interface. When compiling the way I described above, the application can be run from command line - this might work for simple tasks, but not, if your application returns HTML.
One possibility to solve this problem is PHP-GTK. PHP-GTK is a API for GTK (the graphical user interface used by Linux Ubuntu by default), written in PHP. Using this solution would have to read some documentation about this API, and you would need to rewrite some parts of your program, but it would probably be the most beautiful solution, because it would create a "native" experience.
Another possible solution could involve Adobe AIR, which lets your create programs for the desktop, using HTML, CSS and JavaScript, but I don't know if and how this would work together with your compiled PHP.
Please also note that it isn't absolutely necessary to compile your PHP for it to run on the client's computer; You could also ship the PHP-interperter right with your (uncompiled) PHP-script. Of course, compiling brings benefits, such as faster execution of the program.
-- André