Quellcode durchsuchen

Start work on API, symlink the cgis for testing porpoises

Andy Baugh vor 5 Jahren
Ursprung
Commit
5d0813f36e
4 geänderte Dateien mit 27 neuen und 1 gelöschten Zeilen
  1. 25 0
      cgi/api.cgi
  2. 0 1
      cgi/pgupgrade.cgi
  3. 1 0
      lib/Troglodyne/CGI/API.pm
  4. 1 0
      lib/Troglodyne/CGI/PgUpgrade.pm

+ 25 - 0
cgi/api.cgi

@@ -0,0 +1,25 @@
+#!/usr/local/cpanel/3rdparty/bin/perl
+#ACLS:all
+
+package Troglodyne::CGI::API;
+
+use strict;
+use warnings;
+
+use Cpanel::LoadModule::Custom ();
+use JSON::XS                   ();
+
+run() unless caller();
+ 
+sub run {
+    # Process the args
+
+    # Get back the datastruct from the called module.
+
+    # Emit the JSON
+    print "Content-type: application/json\r\n\r\n";
+    print JSON::XS::encode_json($ret);
+    exit;
+}
+
+1;

+ 0 - 1
cgi/pgupgrade.cgi

@@ -4,7 +4,6 @@
 
 package Troglodyne::CGI::PgUpgrade;
 
-# TODO move to lib/ and just symlink it into cgi? lol
 use strict;
 use warnings;
 

+ 1 - 0
lib/Troglodyne/CGI/API.pm

@@ -0,0 +1 @@
+../../../cgi/api.cgi

+ 1 - 0
lib/Troglodyne/CGI/PgUpgrade.pm

@@ -0,0 +1 @@
+../../../cgi/pgupgrade.cgi