vdb:development
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
vdb:development [2006/11/09 17:51] – 205.252.23.9 | vdb:development [2006/11/13 13:48] (current) – old revision restored andi | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Development ====== | ||
+ | |||
+ | ===== Developer Ressources ===== | ||
+ | |||
+ | If you want to contribute to [[vdb: | ||
+ | |||
+ | To stay up to date you should also use the current CVS version of VideoDB to avoid writing something that maybe is already included there. You can get the current development version from the CVS Server either by browsing the [[http:// | ||
+ | |||
+ | cvs -d: | ||
+ | cvs -z3 -d: | ||
+ | |||
+ | When prompted for a password just hit enter. | ||
+ | |||
+ | Please note that the webbased access is up to 24 hours behind the real CVS Server so a real checkout is always to prefer. | ||
+ | |||
+ | Developers may be interested in the generated [[http:// | ||
+ | ===== Coding Guidelines ===== | ||
+ | |||
+ | The VideoDB coding guidelines follow the standards set by the PEAR project (http:// | ||
+ | |||
+ | ==== Indenting and Line Length ==== | ||
+ | |||
+ | Use an indent of 4 spaces, with no tabs. | ||
+ | It is recommended that you break lines at approximately 75-85 characters. There is no standard rule for the best way to break a line, use your judgment. | ||
+ | |||
+ | <code php> | ||
+ | if ((condition1) || (condition2)) { | ||
+ | action1; | ||
+ | } elseif ((condition3) && (condition4)) { | ||
+ | action2; | ||
+ | } else { | ||
+ | defaultaction; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== Control Structures ==== | ||
+ | |||
+ | Control statements should have one space between the control keyword and opening parenthesis, | ||
+ | You are strongly encouraged to always use curly braces even in situations where they are technically optional. Having them increases readability and decreases the likelihood of logic errors being introduced when new lines are added. | ||
+ | |||
+ | For switch statements: | ||
+ | |||
+ | <code php> | ||
+ | switch (condition) { | ||
+ | case 1: | ||
+ | action1; | ||
+ | break; | ||
+ | |||
+ | case 2: | ||
+ | action2; | ||
+ | break; | ||
+ | |||
+ | default: | ||
+ | defaultaction; | ||
+ | break; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== Function Calls ==== | ||
+ | |||
+ | Functions should be called with no spaces between the function name, the opening parenthesis, | ||
+ | |||
+ | <code php> | ||
+ | $var = foo($bar, $baz, $quux); | ||
+ | </ | ||
+ | |||
+ | |||
+ | As displayed above, there should be one space on either side of an equals sign used to assign the return value of a function to a variable. In the case of a block of related assignments, | ||
+ | |||
+ | <code php> | ||
+ | $short | ||
+ | $long_variable = foo($baz); | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== Function Definitions ==== | ||
+ | |||
+ | Function declarations follow the "one true brace" convention: | ||
+ | |||
+ | <code php> | ||
+ | function fooFunction($arg1, | ||
+ | { | ||
+ | if (condition) { | ||
+ | statement; | ||
+ | } | ||
+ | return $val; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Arguments with default values go at the end of the argument list. Always attempt to return a meaningful value from a function if one is appropriate. | ||
+ | |||
+ | ==== Comments ==== | ||
+ | |||
+ | Inline documentation for classes should follow the PHPDoc convention, similar to Javadoc. More information about PHPDoc can be found here: http:// | ||
+ | |||
+ | Non-documentation comments are strongly encouraged. A general rule of thumb is that if you look at a section of code and think "Wow, I don't want to try and describe that", you need to comment it before you forget how it works. | ||
+ | |||
+ | C style comments (/* */) and standard C++ comments (//) are both fine. Use of Perl/shell style comments (#) is discouraged. | ||
+ | |||
+ | |||
+ | ===== Languages ===== | ||
+ | |||
+ | VideoDB already comes with a lot of languages, but if your's isn't supported why don't you become a translator? | ||
+ | |||
+ | The first thing you should do is join the [[vdb: | ||
+ | |||
+ | To create a new language file just copy the en.php file in the language directory and translate the all the contained strings to your language. I think you'll get the system when you have a look at it ;-). | ||
+ | |||
+ | However pay attention to the '' | ||
+ | |||
+ | You should adjust the the header at the top of the file to reflect your authorship, too. ;-). When updating or correcting a file of someone else just add another '' | ||
+ | |||
+ | After translation you should send the file to the mailing list to be included in the next release. | ||
+ | |||
+ | Sometimes translations get slightly behind the english version. Missing translations will are always replaced by the english strings. | ||
+ | |||
+ | **Hint** The '' | ||
+ | |||
+ | ===== Templates and Stylesheets ===== | ||
+ | |||
+ | Instead of designing a whole new template you can add new stylesheets to existing templates. Just copy an exisisting stylesheet to a new name and adjust it to your match your ideas. All '' | ||
+ | |||
+ | If changing the stylesheet isn't enough to make VideoDB look like you want you can create a new template. Templates consist of multiple '' | ||
+ | |||
+ | The best way to create a new template is to copy the default template and customize it. | ||
+ | All files referenced to, can be found in the '' | ||
+ | |||
+ | 1. '' | ||
+ | |||
+ | 2. '' | ||
+ | |||
+ | 3. '' | ||
+ | |||
+ | 4. '' | ||