Announcement

  •  » Engine
  •  » Developper documentation

#1 2013-08-16 09:20:17

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Developper documentation

What about a nice documentation of our code ? (asked many times by users)

I propose we establish rules of functions comments, in order to be able to use http://www.phpdoc.org

First step would be to clean all functions and classes of Piwigo with a compatible comments syntax (see http://www.phpdoc.org/docs/latest/for-u … rence.html)

Perhaps we can share the work...


Next install PHPdoc on Piwigo.org server and perhaps create a template matching Piwigo colors.

If we decide to start that doc, all developpers must respect the coding syntax when modifying or adding functions.
About functions modification, I think it would be interesting in the description of a parameter, in witch version of Piwigo it was added (using markdown to highlight it). And obviously add the @since tag for new functions.

What do you think ? Is it doable for 2.6 ?

Offline

 

#2 2013-08-16 09:26:45

flop25
Piwigo Team
2006-07-06
7037

Re: Developper documentation

Hi
very good request
I've made one similar too

That would interest dev of extensions and so attract dev


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

 

#3 2013-08-20 18:56:19

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

Re: Developper documentation

Many functions are already have a DocBlock, for example:

Code:

/**
 * creates directory if not exists; ensures that directory is writable
 * @param:
 *  string $dir
 *  int $flags combination of MKGETDIR_xxx
 * @return bool false on error else true
 */
function mkgetdir($dir, $flags=MKGETDIR_DEFAULT)

or

Code:

/**
 * Redirects to the given URL (HTML method)
 *
 * Note : once this function called, the execution doesn't go further
 * (presence of an exit() instruction.
 *
 * @param string $url
 * @param string $title_msg
 * @param integer $refreh_time
 * @return void
 */
function redirect_html( $url , $msg = '', $refresh_time = 0)

so I think it would be good to make this documentation officially requested.

mistic wrote:

Is it doable for 2.6 ?

I don't think we can say "let's make the whole code comply with phpDocumentor for 2.6". But we can say that from now we respect the syntax for new functions/classes and that we progressively add/convert docBlocks.

mistic wrote:

interesting in the description of a parameter, in witch version of Piwigo it was added

Not always easy to know (a change in the line endings will break investigation in SVN history)

mistic wrote:

add the @since tag for new functions.

Yes! easy and very useful.

Offline

 

#4 2013-08-20 19:01:51

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: Developper documentation

plg wrote:

mistic wrote:

interesting in the description of a parameter, in witch version of Piwigo it was added

Not always easy to know (a change in the line endings will break investigation in SVN history)

I'm not talking about something retroactive, it can be done for some parameters if devs remember, but otherwise it's impossible (or someone must explore all commits and check each function individually :-) )

Offline

 

#5 2013-08-20 19:03:39

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: Developper documentation

I don't know how PHPDoc is flexible, does he understand various syntaxes from scratch or must the syntax be exactly as described in their doc ? (it's an open question, I don't expect an answer ^^)

Offline

 

#6 2013-11-10 18:04:47

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: Developper documentation

Offline

 
  •  » Engine
  •  » Developper documentation

Board footer

Powered by FluxBB

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