Ticket #161 (closed task: fixed)

Opened 9 years ago

Last modified 7 years ago

Moving classes into separate files

Reported by: NilsLindenberg Owned by: NilsLindenberg
Priority: low Milestone: 1.1.6.2
Component: core Version: 1.1.6.1
Severity: normal Keywords: class, classes, libs, lib, file structute, code structure
Cc:

Description (last modified by DarTar) (diff)

As of version 1.1.6.1 there are two files which have classes integrated into them:

wikka.php has the class wakka

handlers/page/diff.php has some classes used for the page diff

Since it makes the files difficult to read and the code of the classes difficult to re-use (or to use in external projects), they should be moved into separate files in a special directory.

In a discussion with Dario, we came up with the libs directory (more or less standard for wiki-engines) and wakka.inc.php and diff.inc.php as names (note that  http://wikkawiki.org/WikkaCodeStructure will be changed to reflect this)

Change History

Changed 9 years ago by NilsLindenberg

  • status changed from new to closed
  • resolution set to fixed

for naming conventions, the file names where changed to:

libs/Wakka.class.php

libs/diff.lib.php

Changed 9 years ago by NilsLindenberg

closed in [59]

Changed 8 years ago by NilsLindenberg

adding the discussion from the SuggestionBox:

I use wikka as wiki engine of [ my page]. IMO, the wikka.php file is too big to be one single file. I suggest that we separate the Wakka class into new file, say Wakka.class.php And then in the wikka.php, e.g at line where the Wakka class previously located, simply we put: %% include ('Wakka.class.php'); %% -- DiN

DiN, this is a //very// good idea. I fact, the idea had crossed my mind already, but thanks for the reminder. :) Indeed, a class belongs in a file of its own. --JavaWoman

Maybe a folder called classes? the handlers/page/diff has a bunch of classes inside, too. --NilsLindenberg

With my current proposed structure on WikkaCodeStructure, it would go into the library folder; classes that are shared, into library/common. I prefer a //functional// separation rather than one based on coding format. --JavaWoman

Changed 8 years ago by DarTar

  • description modified (diff)
  • summary changed from Moving classes into seperate files to Moving classes into separate files

typos in the desc

Changed 7 years ago by JavaWoman

  • status changed from reopened to closed
  • resolution set to fixed

Seems to have been reopened by spam removal; closing again...

Note: See TracTickets for help on using tickets.