From: Jan T. <de...@us...> - 2002-06-02 19:31:26
|
Update of /cvsroot/net-script/netscript2/src/perl/NetScript/Util In directory usw-pr-cvs1:/tmp/cvs-serv570/Util Modified Files: ConfigurationParser.pm FileRetriever.pm Removed Files: ClassWrapper.pm FunctionWrapper.pm MemberWrapper.pm Log Message: * added library include facility * moved Wrappers to Engine * added emergency error page (if error page is missing) * changed configfilereader to be more generic * some performance improvements * overall bugfixing Index: ConfigurationParser.pm =================================================================== RCS file: /cvsroot/net-script/netscript2/src/perl/NetScript/Util/ConfigurationParser.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ConfigurationParser.pm 15 May 2002 18:23:11 -0000 1.3 --- ConfigurationParser.pm 2 Jun 2002 19:31:23 -0000 1.4 *************** *** 14,18 **** #*/ package NetScript::Util::ConfigurationParser; - use vars qw(@ISA $VERSION $CONFIG_FILE); #-------------------------------------------------------- --- 14,17 ---- *************** *** 20,31 **** #-------------------------------------------------------- - $CONFIG_FILE = 'configuration'; - #/** # Constructor # @public #*/ sub new { ! my $proto = shift; my $class = ref($proto) || $proto; my $this = {}; --- 19,29 ---- #-------------------------------------------------------- #/** # Constructor + # @param the location of the configuration file (local fs only) # @public #*/ sub new { ! my ($proto, $configfile ) = @_; my $class = ref($proto) || $proto; my $this = {}; *************** *** 33,37 **** my %settings = (); ! open( CFILE, "<$CONFIG_FILE" ); while( <CFILE> ) { unless( /^[ ]*#/ ) { #filter comments --- 31,36 ---- my %settings = (); ! ! open( CFILE, "<$configfile" ); while( <CFILE> ) { unless( /^[ ]*#/ ) { #filter comments *************** *** 47,57 **** } #/** ! # Returns the directory where the static files are located. #*/ ! sub staticDir { ! my ( $this ) = @_; ! $this -> { m_settings } -> { STATIC }; } 1; # make "require" happy... --- 46,62 ---- } + #/** ! # Returns the setting with the given name or undef ! # if the setting is not defined. ! # @param the name of the setting ! # @return the value of the setting ! # @public #*/ ! sub getSetting { ! my ( $this, $name ) = @_; ! return $this -> { m_settings } -> { $name }; } + 1; # make "require" happy... Index: FileRetriever.pm =================================================================== RCS file: /cvsroot/net-script/netscript2/src/perl/NetScript/Util/FileRetriever.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FileRetriever.pm 15 May 2002 18:23:11 -0000 1.5 --- FileRetriever.pm 2 Jun 2002 19:31:23 -0000 1.6 *************** *** 78,84 **** else { $this -> { m_Interpreter } -> getEventRelay() -> ! createAndRaiseEvent( NetScript::Interpreter -> FATAL_EVENT(), ! "[FileRetriever::retrieveFile]: error occured while retrieving the file $fileURI. (". ! $response -> status_line().")" ); return undef; --- 78,84 ---- else { $this -> { m_Interpreter } -> getEventRelay() -> ! createAndRaiseEvent( $NetScript::Interpreter::FATAL_EVENT, ! "[FileRetriever::retrieveFile]: error occured while retrieving the file $fileURI.\nError was:". ! $response -> status_line() ); return undef; *************** *** 88,92 **** # issue warning. $this -> { m_Interpreter } -> getEventRelay() -> ! createAndRaiseEvent( NetScript::Interpreter -> WARNING_EVENT(), "[FileRetriever::retrieveFile]: LWP is not available." ); --- 88,92 ---- # issue warning. $this -> { m_Interpreter } -> getEventRelay() -> ! createAndRaiseEvent( $NetScript::Interpreter::WARNING_EVENT, "[FileRetriever::retrieveFile]: LWP is not available." ); *************** *** 95,99 **** if ($fileURI =~ /(^[a-zA-Z]+:\/)/) { # check for unsupported protocol $this -> { m_Interpreter } -> getEventRelay() -> ! createAndRaiseEvent( NetScript::Interpreter -> FATAL_EVENT(), "[FileRetriever::retrieveFile]: unsupported protocol ".$1 ); --- 95,99 ---- if ($fileURI =~ /(^[a-zA-Z]+:\/)/) { # check for unsupported protocol $this -> { m_Interpreter } -> getEventRelay() -> ! createAndRaiseEvent( $NetScript::Interpreter::FATAL_EVENT, "[FileRetriever::retrieveFile]: unsupported protocol ".$1 ); *************** *** 102,106 **** elsif (! -e $fileURI) { # check if file exists $this -> { m_Interpreter } -> getEventRelay() -> ! createAndRaiseEvent( NetScript::Interpreter -> FATAL_EVENT(), "[FileRetriever::retrieveFile]: file not found ".$fileURI ); --- 102,106 ---- elsif (! -e $fileURI) { # check if file exists $this -> { m_Interpreter } -> getEventRelay() -> ! createAndRaiseEvent( $NetScript::Interpreter::FATAL_EVENT, "[FileRetriever::retrieveFile]: file not found ".$fileURI ); --- ClassWrapper.pm DELETED --- --- FunctionWrapper.pm DELETED --- --- MemberWrapper.pm DELETED --- |