python - How can I execute CGI files from PHP? -


I'm trying to create a web app that will manage the mercurial repository for me. I want it so much that when I Tell it to load the repository X:

  • Connect to a MySQL server and make sure X is present.
  • Check whether the user is allowed to use or not the repository.
  • If the above is correct, then get the location of x from a mysql server.
  • To run an hgweb cgi script (dragon) that contains paths of repository. Here's the problem, I want to: take the hgweb script, modify it, and run it. But I do not want to: take the hgweb script, modify it, type it in a file and redirect it there. I am using apache to run the httpd process.

The correct answer has been posted to Ryan Ballantine (I picked it up). The backtick operator is the way to execute a shell script.

The simplest solution is to modify the hgweb script so that it does not include "include" the path to the repository. Instead, give it as a command line argument. This means that you do not have to worry about modifying and writing the HGBBP script. All you have to do is:

to move from MySQL to the location of the store variable $ x // run shell script $ res = `python hgweb.py $ x ';

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -