PHP backend
hockeymikey opened this issue ยท 5 comments
Add some PHP backend so we can hook it into our websites. Then we can see stats like the biggest towns or what town is User A from.
For the JSON stuff you can use JSONApi plugin for bukkit:
https://github.com/alecgorge/jsonapi/wiki/How-to-create-custom-api-methods
I'll look into seeing if I can make an interface that responds with JSON strings, since this can be done in pure Java and should let you accomplish the same thing.
I'm not sure if jmhertlein uses an SQL database for the storage of towns. If he does, then it would be relatively simple (I studied HTML, PHP (Which includes MySQL)) to connect it to a database. It's as simple as creating all the calls... etc.. and getting the other person to just include the PHP File..
I'm not using a relational database to store data, no. It's all stored in flat files in .../plugins/MCTowns/saves/ as YAML files. At least, that's where they are in 2.2.0. The used to be just in the MCTowns folder, and made an awful mess in there.
So, just figuring out how to make a servlet to serve up JSON strings seems like the best idea.
(I actually have a branch where I 'tore up the carpet' and was rewriting a lot of the code to potentially use a database for storage. I've since resolved to never merge that branch into master, because there's just never enough data that a database is justified: it'd be slower, more complicated to query, and harder to maintain, and would give no real benefit.)