INIFile class

They’re zombies.:smiley:

I made an INI to JSON class right now, mostly untested, but I loaded this INI test successfully:

And it became this JSON:

{
  "network": {
    "mac": "01:23:45:67:89:AB",
    "gateway": "192.168.1.1",
    "ip": "192.168.1.2",
    "hosts allow": "example.com"
  },
  "network2": {
    "mac": "ee:ee:ee:ee:ee:ee",
    "subnet mask": "255.255.255.0",
    "hosts allow": "sloppy.example.com"
  },
  "misc": {
    "string": "123456789012345678901234567890123456789001234567890",
    "string2": "a string with spaces in it"
  },
  "mime types": {
    "default": "text/plain",
    "htm": "text/html",
    "bin": "application/octet-stream",
    "pdf": "application/pdf"
  },
  "/": {
    "handler": "default",
    "error document 403": "/errordoc/403.htm"
  },
  "/www.ini": {
    "handler": "default"
  },
  "/data": {
    "handler": "default"
  },
  "/data/private": {
    "handler": "prohibit",
    "error document 403": "/data/private/403.htm"
  },
  "/data/noaccess.txt": {
    "handler": "prohibit"
  },
  "/status": {
    "handler": "status"
  },
  "/cgi": {
    "handler": "cgi"
  },
  "/src": {
    "handler": "temporary redirect",
    "location": "http://github.com/stevemarple/WwwServer"
  },
  "/upload": {
    "allow put": "true"
  }
}
5 Likes