Announcement

  •  » Engine
  •  » High-level questions about codebase

#1 2015-02-16 20:28:53

hamiltont
Member
2015-02-06
12

High-level questions about codebase

Hello all,

I'm an experienced developer interested in modifying how piwigo works a bit. I'm reading the codebase to understand how it all works, and I have some questions.

1) Is there any documentation on the folder structure? E.g. what goes into "include", what goes into "admin/include", etc?

2) Is there a database abstraction layer, and is it documented? Seems like include/functions.php has some DB-abstracting code, but some of the code there interacts with the database and some of it interacts with objects

3) Is there a standard set of files that are always included? Where do I find this list of files, and what order are they included in

4) Do any files have file-level comments? If not, as a developer I'd point out that those comments are very valuable for understanding the codebase. Function-level comments are mostly valuable when you already understand what this collection of functions is used for

Thanks,
Hamilton

Offline

 

#2 2015-02-17 00:44:47

Serge D
Member
US
2014-07-15
383

Re: High-level questions about codebase

hamiltont wrote:

I'm an experienced developer interested in modifying how piwigo works a bit. I'm reading the codebase to understand how it all works, and I have some questions.

From below my feeling you want to branch and create your own code base, driving it in potentially different product :) may create licensing issue
if it is not the intent, then next best thing would be for you to suggest changes to the core and work with PWG team to improve Piwigo.

hamiltont wrote:

1) Is there any documentation on the folder structure? E.g. what goes into "include", what goes into "admin/include", etc?

yes and no. you need to read through dev docs to get the ideas - http://piwigo.org/doc/doku.php?id=start

hamiltont wrote:

2) Is there a database abstraction layer, and is it documented? Seems like include/functions.php has some DB-abstracting code, but some of the code there interacts with the database and some of it interacts with objects

Somewhat:

http://piwigo.org/doc/doku.php?id=dev:e … ial2&s[]=database

hamiltont wrote:

3) Is there a standard set of files that are always included? Where do I find this list of files, and what order are they included in

yes, one you download from home page
you could strip it down by removing all plugins and themes, but for themes you may want to keep default one to use it as base

hamiltont wrote:

4) Do any files have file-level comments? If not, as a developer I'd point out that those comments are very valuable for understanding the codebase. Function-level comments are mostly valuable when you already understand what this collection of functions is used for

You claim that you read code base, then you would know that code has file level comments.

Again, I have my doubts about your real intent, but please accept my apologies if I misread it

Offline

 

#3 2015-02-17 02:04:17

hamiltont
Member
2015-02-06
12

Re: High-level questions about codebase

From below my feeling you want to branch and create your own code base, driving it in potentially different product :) may create licensing issue. if it is not the intent, then next best thing would be for you to suggest changes to the core and work with PWG team to improve Piwigo.

Absolutely not the case, and I do hope to contribute once they complete the move over to a git-based system (patches are a special kind of hell). I suspect my goals will be achieved by creating a plugin, but that's naturally hard to do without understanding the code first. So far decent documentation has been pretty hard to find. Not complaining, I understand its an OS project, but the lack of clear docs is why I'm asking for any pointers that might save me tons of time

1) Is there any documentation on the folder structure? E.g. what goes into "include", what goes into "admin/include", etc?

yes and no. you need to read through dev docs to get the ideas - http://piwigo.org/doc/doku.php?id=start

Perhaps there is a great page I've missed, but I can't find anything on the file organization of the core codebase. I think I understand many of the concepts at this point, but knowing the intention behind the file organization would still be valuable

3) Is there a standard set of files that are always included? Where do I find this list of files, and what order are they included in

Sorry, I didn't mean the download. Let me clarify - out of all the *.inc.php files, is there some set of 5-10 that are exceptionally important? Given that the piwigo download contains ~80 files named *.inc.php, I'm looking for the ones that are most important if the goal is to understand how piwigo works

You claim that you read code base, then you would know that code has file level comments.

There are ~1200 php files alone in the downloaded code. Of course I haven't read them all, but from the set I've read I have only found one file (include/config_default.inc.php) that contains a file-level comment. Can you point me to some other files that do? Note that I'm not asking if the files contain a file-level license statement, I mean a file-level comment explaining the intent and/or purpose of the file

Again, I have my doubts about your real intent, but please accept my apologies if I misread it

You have, and I do. My apologies if I came off incorrectly, my goal here is to understand how piwigo works so I can contribute either via plugin/extension or core contributions

Thanks,
Hamilton

Last edited by hamiltont (2015-02-17 02:05:32)

Offline

 

#4 2015-02-17 11:24:22

flop25
Piwigo Team
2006-07-06
7037

Re: High-level questions about codebase

many functions are commented folowing the phpDocumentor way
[Bugtracker] ticket 2999

I would say the you have to create a ticket in our bugtracker and post a patch


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#5 2015-02-18 17:38:45

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13821

Re: High-level questions about codebase

Hi hamiltont,

hamiltont wrote:

[...] I do hope to contribute once they complete the move over to a git-based system (patches are a special kind of hell). I suspect my goals will be achieved by creating a plugin, but that's naturally hard to do without understanding the code first. So far decent documentation has been pretty hard to find. Not complaining, I understand its an OS project, but the lack of clear docs is why I'm asking for any pointers that might save me tons of time

Nice to read your willingness to contribute! Starting by a plugin is a good idea, but even when you code a plugin, it's easier when you understand the general organization of Piwigo code. I'm going to write something on the wiki and I will come back here to give the link.

I also read with attention that you're waiting (kind of) for a move to Git. Many plugins have already been moved to Github and I hope we will move Piwigo core soon. I'm sure other contributors are also waiting for that. [Forum, topic 24695] Switching to Git / GitHub?

3) Is there a standard set of files that are always included? Where do I find this list of files, and what order are they included in

The most important is certainly include/common.inc.php (which includes other files).

If you want to start trying to write a plugin, give a look at http://piwigo.org/doc/doku.php?id=dev:e … ns:plugins (especially plugin Skeleton, which is very useful for beginners)

Offline

 

#6 2015-02-19 03:59:50

hamiltont
Member
2015-02-06
12

Re: High-level questions about codebase

Thanks Piwigo team - good to know both the documentation style (I was noticing a pattern, wondered what would happen if I just pointed doxygen @ piwigo's codebase ;-) ) and to know that you're motivated about the move to github. I do hope you utilize their pull request system, as it's excellent for inline code comments. I've done my fair share of patches in the past and remember it as a special kind of hell - often the motivation to contribute was lost after wrestling with clumsy tools :-/

Offline

 
  •  » Engine
  •  » High-level questions about codebase

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact