Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Changes made in preperation for Kiriwrite 0.4.0
[kiriwrite/.git] / Documentation / English (British) / developer-chapter3-guidance.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">\r
2 <html>\r
3         <head>\r
4                 <link href="style.css" REL="stylesheet" TYPE="text/css" MEDIA="screen">\r
5                 <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">\r
6                 <title>Kiriwrite Documentation - Developer Documentation - 3.1: Guidance</title>\r
7         </head>\r
8         <body>\r
9                 <div class="menubarback">\r
10                         <div class="menubar">\r
11                                 <span class="apptitle">Kiriwrite</span>\r
12                                 <a href="index.html">Index</a> | <a href="user.html">User \r
13 Documentation</a> | <a href="tutorial.html">Tutorial Documentation</a> | \r
14 <a href="developer.html">Developer Documentation</a>\r
15                         </div>\r
16                 </div>\r
17                 <div class="pageinformation">\r
18                         <span class="pagetitle">3.1 Guidance</span><br><br>\r
19 \r
20 When creating a new database module to be used in Kiriwrite, the following is required.<br><br>\r
21 \r
22 When creating a new database module, at the top of the page the following should be inserted:<br><br>\r
23 \r
24 <div class="code">\r
25     package Kiriwrite::Database::(modulename);<br><br>\r
26 \r
27     use strict;<br>\r
28     use warnings;<br><br>\r
29 \r
30     our $VERSION = &quot;(version)&quot;;<br>\r
31     my ($options, %options);<br>\r
32     my $database_handle;<br>\r
33     my $string_handle;<br>\r
34     my $error;<br>\r
35     my $errorext;<br>\r
36     my $database_filename;<br>\r
37     my $second_database_filename;\r
38 </div>\r
39 \r
40 <br>\r
41 \r
42 Replace (modulename) with the name of the module like MySQL5 (which means MySQL database server version 5.x). When specifying the module name it should be the name of the format (MySQL) and version (5 as in 6.x).<br><br>\r
43 \r
44 'use strict' and 'use warnings' isn't required but it is generally accepted that Perl scripts and modules should have 'use strict' and 'use warnings' lines written.<br><br>\r
45 \r
46 Replace (version) with the internal version number of the module.<br><br>\r
47 \r
48 If you're writing a file-based database module, additional code will need to be added for handling a second database, template database and filter database. An example of this is in the SQLite.pm source code.<br><br>\r
49 \r
50 The file-based database module should end with the filename .db.(modulename) such as .db.sqlite when using the SQLite module.<br><br>\r
51 \r
52 Database modules are stored in the Modules/Database directory. For an example of a written database module look at the MySQL5.pm/SQLite.pm files.<br><br>\r
53 \r
54 If a database error occurs while preforming a database operation then the error string from the database handle scalar ($database_handle) should be placed in the $errorext scalar.\r
55                 </div>\r
56         </body>\r
57 </html>\r
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy