Modified to work as a standalone executable. To install, just create a symlink to 'scanner' somewhere in your path (~/bin, /usr/bin, etc.) Mantis: 2691

git-svn-id: file:///srv/svn/scanner/trunk@13 a0501263-5b7a-4423-a8ba-1edf086583e7
This commit is contained in:
Correl Roush 2008-02-28 21:31:01 +00:00
parent dd214f3451
commit dda227a950
2 changed files with 8 additions and 3 deletions

1
scanner Symbolic link
View file

@ -0,0 +1 @@
scanner.php

View file

@ -1,4 +1,8 @@
#!/usr/bin/php
<?php
define( APP_PATH, dirname( realpath( __FILE__ ) ) );
set_include_path( APP_PATH );
require_once( 'parser.php' );
require_once( 'ncurses/ncurses.php' );
@ -298,7 +302,7 @@ if( $curses ) {
}
// Dig into the modules folder and load up what we find
$module_files = scandir( 'modules' );
$module_files = scandir( APP_PATH . '/modules' );
foreach( $module_files as $module_file ) {
if( strtolower( substr( $module_file, -4 ) ) == '.php' ) {
$module = substr( $module_file, 0, strlen( $module_file ) - 4 );
@ -306,7 +310,7 @@ foreach( $module_files as $module_file ) {
switch( $type ) {
case 'output':
if( $module == $config['output_format'] ) {
require_once( "modules/{$module_file}" );
require_once( APP_PATH . "/modules/{$module_file}" );
}
break;
case 'scanner':
@ -314,7 +318,7 @@ foreach( $module_files as $module_file ) {
count( $config['modules'] ) == 0
|| in_array( $module, $config['modules'] )
) {
require_once( "modules/{$module_file}" );
require_once( APP_PATH . "/modules/{$module_file}" );
}
break;
}