| Version 10<p> |
| <?php |
| |
| /* |
| require_once "/home/data/httpd/eclipse-php-classes/system/dbconnection_dashboard_rw.class.php"; |
| |
| $db_connection = new DBConnectionDashboard(); |
| $db_handle = $db_connection->connect(); |
| */ |
| |
| // $query = "CREATE TABLE COMMITS ( ID int not null auto_increment, DATE datetime, |
| // REPOSITORY text, FILENAME text, REVISION text, CHANGE_SIZE int, LOGIN text, |
| // MESSAGE_SIZE int, primary key (ID) )"; |
| |
| $filename = "/home/data/httpd/writable/community/pending0.txt"; |
| echo "filename=" . $filename . "<br>\n"; |
| echo "stat()="; |
| print_r(stat($filename)); |
| echo "<br>\n"; |
| $lines = file( $filename ); |
| if( $lines == FALSE ) { |
| echo "cannot open file<br>\n"; |
| } |
| foreach( $lines as $line ) { |
| list($year, $month, $day, $hour, $min, $sec, $repository, $user, $filepath, $revision) = explode( "|", $line ); |
| echo $line . "<br>\n"; |
| $query = "INSERT INTO COMMITS ( REPOSITORY, FILENAME, REVISION, LOGIN ) VALUES ( " |
| . "'$repository', " |
| . "'$filepath', " |
| . "'$revision', " |
| . "'$user' )"; |
| echo $query."<br>"; |
| /* |
| mysql_query($query,$db_handle) or die("Error executing: ".mysql_error()); |
| */ |
| } |
| |
| /* |
| * open the pendingN.txt file |
| * read each line |
| * 2: do a cvs log info get on that file |
| * 2: get the LOChange and LOLog |
| * 3: parse the log message for bug references |
| * write a database line |
| * 4: clear the pendingN.txt file |
| */ |
| |
| /* |
| $db_handle = null; |
| $db_connection = null; |
| */ |
| ?> |
| End of page<p> |