Solved

How to invoke HttpUnit from php code?

Posted on 2006-11-20
4
703 Views
Last Modified: 2006-11-23
I have a site, UrlAudit.com it takes a list of URL and scans them to detect things like, Popups, frame breakers, viruses, etc

We are trying to increase the functionality and the accuracy of the system.  We have installed HttpUnit, however, our programmer has read the dcumentation at http://httpunit.sourceforge.net/, but he says he can't figure out how to invoke HttpUnit with our scripts.

Question is:

How can we call HttpUnit from our PHP script to scan the lists of urls?
0
Comment
Question by:GodadoLLC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 100 total points
ID: 17985533
You wouldn't so much invoke HttpUnit, but a Java program that uses it. Something like

$command = "$path_to_java $classpath $fq_classname_of_java_app_using_httpunit";
$output = shell_exec("$command");
0
 
LVL 6

Accepted Solution

by:
SamsonChung earned 400 total points
ID: 17991100
just simply

<?php
$returned = exec("java $httpUnitName");

?>

if you are on a linux/unix system, you can also modulized the system by writing a shell script that calls the java app
and have php call that shell script.

so you can simply run the shell script to see if it is working or not.

remember, exec ("blah"); means blah is simply a shell/dos command. so it takes in arguments too.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 18003082
:-)
0
 
LVL 6

Expert Comment

by:SamsonChung
ID: 18003105
%:^)

Thanks
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Maven Project: Hibernate Dependencies Conflict 10 51
xampp tool 12 59
Tagging and Merging on Branch 1 42
batch vs regular insert in spring DAO 2 23
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question