Editing version 1 of page Considerations_for_moving_to_a_DB_back-end (the most recent revision is 3)
Use template:
None
API_Template
DevTrack_Template
Version_Template
Aneuch initially used, and likely always will use, a flat-file storage mechanism for is pages. However, it may be necessary at some point for an administrator to use a database back-end for his wiki.
It is my intent to develop a plugin to allow Aneuch to use a database as its back-end sometime in the near future. However, I will likely only write a plugin to use MySQL. The purpose of this page is two-fold. Firstly, to document the development of this MySQL plugin, and secondly, to document the internal workings of Aneuch that need to be modified by any plugin that wishes to implement its own database system.
===Expectations of Aneuch
====GetPage
Aneuch calls [[APIs GetPage|GetPage]] to read a page and its associated metadata from the page database. GetPage is expected to return a hash element which includes the contents of the page. They are (as of 0.30):
* **revision** - The revision number of the page (begins at 1)
* **summary** - The edit summary included by the author
* **text** - The text of the page itself (markup, contents, etc)
* **ts** - The timestamp of the page, in seconds since the epoch
* **ip** - The IP address of the author
* **diff** - The output from diff of the current revision in comparison to the previous
* **author** - The user name of the author
The table you store your pages in must have these columns in it. Revision is probably good as an integer. Summary and text should be varchar's or maybe just longtext. Ts will likely need to be a bigint. Ip can be a varchar(16) or just char(15). Diff should be longtext, and author can be something like varchar(31) or similar.
====WritePage
[[APIs WritePage|WritePage]] is used to store data to a page. It accepts these arguments, in order:
* **$file** - The name of the file to write (no directories, only the bare file name)
* **$content** - The contents of the page (markup, etc)
* **$user** - The author making the modification
WritePage will figure out all the rest of the information it needs (like timestamp, diff, ip, revision number). Obviously, if you replace this function, that will be your job to code those things. Feel free to look into the core Aneuch source to see what it does.
Depending on the table layout you choose (see [[#GetPage|above]] for details) you will have to code this function to write out the data in that table layout.
This page is a template
This file is locked by 3.148.106.2 (ec2-3-148-106-2.us-east-2.compute.amazonaws.com) since Sun Apr 27 04:20:07 UTC 2025 . Lock should expire by Sun Apr 27 04:25:07 UTC 2025, and it is now Sun Apr 27 04:20:17 UTC 2025.
Upload a file
By contributing to this wiki, you acknowledge that you waive your right to claim copyright of your individual contributions. The text of this site is uncopyrighted and released to the public domain.
Show markup help Styling **bold **, //italic //, __underline __, --strikethrough--, `teletype ` Headers = Level 1 =, == Level 2 ==, === Level 3 ===, ==== Level 4 ====, ===== Level 5 ===== (ending ='s optional) Lists * Unordered List, # Ordered List, ** Level 2 unordered, ### Level 3 ordered (up to 5 levels, NO SPACES IN FRONT) Links [[Page]], [[Page|description]], [[http://link]], [[http://link|description]] Images {{image.jpg}}, {{right:image.jpg}} (right aligned), [[link|{{image.jpg}}]] (image linked to link), {{image.jpg|alt text}} Extras ---- (horizonal rule), ~~~~ (signature)