]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/hxsp/splitted/2.start.p.pl
First version of hxsp (new version of UWOBO implemented in Perl by
[helm.git] / helm / hxsp / splitted / 2.start.p.pl
diff --git a/helm/hxsp/splitted/2.start.p.pl b/helm/hxsp/splitted/2.start.p.pl
new file mode 100644 (file)
index 0000000..a123ca7
--- /dev/null
@@ -0,0 +1,49 @@
+#################################################################################################
+#################################################################################################
+#################################################################################################
+# Starting Operations
+#################################################################################################
+#################################################################################################
+#################################################################################################
+
+# chdir to the directory of this perl script
+chdir $FindBin::Bin;
+
+# load CONFIG
+load_conf();
+
+# initialize the objects to use LibXML and LibXSLT
+my $parser = XML::LibXML->new();
+my $xslt = XML::LibXSLT->new();
+
+# initialize the LibXML callbacks to load uri's
+XML::LibXML->callbacks(\&match_uri,\&open_uri,\&read_uri,\&close_uri);
+
+# include XIncludes on the fly if required
+if ($expand_xinc eq "ON") { $parser->expand_xinclude( 1 ); }
+
+# initialize the hxsp as HTTP::Daemon
+my $d = new HTTP::Daemon LocalPort => $port;
+
+# get the complete working url of hxsp
+my $puwobo_url = $d->url().$working_path;
+
+# set the working path to be comparable with url->path
+$working_path = "/". $working_path;
+
+# load messages
+load_messages();
+
+# load error
+load_err();
+
+# load templates
+load_templates();
+
+# print starting information on console
+print qq{
+hxsp v$ver active at: <URL:$puwobo_url>
+   Language is $language
+   On syntax error usage of every command is $all_usage_synerr
+   Include XIncludes on the fly is $expand_xinc;
+};